extracting validation methods into classes