perfected creating component tree nodes