Clean up code in PositionCounter (nested for removal).