Refactor menu_entries_pop_stack