Reworking some code to use the new CocoModel.patch method.