optimize queries for the menu