moved runValidation to a private function, improved require usage to increase performance