Setup the tree structure properly