refactor login view