Component tree building