Refactored undo command text generator into a separate private method
Refresh texts of undo commands after they are merged