better template class