change BitVector to template class