Perhaps this tree building logic should move into timelineItem. I think that would help to address the rebulidng problem.