Improve generating main menu