factored out creating context menus