The continued reuse of `cleanedPositions` below is confusing.