validate fields - refactoring