Cleaned up code + undo stack now counts it as one item.