A little refactoring to custom field validator class