refactor uniforms in code generation