refine local compatibility patches