Refactor for validation.