Refactored the validator api