change order of template class, add a test