start moving some codegen to java