Refactored register form processing to idiomatic scala