Minor refactoring in XhrStream.