Refactoring validators using tokenized words