Refactored the main menu into a new type