factor out all the error messages of the registration form