Refactor login page