First optimization of menu.c