Remove some code duplication (validation rules)