Moved login logic to AuthenticationHelper class