refactoring Validator constructor