Refactoring of the validator (in progress)