refactor gpx parsing