Moving menu code to the core.