Validator and Generator refactored