refactoring validation error messages and several issues