clean up track and event parsing code