Reorganize how the menu is constructed