Cleaning up bit vector code