introducing the 'validate' class method for custom validations