Move heavy compiting outside the rendering