Registration form: refactoring