Refactored main menu toggle