Refactoring of LoginActivity