added template_tools.h