refactored traffic parser