refactor polyline fix