Correct way to get template class