Created separate class for validation functions

A little bit of cleanup.