Increase code reuse in the tree views