improvements to menu code