use metaclass programming to fix the bitarray factory