add wrappers of building static tree to make it testable