login form refactored