refactoring out context menu