create a _template function to wrap the template function