Added more methods to the window class and refactored some methods in the treeview class.