TrackProvider rewritten with Swift