Updating the tree
Code improvement