refactor login page