reorganize bloom filter code