Minor refactoring in Authentication.php