Break undo helpers into functions