cleaned up form validation and error messaging