move rendering to component