reworked to have instantiation in the component