Updated the component to build a tree data structure from the supplied object for easier traversal.