Cleaning the tree