Refactoring the validator classes