field validation, refactoring