Successful refactoring of authenticationService