Refactor render_to_string so it's a little shorter and simpler.