Better management lifetime of treebuilder's cached data.