Extract more functions out of renderGraph()