working on adding collapse
Refactored templates to enable collapsing of trees easier