refactored main menu action