template function call handling