Refactor menu_defer_core