Split out the template functions into parse_template.c