Refactored login form to use template parser