Move root element factory into 'stream'