The validation and `-setValue:forKey:` can also be factored out, so a function like `MTLValidateAndSetValueForKey()` might make more sense.