Refactor: Moved from ReplayControl to CaptureRace, the logic to detect end of race.