factored out creating context menus
Merge pull request #142 from coldstar96/factor-out-context-menu-creation

factored out creating context menus