Split template_args population and template rendering into separate functions