refactored main menu