Refactor target-inspecting code from the context menu
wip for non-sync context menu
more wip