Refactored register form