improved channels and code generation