diff --git a/backend-api/src/main/kotlin/com/example/WebServiceFactory.kt b/backend-api/src/main/kotlin/com/example/WebServiceFactory.kt
index 8ac559d..4593930 100644
--- a/backend-api/src/main/kotlin/com/example/WebServiceFactory.kt
+++ b/backend-api/src/main/kotlin/com/example/WebServiceFactory.kt
@@ -43,7 +43,7 @@ class WebServiceFactory(baseUrl: String) {
         return retrofit.create(service.java)
     }
 
-    suspend fun authenticate(action: suspend () -> Response<Unit>) {
+    suspend fun authenticate(action: suspend WebServiceFactory.() -> Response<Unit>) {
         val authHeader: String? = action().run {
             if (isSuccessful) headers().get("Authorization") else null
         }
diff --git a/backend/src/test/kotlin/com/example/backend/CustomerApiTests.kt b/backend/src/test/kotlin/com/example/backend/CustomerApiTests.kt
index 0c64460..98c6d77 100644
--- a/backend/src/test/kotlin/com/example/backend/CustomerApiTests.kt
+++ b/backend/src/test/kotlin/com/example/backend/CustomerApiTests.kt
@@ -40,14 +40,14 @@ class CustomerApiTests {
 
     private suspend fun authenticate() {
         factory.authenticate {
-            factory.create<AuthenticationService>()
+            create<AuthenticationService>()
                 .login(Credentials("user", "user_password"))
         }
     }
 
     private suspend fun authenticateAsAdmin() {
         factory.authenticate {
-            factory.create<AuthenticationService>()
+            create<AuthenticationService>()
                 .login(Credentials("admin", "admin_password"))
         }
     }