extracted down-sampling of waypoint cache to its own function