Isolated template function