reflect changes in template.cc