move all render logic into render_single