refactored method names in login.js