register form with validation callbacks

clean code style