Extract methods from validate function