add cache for class template