refactoring login page