refactoring main menu