Refactoring the InputValidator