is there any value in having this as a separate function? Why not just replace `extract_local_patches`?