Refactor. Added waypoints helper.