Removed unused code from patch_handler