Add general patching mechanisms