move stream to common module