Simplify codegen significantly