Optimizing menu.java