move rendering out from core