template class for collections