refactor login pages