Moved treeview method under MessageFunctions class