Minor refactoring for field validator