Changed component factory to handle component configuration