Sets up the validator.