refactor get_menu_number