Implement utility for building tree, see #3