validator module for common functions