refactoring the tree presentation