[Polylines] refactored forEachPolyline