simplify inplace patching