refactored registration form