Use iterators instead of streams for tree building.