cleaned up codegen