Rework the dom tree diffing