Minor refactories in the login controller