loginForm refactoring