code cleanup and menu items fix