small refactor to authentication service