Add template_function decorator.