validator refactoring