better validation error messages
refactoring