Initially added context menu in treeView and cleaned some code