refine the tree