refactor: add validator.