Mostly make logic more consistent with better variable naming, early returns, and separated functions. But also avoid adding some tags if the corresponding data hasn't changed. For example, don't tag the mesh positions changed if the undo nodes only contained color or face set information.