updated with menu item and refactoring