feat: use new buildTree utility function
#71
+113
−33
buildTree utility function
#71