Separate code generation from streaming