Refactor validation.
Refactor validation.