Refactor menu_list_pop_stack functions