Extract template usage to a class