refactor find next clear bit