optimize createStream