more refactoring of diffing stuff