Improved the tree structure