This data structure doesn't lend itself well to being iterated in Javascript / front-end code. For want of something better, I am using a flat list of branches for now.