refactor bitstream tests and read files faster