Refactor MODE_MENU_PREINIT code