Refactored Login.