Maybe we could even factor this out and move it to the internal package so we can re-use it in other parts (not sure we use a BitSet anywhere atm though)