Cleaning the tree element detail functions