Clean up of menu commands and code structure