refactored menuItemListener, and TextWindos