menu code cleanup