made template class sample simpler