Add templatesFn feature.