Generalize code for migration changes