refactored ensureStreams