first steps towards abstracting internal implementation details of trees