improved menu and code cleanup