Rewrote constructComponent to call addComponent.

The body of constructComponent was almost identical to addComponent
so it was rewritten to call addComponent.