refactoring login form and changing to email login