Refactoring: DRY AttributeValidator implementation