Moving functionality of treeView out of mainWindow