Moving all the functionality to the Authenticator class