Added possibility to factory elements with a component as argument