login form refactor