change reference counting to component level