This `_squash_changes` method is quite complex, would it be possible to refactorize it a little bit with some more detailed sub method? Thanks!