Refactor validator.
More validator refactoring.