Generate methods in class writer

Change-Id: I7c3dca3a67d946ffc62d3726d1ef89373062f318
diff --git a/build.gradle b/build.gradle
index 82d825a..7c3743f 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1025,6 +1025,7 @@
     from sourceSets.test.output
     // We only want to include tests that use R8 when generating keep rules for applymapping.
     include "com/android/tools/r8/**"
+    include "android/**"
     include "dalvik/**"
 }
 
diff --git a/src/main/java/com/android/tools/r8/cf/CfCodePrinter.java b/src/main/java/com/android/tools/r8/cf/CfCodePrinter.java
index 327c5d0..293e189 100644
--- a/src/main/java/com/android/tools/r8/cf/CfCodePrinter.java
+++ b/src/main/java/com/android/tools/r8/cf/CfCodePrinter.java
@@ -125,8 +125,8 @@
             .append(" ")
             .append(methodName)
             .append("(")
-            .append(r8Type("InternalOptions", "utils"))
-            .append(" options, ")
+            .append(dexItemFactoryType())
+            .append(" factory, ")
             .append(r8Type("DexMethod", "graph"))
             .append(" method) {");
 
@@ -268,7 +268,7 @@
   }
 
   private String dexString(DexString string) {
-    return "options.itemFactory.createString(" + quote(string.toString()) + ")";
+    return "factory.createString(" + quote(string.toString()) + ")";
   }
 
   private final Map<String, String> knownTypeFields =
@@ -304,17 +304,15 @@
     String descriptor = type.toDescriptorString();
     String field = knownTypeFields.get(descriptor);
     if (field != null) {
-      return "options.itemFactory." + field;
+      return "factory." + field;
     }
     synthesizedTypes.add(descriptor);
-    return "options.itemFactory.createType(" + quote(descriptor) + ")";
+    return "factory.createType(" + quote(descriptor) + ")";
   }
 
   private String dexProto(DexProto proto) {
     StringBuilder builder =
-        new StringBuilder()
-            .append("options.itemFactory.createProto(")
-            .append(dexType(proto.returnType));
+        new StringBuilder().append("factory.createProto(").append(dexType(proto.returnType));
     for (DexType param : proto.parameters.values) {
       builder.append(", ").append(dexType(param));
     }
@@ -322,7 +320,7 @@
   }
 
   private String dexMethod(DexMethod method) {
-    return "options.itemFactory.createMethod("
+    return "factory.createMethod("
         + dexType(method.holder)
         + ", "
         + dexProto(method.proto)
@@ -332,7 +330,7 @@
   }
 
   private String dexField(DexField field) {
-    return "options.itemFactory.createField("
+    return "factory.createField("
         + dexType(field.holder)
         + ", "
         + dexType(field.type)
diff --git a/src/main/java/com/android/tools/r8/graph/DexEncodedMethod.java b/src/main/java/com/android/tools/r8/graph/DexEncodedMethod.java
index 8f74d49..ce22d5c 100644
--- a/src/main/java/com/android/tools/r8/graph/DexEncodedMethod.java
+++ b/src/main/java/com/android/tools/r8/graph/DexEncodedMethod.java
@@ -1530,8 +1530,13 @@
       return this;
     }
 
+    public Builder setCode(Function<DexMethod, Code> fn) {
+      this.code = fn.apply(method);
+      return this;
+    }
+
     public Builder unsetCode() {
-      return setCode(null);
+      return setCode((Code) null);
     }
 
     public Builder setGenericSignature(MethodTypeSignature methodSignature) {
diff --git a/src/main/java/com/android/tools/r8/ir/desugar/BackportedMethodRewriter.java b/src/main/java/com/android/tools/r8/ir/desugar/BackportedMethodRewriter.java
index 5011171..9a4e70c 100644
--- a/src/main/java/com/android/tools/r8/ir/desugar/BackportedMethodRewriter.java
+++ b/src/main/java/com/android/tools/r8/ir/desugar/BackportedMethodRewriter.java
@@ -1078,8 +1078,8 @@
                 ? new InvokeRewriter(method, CollectionMethodRewrites.rewriteMapOfEmpty())
                 : new MethodGenerator(
                     method,
-                    (options, methodArg) ->
-                        CollectionMethodGenerators.generateMapOf(options, methodArg, formalCount)));
+                    (ignore, methodArg) ->
+                        CollectionMethodGenerators.generateMapOf(factory, methodArg, formalCount)));
       }
       proto = factory.createProto(type, factory.createArrayType(1, factory.mapEntryType));
       method = factory.createMethod(type, proto, "ofEntries");
@@ -1696,15 +1696,17 @@
                       .disableAndroidApiLevelCheck()
                       .setProto(getProto(appView.dexItemFactory()))
                       .setAccessFlags(MethodAccessFlags.createPublicStaticSynthetic())
-                      .setCode(methodSig -> generateTemplateMethod(appView.options(), methodSig)));
+                      .setCode(
+                          methodSig ->
+                              generateTemplateMethod(appView.dexItemFactory(), methodSig)));
     }
 
     public DexProto getProto(DexItemFactory itemFactory) {
       return method.proto;
     }
 
-    public Code generateTemplateMethod(InternalOptions options, DexMethod method) {
-      return factory.create(options, method);
+    public Code generateTemplateMethod(DexItemFactory dexItemFactory, DexMethod method) {
+      return factory.create(dexItemFactory, method);
     }
   }
 
@@ -1743,7 +1745,7 @@
 
   private interface TemplateMethodFactory {
 
-    CfCode create(InternalOptions options, DexMethod method);
+    CfCode create(DexItemFactory factory, DexMethod method);
   }
 
   public interface MethodInvokeRewriter {
diff --git a/src/main/java/com/android/tools/r8/ir/desugar/backports/BackportedMethods.java b/src/main/java/com/android/tools/r8/ir/desugar/backports/BackportedMethods.java
index 99b113d..bf643ae 100644
--- a/src/main/java/com/android/tools/r8/ir/desugar/backports/BackportedMethods.java
+++ b/src/main/java/com/android/tools/r8/ir/desugar/backports/BackportedMethods.java
@@ -47,7 +47,6 @@
 import com.android.tools.r8.ir.code.MemberType;
 import com.android.tools.r8.ir.code.NumericType;
 import com.android.tools.r8.ir.code.ValueType;
-import com.android.tools.r8.utils.InternalOptions;
 import com.google.common.collect.ImmutableList;
 import it.unimi.dsi.fastutil.ints.Int2ObjectAVLTreeMap;
 import java.util.ArrayDeque;
@@ -119,7 +118,7 @@
   }
 
   public static CfCode AtomicReferenceArrayMethods_compareAndSet(
-      InternalOptions options, DexMethod method) {
+      DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -136,11 +135,10 @@
                     new int[] {0, 1, 2, 3},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType(
-                              "Ljava/util/concurrent/atomic/AtomicReferenceArray;")),
+                          factory.createType("Ljava/util/concurrent/atomic/AtomicReferenceArray;")),
                       FrameType.intType(),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfLoad(ValueType.OBJECT, 0),
             new CfLoad(ValueType.INT, 1),
@@ -148,15 +146,14 @@
             new CfLoad(ValueType.OBJECT, 3),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType(
-                        "Ljava/util/concurrent/atomic/AtomicReferenceArray;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.booleanType,
-                        options.itemFactory.intType,
-                        options.itemFactory.objectType,
-                        options.itemFactory.objectType),
-                    options.itemFactory.createString("compareAndSet")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/concurrent/atomic/AtomicReferenceArray;"),
+                    factory.createProto(
+                        factory.booleanType,
+                        factory.intType,
+                        factory.objectType,
+                        factory.objectType),
+                    factory.createString("compareAndSet")),
                 false),
             new CfIf(If.Type.EQ, ValueType.INT, label2),
             label1,
@@ -168,22 +165,19 @@
                     new int[] {0, 1, 2, 3},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType(
-                              "Ljava/util/concurrent/atomic/AtomicReferenceArray;")),
+                          factory.createType("Ljava/util/concurrent/atomic/AtomicReferenceArray;")),
                       FrameType.intType(),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfLoad(ValueType.OBJECT, 0),
             new CfLoad(ValueType.INT, 1),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType(
-                        "Ljava/util/concurrent/atomic/AtomicReferenceArray;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.objectType, options.itemFactory.intType),
-                    options.itemFactory.createString("get")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/concurrent/atomic/AtomicReferenceArray;"),
+                    factory.createProto(factory.objectType, factory.intType),
+                    factory.createString("get")),
                 false),
             new CfLoad(ValueType.OBJECT, 2),
             new CfIfCmp(If.Type.EQ, ValueType.OBJECT, label0),
@@ -196,7 +190,7 @@
   }
 
   public static CfCode AtomicReferenceFieldUpdaterMethods_compareAndSet(
-      InternalOptions options, DexMethod method) {
+      DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -213,11 +207,11 @@
                     new int[] {0, 1, 2, 3},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType(
+                          factory.createType(
                               "Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;")),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfLoad(ValueType.OBJECT, 0),
             new CfLoad(ValueType.OBJECT, 1),
@@ -225,15 +219,14 @@
             new CfLoad(ValueType.OBJECT, 3),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType(
-                        "Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.booleanType,
-                        options.itemFactory.objectType,
-                        options.itemFactory.objectType,
-                        options.itemFactory.objectType),
-                    options.itemFactory.createString("compareAndSet")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;"),
+                    factory.createProto(
+                        factory.booleanType,
+                        factory.objectType,
+                        factory.objectType,
+                        factory.objectType),
+                    factory.createString("compareAndSet")),
                 false),
             new CfIf(If.Type.EQ, ValueType.INT, label2),
             label1,
@@ -245,22 +238,20 @@
                     new int[] {0, 1, 2, 3},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType(
+                          factory.createType(
                               "Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;")),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfLoad(ValueType.OBJECT, 0),
             new CfLoad(ValueType.OBJECT, 1),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType(
-                        "Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.objectType, options.itemFactory.objectType),
-                    options.itemFactory.createString("get")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;"),
+                    factory.createProto(factory.objectType, factory.objectType),
+                    factory.createString("get")),
                 false),
             new CfLoad(ValueType.OBJECT, 2),
             new CfIfCmp(If.Type.EQ, ValueType.OBJECT, label0),
@@ -273,7 +264,7 @@
   }
 
   public static CfCode AtomicReferenceMethods_compareAndSet(
-      InternalOptions options, DexMethod method) {
+      DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -290,23 +281,20 @@
                     new int[] {0, 1, 2},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType(
-                              "Ljava/util/concurrent/atomic/AtomicReference;")),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                          factory.createType("Ljava/util/concurrent/atomic/AtomicReference;")),
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfLoad(ValueType.OBJECT, 0),
             new CfLoad(ValueType.OBJECT, 1),
             new CfLoad(ValueType.OBJECT, 2),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/concurrent/atomic/AtomicReference;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.booleanType,
-                        options.itemFactory.objectType,
-                        options.itemFactory.objectType),
-                    options.itemFactory.createString("compareAndSet")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/concurrent/atomic/AtomicReference;"),
+                    factory.createProto(
+                        factory.booleanType, factory.objectType, factory.objectType),
+                    factory.createString("compareAndSet")),
                 false),
             new CfIf(If.Type.EQ, ValueType.INT, label2),
             label1,
@@ -318,18 +306,17 @@
                     new int[] {0, 1, 2},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType(
-                              "Ljava/util/concurrent/atomic/AtomicReference;")),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                          factory.createType("Ljava/util/concurrent/atomic/AtomicReference;")),
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/concurrent/atomic/AtomicReference;"),
-                    options.itemFactory.createProto(options.itemFactory.objectType),
-                    options.itemFactory.createString("get")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/concurrent/atomic/AtomicReference;"),
+                    factory.createProto(factory.objectType),
+                    factory.createString("get")),
                 false),
             new CfLoad(ValueType.OBJECT, 1),
             new CfIfCmp(If.Type.EQ, ValueType.OBJECT, label0),
@@ -341,7 +328,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode BooleanMethods_compare(InternalOptions options, DexMethod method) {
+  public static CfCode BooleanMethods_compare(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -382,7 +369,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode BooleanMethods_hashCode(InternalOptions options, DexMethod method) {
+  public static CfCode BooleanMethods_hashCode(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -411,7 +398,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode ByteMethods_compare(InternalOptions options, DexMethod method) {
+  public static CfCode ByteMethods_compare(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     return new CfCode(
@@ -429,7 +416,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode ByteMethods_compareUnsigned(InternalOptions options, DexMethod method) {
+  public static CfCode ByteMethods_compareUnsigned(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     return new CfCode(
@@ -451,7 +438,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode ByteMethods_toUnsignedInt(InternalOptions options, DexMethod method) {
+  public static CfCode ByteMethods_toUnsignedInt(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     return new CfCode(
@@ -469,7 +456,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode ByteMethods_toUnsignedLong(InternalOptions options, DexMethod method) {
+  public static CfCode ByteMethods_toUnsignedLong(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     return new CfCode(
@@ -488,7 +475,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode CharSequenceMethods_compare(InternalOptions options, DexMethod method) {
+  public static CfCode CharSequenceMethods_compare(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -512,20 +499,20 @@
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.charSequenceType,
-                    options.itemFactory.createProto(options.itemFactory.intType),
-                    options.itemFactory.createString("length")),
+                factory.createMethod(
+                    factory.charSequenceType,
+                    factory.createProto(factory.intType),
+                    factory.createString("length")),
                 true),
             new CfStore(ValueType.INT, 2),
             label1,
             new CfLoad(ValueType.OBJECT, 1),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.charSequenceType,
-                    options.itemFactory.createProto(options.itemFactory.intType),
-                    options.itemFactory.createString("length")),
+                factory.createMethod(
+                    factory.charSequenceType,
+                    factory.createProto(factory.intType),
+                    factory.createString("length")),
                 true),
             new CfStore(ValueType.INT, 3),
             label2,
@@ -540,8 +527,8 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2, 3},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.charSequenceType),
-                      FrameType.initializedNonNullReference(options.itemFactory.charSequenceType),
+                      FrameType.initializedNonNullReference(factory.charSequenceType),
+                      FrameType.initializedNonNullReference(factory.charSequenceType),
                       FrameType.intType(),
                       FrameType.intType()
                     })),
@@ -552,13 +539,10 @@
             new CfLoad(ValueType.INT, 3),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Math;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.intType,
-                        options.itemFactory.intType,
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("min")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Math;"),
+                    factory.createProto(factory.intType, factory.intType, factory.intType),
+                    factory.createString("min")),
                 false),
             new CfStore(ValueType.INT, 5),
             label6,
@@ -566,8 +550,8 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2, 3, 4, 5},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.charSequenceType),
-                      FrameType.initializedNonNullReference(options.itemFactory.charSequenceType),
+                      FrameType.initializedNonNullReference(factory.charSequenceType),
+                      FrameType.initializedNonNullReference(factory.charSequenceType),
                       FrameType.intType(),
                       FrameType.intType(),
                       FrameType.intType(),
@@ -581,11 +565,10 @@
             new CfLoad(ValueType.INT, 4),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.charSequenceType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.charType, options.itemFactory.intType),
-                    options.itemFactory.createString("charAt")),
+                factory.createMethod(
+                    factory.charSequenceType,
+                    factory.createProto(factory.charType, factory.intType),
+                    factory.createString("charAt")),
                 true),
             new CfStore(ValueType.INT, 6),
             label8,
@@ -593,11 +576,10 @@
             new CfLoad(ValueType.INT, 4),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.charSequenceType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.charType, options.itemFactory.intType),
-                    options.itemFactory.createString("charAt")),
+                factory.createMethod(
+                    factory.charSequenceType,
+                    factory.createProto(factory.charType, factory.intType),
+                    factory.createString("charAt")),
                 true),
             new CfStore(ValueType.INT, 7),
             label9,
@@ -614,8 +596,8 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2, 3, 4, 5},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.charSequenceType),
-                      FrameType.initializedNonNullReference(options.itemFactory.charSequenceType),
+                      FrameType.initializedNonNullReference(factory.charSequenceType),
+                      FrameType.initializedNonNullReference(factory.charSequenceType),
                       FrameType.intType(),
                       FrameType.intType(),
                       FrameType.intType(),
@@ -628,8 +610,8 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2, 3},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.charSequenceType),
-                      FrameType.initializedNonNullReference(options.itemFactory.charSequenceType),
+                      FrameType.initializedNonNullReference(factory.charSequenceType),
+                      FrameType.initializedNonNullReference(factory.charSequenceType),
                       FrameType.intType(),
                       FrameType.intType()
                     })),
@@ -642,7 +624,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode CharacterMethods_compare(InternalOptions options, DexMethod method) {
+  public static CfCode CharacterMethods_compare(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     return new CfCode(
@@ -661,7 +643,7 @@
   }
 
   public static CfCode CharacterMethods_toStringCodepoint(
-      InternalOptions options, DexMethod method) {
+      DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     return new CfCode(
@@ -670,24 +652,22 @@
         1,
         ImmutableList.of(
             label0,
-            new CfNew(options.itemFactory.stringType),
+            new CfNew(factory.stringType),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfLoad(ValueType.INT, 0),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.boxedCharType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.charArrayType, options.itemFactory.intType),
-                    options.itemFactory.createString("toChars")),
+                factory.createMethod(
+                    factory.boxedCharType,
+                    factory.createProto(factory.charArrayType, factory.intType),
+                    factory.createString("toChars")),
                 false),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.charArrayType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.stringType,
+                    factory.createProto(factory.voidType, factory.charArrayType),
+                    factory.createString("<init>")),
                 false),
             new CfReturn(ValueType.OBJECT),
             label1),
@@ -696,7 +676,7 @@
   }
 
   public static CfCode CloseResourceMethod_closeResourceImpl(
-      InternalOptions options, DexMethod method) {
+      DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -726,17 +706,17 @@
         ImmutableList.of(
             label0,
             new CfLoad(ValueType.OBJECT, 1),
-            new CfInstanceOf(options.itemFactory.autoCloseableType),
+            new CfInstanceOf(factory.autoCloseableType),
             new CfIf(If.Type.EQ, ValueType.INT, label2),
             label1,
             new CfLoad(ValueType.OBJECT, 1),
-            new CfCheckCast(options.itemFactory.autoCloseableType),
+            new CfCheckCast(factory.autoCloseableType),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.autoCloseableType,
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("close")),
+                factory.createMethod(
+                    factory.autoCloseableType,
+                    factory.createProto(factory.voidType),
+                    factory.createString("close")),
                 true),
             new CfGoto(label11),
             label2,
@@ -744,45 +724,45 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.throwableType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.throwableType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfLoad(ValueType.OBJECT, 1),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.objectType,
-                    options.itemFactory.createProto(options.itemFactory.classType),
-                    options.itemFactory.createString("getClass")),
+                factory.createMethod(
+                    factory.objectType,
+                    factory.createProto(factory.classType),
+                    factory.createString("getClass")),
                 false),
-            new CfConstString(options.itemFactory.createString("close")),
+            new CfConstString(factory.createString("close")),
             new CfConstNumber(0, ValueType.INT),
-            new CfNewArray(options.itemFactory.createType("[Ljava/lang/Class;")),
+            new CfNewArray(factory.createType("[Ljava/lang/Class;")),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.classType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/lang/reflect/Method;"),
-                        options.itemFactory.stringType,
-                        options.itemFactory.createType("[Ljava/lang/Class;")),
-                    options.itemFactory.createString("getMethod")),
+                factory.createMethod(
+                    factory.classType,
+                    factory.createProto(
+                        factory.createType("Ljava/lang/reflect/Method;"),
+                        factory.stringType,
+                        factory.createType("[Ljava/lang/Class;")),
+                    factory.createString("getMethod")),
                 false),
             new CfStore(ValueType.OBJECT, 2),
             label3,
             new CfLoad(ValueType.OBJECT, 2),
             new CfLoad(ValueType.OBJECT, 1),
             new CfConstNumber(0, ValueType.INT),
-            new CfNewArray(options.itemFactory.createType("[Ljava/lang/Object;")),
+            new CfNewArray(factory.createType("[Ljava/lang/Object;")),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/reflect/Method;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.objectType,
-                        options.itemFactory.objectType,
-                        options.itemFactory.createType("[Ljava/lang/Object;")),
-                    options.itemFactory.createString("invoke")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/reflect/Method;"),
+                    factory.createProto(
+                        factory.objectType,
+                        factory.objectType,
+                        factory.createType("[Ljava/lang/Object;")),
+                    factory.createString("invoke")),
                 false),
             new CfStackInstruction(CfStackInstruction.Opcode.Pop),
             label4,
@@ -792,68 +772,64 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.throwableType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.throwableType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     }),
                 new ArrayDeque<>(
                     Arrays.asList(
                         FrameType.initializedNonNullReference(
-                            options.itemFactory.createType("Ljava/lang/Exception;"))))),
+                            factory.createType("Ljava/lang/Exception;"))))),
             new CfStore(ValueType.OBJECT, 2),
             label6,
-            new CfNew(options.itemFactory.createType("Ljava/lang/AssertionError;")),
+            new CfNew(factory.createType("Ljava/lang/AssertionError;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
-            new CfNew(options.itemFactory.stringBuilderType),
+            new CfNew(factory.stringBuilderType),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
             new CfLoad(ValueType.OBJECT, 1),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.objectType,
-                    options.itemFactory.createProto(options.itemFactory.classType),
-                    options.itemFactory.createString("getClass")),
+                factory.createMethod(
+                    factory.objectType,
+                    factory.createProto(factory.classType),
+                    factory.createString("getClass")),
                 false),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.objectType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.objectType),
+                    factory.createString("append")),
                 false),
-            new CfConstString(options.itemFactory.createString(" does not have a close() method.")),
+            new CfConstString(factory.createString(" does not have a close() method.")),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.stringType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.stringType),
+                    factory.createString("append")),
                 false),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(options.itemFactory.stringType),
-                    options.itemFactory.createString("toString")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringType),
+                    factory.createString("toString")),
                 false),
             new CfLoad(ValueType.OBJECT, 2),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/AssertionError;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType,
-                        options.itemFactory.stringType,
-                        options.itemFactory.throwableType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/AssertionError;"),
+                    factory.createProto(
+                        factory.voidType, factory.stringType, factory.throwableType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label7,
@@ -861,67 +837,62 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.throwableType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.throwableType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     }),
                 new ArrayDeque<>(
-                    Arrays.asList(
-                        FrameType.initializedNonNullReference(options.itemFactory.throwableType)))),
+                    Arrays.asList(FrameType.initializedNonNullReference(factory.throwableType)))),
             new CfStore(ValueType.OBJECT, 2),
             label8,
-            new CfNew(options.itemFactory.createType("Ljava/lang/AssertionError;")),
+            new CfNew(factory.createType("Ljava/lang/AssertionError;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
-            new CfNew(options.itemFactory.stringBuilderType),
+            new CfNew(factory.stringBuilderType),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
-            new CfConstString(options.itemFactory.createString("Fail to call close() on ")),
+            new CfConstString(factory.createString("Fail to call close() on ")),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.stringType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.stringType),
+                    factory.createString("append")),
                 false),
             new CfLoad(ValueType.OBJECT, 1),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.objectType,
-                    options.itemFactory.createProto(options.itemFactory.classType),
-                    options.itemFactory.createString("getClass")),
+                factory.createMethod(
+                    factory.objectType,
+                    factory.createProto(factory.classType),
+                    factory.createString("getClass")),
                 false),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.objectType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.objectType),
+                    factory.createString("append")),
                 false),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(options.itemFactory.stringType),
-                    options.itemFactory.createString("toString")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringType),
+                    factory.createString("toString")),
                 false),
             new CfLoad(ValueType.OBJECT, 2),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/AssertionError;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType,
-                        options.itemFactory.stringType,
-                        options.itemFactory.throwableType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/AssertionError;"),
+                    factory.createProto(
+                        factory.voidType, factory.stringType, factory.throwableType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label9,
@@ -929,23 +900,22 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.throwableType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.throwableType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     }),
                 new ArrayDeque<>(
                     Arrays.asList(
                         FrameType.initializedNonNullReference(
-                            options.itemFactory.createType(
-                                "Ljava/lang/reflect/InvocationTargetException;"))))),
+                            factory.createType("Ljava/lang/reflect/InvocationTargetException;"))))),
             new CfStore(ValueType.OBJECT, 2),
             label10,
             new CfLoad(ValueType.OBJECT, 2),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/reflect/InvocationTargetException;"),
-                    options.itemFactory.createProto(options.itemFactory.throwableType),
-                    options.itemFactory.createString("getCause")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/reflect/InvocationTargetException;"),
+                    factory.createProto(factory.throwableType),
+                    factory.createString("getCause")),
                 false),
             new CfThrow(),
             label11,
@@ -953,8 +923,8 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.throwableType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.throwableType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfGoto(label20),
             label12,
@@ -962,54 +932,53 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.throwableType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.throwableType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     }),
                 new ArrayDeque<>(
-                    Arrays.asList(
-                        FrameType.initializedNonNullReference(options.itemFactory.throwableType)))),
+                    Arrays.asList(FrameType.initializedNonNullReference(factory.throwableType)))),
             new CfStore(ValueType.OBJECT, 2),
             label13,
             new CfLoad(ValueType.OBJECT, 0),
             new CfIf(If.Type.EQ, ValueType.OBJECT, label19),
             label14,
-            new CfConstClass(options.itemFactory.throwableType),
-            new CfConstString(options.itemFactory.createString("addSuppressed")),
+            new CfConstClass(factory.throwableType),
+            new CfConstString(factory.createString("addSuppressed")),
             new CfConstNumber(1, ValueType.INT),
-            new CfNewArray(options.itemFactory.createType("[Ljava/lang/Class;")),
+            new CfNewArray(factory.createType("[Ljava/lang/Class;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfConstNumber(0, ValueType.INT),
-            new CfConstClass(options.itemFactory.throwableType),
+            new CfConstClass(factory.throwableType),
             new CfArrayStore(MemberType.OBJECT),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.classType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/lang/reflect/Method;"),
-                        options.itemFactory.stringType,
-                        options.itemFactory.createType("[Ljava/lang/Class;")),
-                    options.itemFactory.createString("getDeclaredMethod")),
+                factory.createMethod(
+                    factory.classType,
+                    factory.createProto(
+                        factory.createType("Ljava/lang/reflect/Method;"),
+                        factory.stringType,
+                        factory.createType("[Ljava/lang/Class;")),
+                    factory.createString("getDeclaredMethod")),
                 false),
             new CfStore(ValueType.OBJECT, 3),
             label15,
             new CfLoad(ValueType.OBJECT, 3),
             new CfLoad(ValueType.OBJECT, 0),
             new CfConstNumber(1, ValueType.INT),
-            new CfNewArray(options.itemFactory.createType("[Ljava/lang/Object;")),
+            new CfNewArray(factory.createType("[Ljava/lang/Object;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfConstNumber(0, ValueType.INT),
             new CfLoad(ValueType.OBJECT, 2),
             new CfArrayStore(MemberType.OBJECT),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/reflect/Method;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.objectType,
-                        options.itemFactory.objectType,
-                        options.itemFactory.createType("[Ljava/lang/Object;")),
-                    options.itemFactory.createString("invoke")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/reflect/Method;"),
+                    factory.createProto(
+                        factory.objectType,
+                        factory.objectType,
+                        factory.createType("[Ljava/lang/Object;")),
+                    factory.createString("invoke")),
                 false),
             new CfStackInstruction(CfStackInstruction.Opcode.Pop),
             label16,
@@ -1019,23 +988,23 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.throwableType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.throwableType)
+                      FrameType.initializedNonNullReference(factory.throwableType),
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.throwableType)
                     }),
                 new ArrayDeque<>(
                     Arrays.asList(
                         FrameType.initializedNonNullReference(
-                            options.itemFactory.createType("Ljava/lang/Exception;"))))),
+                            factory.createType("Ljava/lang/Exception;"))))),
             new CfStore(ValueType.OBJECT, 3),
             label18,
             new CfFrame(
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.throwableType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.throwableType)
+                      FrameType.initializedNonNullReference(factory.throwableType),
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.throwableType)
                     })),
             new CfLoad(ValueType.OBJECT, 0),
             new CfThrow(),
@@ -1044,9 +1013,9 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.throwableType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.throwableType)
+                      FrameType.initializedNonNullReference(factory.throwableType),
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.throwableType)
                     })),
             new CfLoad(ValueType.OBJECT, 2),
             new CfThrow(),
@@ -1055,8 +1024,8 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.throwableType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.throwableType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfReturnVoid(),
             label21),
@@ -1064,53 +1033,48 @@
             new CfTryCatch(
                 label2,
                 label4,
-                ImmutableList.of(
-                    options.itemFactory.createType("Ljava/lang/NoSuchMethodException;")),
+                ImmutableList.of(factory.createType("Ljava/lang/NoSuchMethodException;")),
                 ImmutableList.of(label5)),
             new CfTryCatch(
                 label2,
                 label4,
-                ImmutableList.of(options.itemFactory.createType("Ljava/lang/SecurityException;")),
+                ImmutableList.of(factory.createType("Ljava/lang/SecurityException;")),
                 ImmutableList.of(label5)),
             new CfTryCatch(
                 label2,
                 label4,
-                ImmutableList.of(
-                    options.itemFactory.createType("Ljava/lang/IllegalAccessException;")),
+                ImmutableList.of(factory.createType("Ljava/lang/IllegalAccessException;")),
+                ImmutableList.of(label7)),
+            new CfTryCatch(
+                label2,
+                label4,
+                ImmutableList.of(factory.createType("Ljava/lang/IllegalArgumentException;")),
+                ImmutableList.of(label7)),
+            new CfTryCatch(
+                label2,
+                label4,
+                ImmutableList.of(factory.createType("Ljava/lang/ExceptionInInitializerError;")),
                 ImmutableList.of(label7)),
             new CfTryCatch(
                 label2,
                 label4,
                 ImmutableList.of(
-                    options.itemFactory.createType("Ljava/lang/IllegalArgumentException;")),
-                ImmutableList.of(label7)),
-            new CfTryCatch(
-                label2,
-                label4,
-                ImmutableList.of(
-                    options.itemFactory.createType("Ljava/lang/ExceptionInInitializerError;")),
-                ImmutableList.of(label7)),
-            new CfTryCatch(
-                label2,
-                label4,
-                ImmutableList.of(
-                    options.itemFactory.createType(
-                        "Ljava/lang/reflect/InvocationTargetException;")),
+                    factory.createType("Ljava/lang/reflect/InvocationTargetException;")),
                 ImmutableList.of(label9)),
             new CfTryCatch(
                 label0,
                 label11,
-                ImmutableList.of(options.itemFactory.throwableType),
+                ImmutableList.of(factory.throwableType),
                 ImmutableList.of(label12)),
             new CfTryCatch(
                 label14,
                 label16,
-                ImmutableList.of(options.itemFactory.createType("Ljava/lang/Exception;")),
+                ImmutableList.of(factory.createType("Ljava/lang/Exception;")),
                 ImmutableList.of(label17))),
         ImmutableList.of());
   }
 
-  public static CfCode CollectionMethods_listOfArray(InternalOptions options, DexMethod method) {
+  public static CfCode CollectionMethods_listOfArray(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -1124,17 +1088,16 @@
         6,
         ImmutableList.of(
             label0,
-            new CfNew(options.itemFactory.createType("Ljava/util/ArrayList;")),
+            new CfNew(factory.createType("Ljava/util/ArrayList;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfLoad(ValueType.OBJECT, 0),
             new CfArrayLength(),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/ArrayList;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.intType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/ArrayList;"),
+                    factory.createProto(factory.voidType, factory.intType),
+                    factory.createString("<init>")),
                 false),
             new CfStore(ValueType.OBJECT, 1),
             label1,
@@ -1151,11 +1114,11 @@
                     new int[] {0, 1, 2, 3, 4},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("[Ljava/lang/Object;")),
+                          factory.createType("[Ljava/lang/Object;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/ArrayList;")),
+                          factory.createType("Ljava/util/ArrayList;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("[Ljava/lang/Object;")),
+                          factory.createType("[Ljava/lang/Object;")),
                       FrameType.intType(),
                       FrameType.intType()
                     })),
@@ -1171,19 +1134,17 @@
             new CfLoad(ValueType.OBJECT, 5),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Objects;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.objectType, options.itemFactory.objectType),
-                    options.itemFactory.createString("requireNonNull")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Objects;"),
+                    factory.createProto(factory.objectType, factory.objectType),
+                    factory.createString("requireNonNull")),
                 false),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/ArrayList;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.booleanType, options.itemFactory.objectType),
-                    options.itemFactory.createString("add")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/ArrayList;"),
+                    factory.createProto(factory.booleanType, factory.objectType),
+                    factory.createString("add")),
                 false),
             new CfStackInstruction(CfStackInstruction.Opcode.Pop),
             label4,
@@ -1195,19 +1156,19 @@
                     new int[] {0, 1},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("[Ljava/lang/Object;")),
+                          factory.createType("[Ljava/lang/Object;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/ArrayList;"))
+                          factory.createType("Ljava/util/ArrayList;"))
                     })),
             new CfLoad(ValueType.OBJECT, 1),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Collections;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/util/List;"),
-                        options.itemFactory.createType("Ljava/util/List;")),
-                    options.itemFactory.createString("unmodifiableList")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Collections;"),
+                    factory.createProto(
+                        factory.createType("Ljava/util/List;"),
+                        factory.createType("Ljava/util/List;")),
+                    factory.createString("unmodifiableList")),
                 false),
             new CfReturn(ValueType.OBJECT),
             label6),
@@ -1215,7 +1176,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode CollectionMethods_mapEntry(InternalOptions options, DexMethod method) {
+  public static CfCode CollectionMethods_mapEntry(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -1227,38 +1188,32 @@
         2,
         ImmutableList.of(
             label0,
-            new CfNew(
-                options.itemFactory.createType("Ljava/util/AbstractMap$SimpleImmutableEntry;")),
+            new CfNew(factory.createType("Ljava/util/AbstractMap$SimpleImmutableEntry;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfLoad(ValueType.OBJECT, 0),
             label1,
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Objects;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.objectType, options.itemFactory.objectType),
-                    options.itemFactory.createString("requireNonNull")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Objects;"),
+                    factory.createProto(factory.objectType, factory.objectType),
+                    factory.createString("requireNonNull")),
                 false),
             new CfLoad(ValueType.OBJECT, 1),
             label2,
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Objects;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.objectType, options.itemFactory.objectType),
-                    options.itemFactory.createString("requireNonNull")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Objects;"),
+                    factory.createProto(factory.objectType, factory.objectType),
+                    factory.createString("requireNonNull")),
                 false),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/AbstractMap$SimpleImmutableEntry;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType,
-                        options.itemFactory.objectType,
-                        options.itemFactory.objectType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/AbstractMap$SimpleImmutableEntry;"),
+                    factory.createProto(factory.voidType, factory.objectType, factory.objectType),
+                    factory.createString("<init>")),
                 false),
             label3,
             new CfReturn(ValueType.OBJECT),
@@ -1267,7 +1222,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode CollectionMethods_mapOfEntries(InternalOptions options, DexMethod method) {
+  public static CfCode CollectionMethods_mapOfEntries(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -1284,17 +1239,16 @@
         8,
         ImmutableList.of(
             label0,
-            new CfNew(options.itemFactory.createType("Ljava/util/HashMap;")),
+            new CfNew(factory.createType("Ljava/util/HashMap;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfLoad(ValueType.OBJECT, 0),
             new CfArrayLength(),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/HashMap;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.intType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/HashMap;"),
+                    factory.createProto(factory.voidType, factory.intType),
+                    factory.createString("<init>")),
                 false),
             new CfStore(ValueType.OBJECT, 1),
             label1,
@@ -1311,11 +1265,11 @@
                     new int[] {0, 1, 2, 3, 4},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("[Ljava/util/Map$Entry;")),
+                          factory.createType("[Ljava/util/Map$Entry;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/HashMap;")),
+                          factory.createType("Ljava/util/HashMap;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("[Ljava/util/Map$Entry;")),
+                          factory.createType("[Ljava/util/Map$Entry;")),
                       FrameType.intType(),
                       FrameType.intType()
                     })),
@@ -1330,36 +1284,34 @@
             new CfLoad(ValueType.OBJECT, 5),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Map$Entry;"),
-                    options.itemFactory.createProto(options.itemFactory.objectType),
-                    options.itemFactory.createString("getKey")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Map$Entry;"),
+                    factory.createProto(factory.objectType),
+                    factory.createString("getKey")),
                 true),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Objects;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.objectType, options.itemFactory.objectType),
-                    options.itemFactory.createString("requireNonNull")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Objects;"),
+                    factory.createProto(factory.objectType, factory.objectType),
+                    factory.createString("requireNonNull")),
                 false),
             new CfStore(ValueType.OBJECT, 6),
             label4,
             new CfLoad(ValueType.OBJECT, 5),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Map$Entry;"),
-                    options.itemFactory.createProto(options.itemFactory.objectType),
-                    options.itemFactory.createString("getValue")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Map$Entry;"),
+                    factory.createProto(factory.objectType),
+                    factory.createString("getValue")),
                 true),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Objects;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.objectType, options.itemFactory.objectType),
-                    options.itemFactory.createString("requireNonNull")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Objects;"),
+                    factory.createProto(factory.objectType, factory.objectType),
+                    factory.createString("requireNonNull")),
                 false),
             new CfStore(ValueType.OBJECT, 7),
             label5,
@@ -1368,59 +1320,53 @@
             new CfLoad(ValueType.OBJECT, 7),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/HashMap;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.objectType,
-                        options.itemFactory.objectType,
-                        options.itemFactory.objectType),
-                    options.itemFactory.createString("put")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/HashMap;"),
+                    factory.createProto(factory.objectType, factory.objectType, factory.objectType),
+                    factory.createString("put")),
                 false),
             new CfIf(If.Type.EQ, ValueType.OBJECT, label7),
             label6,
-            new CfNew(options.itemFactory.createType("Ljava/lang/IllegalArgumentException;")),
+            new CfNew(factory.createType("Ljava/lang/IllegalArgumentException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
-            new CfNew(options.itemFactory.stringBuilderType),
+            new CfNew(factory.stringBuilderType),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
-            new CfConstString(options.itemFactory.createString("duplicate key: ")),
+            new CfConstString(factory.createString("duplicate key: ")),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.stringType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.stringType),
+                    factory.createString("append")),
                 false),
             new CfLoad(ValueType.OBJECT, 6),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.objectType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.objectType),
+                    factory.createString("append")),
                 false),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(options.itemFactory.stringType),
-                    options.itemFactory.createString("toString")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringType),
+                    factory.createString("toString")),
                 false),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/IllegalArgumentException;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.stringType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/IllegalArgumentException;"),
+                    factory.createProto(factory.voidType, factory.stringType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label7,
@@ -1429,11 +1375,11 @@
                     new int[] {0, 1, 2, 3, 4},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("[Ljava/util/Map$Entry;")),
+                          factory.createType("[Ljava/util/Map$Entry;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/HashMap;")),
+                          factory.createType("Ljava/util/HashMap;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("[Ljava/util/Map$Entry;")),
+                          factory.createType("[Ljava/util/Map$Entry;")),
                       FrameType.intType(),
                       FrameType.intType()
                     })),
@@ -1445,19 +1391,19 @@
                     new int[] {0, 1},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("[Ljava/util/Map$Entry;")),
+                          factory.createType("[Ljava/util/Map$Entry;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/HashMap;"))
+                          factory.createType("Ljava/util/HashMap;"))
                     })),
             new CfLoad(ValueType.OBJECT, 1),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Collections;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/util/Map;"),
-                        options.itemFactory.createType("Ljava/util/Map;")),
-                    options.itemFactory.createString("unmodifiableMap")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Collections;"),
+                    factory.createProto(
+                        factory.createType("Ljava/util/Map;"),
+                        factory.createType("Ljava/util/Map;")),
+                    factory.createString("unmodifiableMap")),
                 false),
             new CfReturn(ValueType.OBJECT),
             label9),
@@ -1465,7 +1411,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode CollectionMethods_setOfArray(InternalOptions options, DexMethod method) {
+  public static CfCode CollectionMethods_setOfArray(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -1480,17 +1426,16 @@
         6,
         ImmutableList.of(
             label0,
-            new CfNew(options.itemFactory.createType("Ljava/util/HashSet;")),
+            new CfNew(factory.createType("Ljava/util/HashSet;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfLoad(ValueType.OBJECT, 0),
             new CfArrayLength(),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/HashSet;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.intType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/HashSet;"),
+                    factory.createProto(factory.voidType, factory.intType),
+                    factory.createString("<init>")),
                 false),
             new CfStore(ValueType.OBJECT, 1),
             label1,
@@ -1507,11 +1452,11 @@
                     new int[] {0, 1, 2, 3, 4},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("[Ljava/lang/Object;")),
+                          factory.createType("[Ljava/lang/Object;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/HashSet;")),
+                          factory.createType("Ljava/util/HashSet;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("[Ljava/lang/Object;")),
+                          factory.createType("[Ljava/lang/Object;")),
                       FrameType.intType(),
                       FrameType.intType()
                     })),
@@ -1527,65 +1472,60 @@
             new CfLoad(ValueType.OBJECT, 5),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Objects;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.objectType, options.itemFactory.objectType),
-                    options.itemFactory.createString("requireNonNull")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Objects;"),
+                    factory.createProto(factory.objectType, factory.objectType),
+                    factory.createString("requireNonNull")),
                 false),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/HashSet;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.booleanType, options.itemFactory.objectType),
-                    options.itemFactory.createString("add")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/HashSet;"),
+                    factory.createProto(factory.booleanType, factory.objectType),
+                    factory.createString("add")),
                 false),
             new CfIf(If.Type.NE, ValueType.INT, label5),
             label4,
-            new CfNew(options.itemFactory.createType("Ljava/lang/IllegalArgumentException;")),
+            new CfNew(factory.createType("Ljava/lang/IllegalArgumentException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
-            new CfNew(options.itemFactory.stringBuilderType),
+            new CfNew(factory.stringBuilderType),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
-            new CfConstString(options.itemFactory.createString("duplicate element: ")),
+            new CfConstString(factory.createString("duplicate element: ")),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.stringType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.stringType),
+                    factory.createString("append")),
                 false),
             new CfLoad(ValueType.OBJECT, 5),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.objectType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.objectType),
+                    factory.createString("append")),
                 false),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(options.itemFactory.stringType),
-                    options.itemFactory.createString("toString")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringType),
+                    factory.createString("toString")),
                 false),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/IllegalArgumentException;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.stringType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/IllegalArgumentException;"),
+                    factory.createProto(factory.voidType, factory.stringType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label5,
@@ -1594,11 +1534,11 @@
                     new int[] {0, 1, 2, 3, 4},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("[Ljava/lang/Object;")),
+                          factory.createType("[Ljava/lang/Object;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/HashSet;")),
+                          factory.createType("Ljava/util/HashSet;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("[Ljava/lang/Object;")),
+                          factory.createType("[Ljava/lang/Object;")),
                       FrameType.intType(),
                       FrameType.intType()
                     })),
@@ -1610,19 +1550,19 @@
                     new int[] {0, 1},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("[Ljava/lang/Object;")),
+                          factory.createType("[Ljava/lang/Object;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/HashSet;"))
+                          factory.createType("Ljava/util/HashSet;"))
                     })),
             new CfLoad(ValueType.OBJECT, 1),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Collections;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/util/Set;"),
-                        options.itemFactory.createType("Ljava/util/Set;")),
-                    options.itemFactory.createString("unmodifiableSet")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Collections;"),
+                    factory.createProto(
+                        factory.createType("Ljava/util/Set;"),
+                        factory.createType("Ljava/util/Set;")),
+                    factory.createString("unmodifiableSet")),
                 false),
             new CfReturn(ValueType.OBJECT),
             label7),
@@ -1630,7 +1570,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode CollectionsMethods_copyOfList(InternalOptions options, DexMethod method) {
+  public static CfCode CollectionsMethods_copyOfList(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -1644,34 +1584,32 @@
         4,
         ImmutableList.of(
             label0,
-            new CfNew(options.itemFactory.createType("Ljava/util/ArrayList;")),
+            new CfNew(factory.createType("Ljava/util/ArrayList;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Collection;"),
-                    options.itemFactory.createProto(options.itemFactory.intType),
-                    options.itemFactory.createString("size")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Collection;"),
+                    factory.createProto(factory.intType),
+                    factory.createString("size")),
                 true),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/ArrayList;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.intType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/ArrayList;"),
+                    factory.createProto(factory.voidType, factory.intType),
+                    factory.createString("<init>")),
                 false),
             new CfStore(ValueType.OBJECT, 1),
             label1,
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Collection;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/util/Iterator;")),
-                    options.itemFactory.createString("iterator")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Collection;"),
+                    factory.createProto(factory.createType("Ljava/util/Iterator;")),
+                    factory.createString("iterator")),
                 true),
             new CfStore(ValueType.OBJECT, 2),
             label2,
@@ -1680,28 +1618,28 @@
                     new int[] {0, 1, 2},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/Collection;")),
+                          factory.createType("Ljava/util/Collection;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/ArrayList;")),
+                          factory.createType("Ljava/util/ArrayList;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/Iterator;"))
+                          factory.createType("Ljava/util/Iterator;"))
                     })),
             new CfLoad(ValueType.OBJECT, 2),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Iterator;"),
-                    options.itemFactory.createProto(options.itemFactory.booleanType),
-                    options.itemFactory.createString("hasNext")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Iterator;"),
+                    factory.createProto(factory.booleanType),
+                    factory.createString("hasNext")),
                 true),
             new CfIf(If.Type.EQ, ValueType.INT, label5),
             new CfLoad(ValueType.OBJECT, 2),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Iterator;"),
-                    options.itemFactory.createProto(options.itemFactory.objectType),
-                    options.itemFactory.createString("next")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Iterator;"),
+                    factory.createProto(factory.objectType),
+                    factory.createString("next")),
                 true),
             new CfStore(ValueType.OBJECT, 3),
             label3,
@@ -1709,19 +1647,17 @@
             new CfLoad(ValueType.OBJECT, 3),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Objects;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.objectType, options.itemFactory.objectType),
-                    options.itemFactory.createString("requireNonNull")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Objects;"),
+                    factory.createProto(factory.objectType, factory.objectType),
+                    factory.createString("requireNonNull")),
                 false),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/ArrayList;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.booleanType, options.itemFactory.objectType),
-                    options.itemFactory.createString("add")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/ArrayList;"),
+                    factory.createProto(factory.booleanType, factory.objectType),
+                    factory.createString("add")),
                 false),
             new CfStackInstruction(CfStackInstruction.Opcode.Pop),
             label4,
@@ -1732,19 +1668,19 @@
                     new int[] {0, 1},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/Collection;")),
+                          factory.createType("Ljava/util/Collection;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/ArrayList;"))
+                          factory.createType("Ljava/util/ArrayList;"))
                     })),
             new CfLoad(ValueType.OBJECT, 1),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Collections;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/util/List;"),
-                        options.itemFactory.createType("Ljava/util/List;")),
-                    options.itemFactory.createString("unmodifiableList")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Collections;"),
+                    factory.createProto(
+                        factory.createType("Ljava/util/List;"),
+                        factory.createType("Ljava/util/List;")),
+                    factory.createString("unmodifiableList")),
                 false),
             new CfReturn(ValueType.OBJECT),
             label6),
@@ -1752,7 +1688,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode CollectionsMethods_copyOfMap(InternalOptions options, DexMethod method) {
+  public static CfCode CollectionsMethods_copyOfMap(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -1769,42 +1705,39 @@
         4,
         ImmutableList.of(
             label0,
-            new CfNew(options.itemFactory.createType("Ljava/util/HashMap;")),
+            new CfNew(factory.createType("Ljava/util/HashMap;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Map;"),
-                    options.itemFactory.createProto(options.itemFactory.intType),
-                    options.itemFactory.createString("size")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Map;"),
+                    factory.createProto(factory.intType),
+                    factory.createString("size")),
                 true),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/HashMap;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.intType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/HashMap;"),
+                    factory.createProto(factory.voidType, factory.intType),
+                    factory.createString("<init>")),
                 false),
             new CfStore(ValueType.OBJECT, 1),
             label1,
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Map;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/util/Set;")),
-                    options.itemFactory.createString("entrySet")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Map;"),
+                    factory.createProto(factory.createType("Ljava/util/Set;")),
+                    factory.createString("entrySet")),
                 true),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Set;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/util/Iterator;")),
-                    options.itemFactory.createString("iterator")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Set;"),
+                    factory.createProto(factory.createType("Ljava/util/Iterator;")),
+                    factory.createString("iterator")),
                 true),
             new CfStore(ValueType.OBJECT, 2),
             label2,
@@ -1812,31 +1745,30 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2},
                     new FrameType[] {
+                      FrameType.initializedNonNullReference(factory.createType("Ljava/util/Map;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/Map;")),
+                          factory.createType("Ljava/util/HashMap;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/HashMap;")),
-                      FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/Iterator;"))
+                          factory.createType("Ljava/util/Iterator;"))
                     })),
             new CfLoad(ValueType.OBJECT, 2),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Iterator;"),
-                    options.itemFactory.createProto(options.itemFactory.booleanType),
-                    options.itemFactory.createString("hasNext")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Iterator;"),
+                    factory.createProto(factory.booleanType),
+                    factory.createString("hasNext")),
                 true),
             new CfIf(If.Type.EQ, ValueType.INT, label8),
             new CfLoad(ValueType.OBJECT, 2),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Iterator;"),
-                    options.itemFactory.createProto(options.itemFactory.objectType),
-                    options.itemFactory.createString("next")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Iterator;"),
+                    factory.createProto(factory.objectType),
+                    factory.createString("next")),
                 true),
-            new CfCheckCast(options.itemFactory.createType("Ljava/util/Map$Entry;")),
+            new CfCheckCast(factory.createType("Ljava/util/Map$Entry;")),
             new CfStore(ValueType.OBJECT, 3),
             label3,
             new CfLoad(ValueType.OBJECT, 1),
@@ -1844,46 +1776,41 @@
             label4,
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Map$Entry;"),
-                    options.itemFactory.createProto(options.itemFactory.objectType),
-                    options.itemFactory.createString("getKey")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Map$Entry;"),
+                    factory.createProto(factory.objectType),
+                    factory.createString("getKey")),
                 true),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Objects;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.objectType, options.itemFactory.objectType),
-                    options.itemFactory.createString("requireNonNull")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Objects;"),
+                    factory.createProto(factory.objectType, factory.objectType),
+                    factory.createString("requireNonNull")),
                 false),
             new CfLoad(ValueType.OBJECT, 3),
             label5,
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Map$Entry;"),
-                    options.itemFactory.createProto(options.itemFactory.objectType),
-                    options.itemFactory.createString("getValue")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Map$Entry;"),
+                    factory.createProto(factory.objectType),
+                    factory.createString("getValue")),
                 true),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Objects;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.objectType, options.itemFactory.objectType),
-                    options.itemFactory.createString("requireNonNull")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Objects;"),
+                    factory.createProto(factory.objectType, factory.objectType),
+                    factory.createString("requireNonNull")),
                 false),
             label6,
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/HashMap;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.objectType,
-                        options.itemFactory.objectType,
-                        options.itemFactory.objectType),
-                    options.itemFactory.createString("put")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/HashMap;"),
+                    factory.createProto(factory.objectType, factory.objectType, factory.objectType),
+                    factory.createString("put")),
                 false),
             new CfStackInstruction(CfStackInstruction.Opcode.Pop),
             label7,
@@ -1893,20 +1820,19 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
+                      FrameType.initializedNonNullReference(factory.createType("Ljava/util/Map;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/Map;")),
-                      FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/HashMap;"))
+                          factory.createType("Ljava/util/HashMap;"))
                     })),
             new CfLoad(ValueType.OBJECT, 1),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Collections;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/util/Map;"),
-                        options.itemFactory.createType("Ljava/util/Map;")),
-                    options.itemFactory.createString("unmodifiableMap")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Collections;"),
+                    factory.createProto(
+                        factory.createType("Ljava/util/Map;"),
+                        factory.createType("Ljava/util/Map;")),
+                    factory.createString("unmodifiableMap")),
                 false),
             new CfReturn(ValueType.OBJECT),
             label9),
@@ -1914,7 +1840,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode CollectionsMethods_copyOfSet(InternalOptions options, DexMethod method) {
+  public static CfCode CollectionsMethods_copyOfSet(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -1928,34 +1854,32 @@
         4,
         ImmutableList.of(
             label0,
-            new CfNew(options.itemFactory.createType("Ljava/util/HashSet;")),
+            new CfNew(factory.createType("Ljava/util/HashSet;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Collection;"),
-                    options.itemFactory.createProto(options.itemFactory.intType),
-                    options.itemFactory.createString("size")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Collection;"),
+                    factory.createProto(factory.intType),
+                    factory.createString("size")),
                 true),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/HashSet;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.intType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/HashSet;"),
+                    factory.createProto(factory.voidType, factory.intType),
+                    factory.createString("<init>")),
                 false),
             new CfStore(ValueType.OBJECT, 1),
             label1,
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Collection;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/util/Iterator;")),
-                    options.itemFactory.createString("iterator")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Collection;"),
+                    factory.createProto(factory.createType("Ljava/util/Iterator;")),
+                    factory.createString("iterator")),
                 true),
             new CfStore(ValueType.OBJECT, 2),
             label2,
@@ -1964,28 +1888,28 @@
                     new int[] {0, 1, 2},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/Collection;")),
+                          factory.createType("Ljava/util/Collection;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/HashSet;")),
+                          factory.createType("Ljava/util/HashSet;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/Iterator;"))
+                          factory.createType("Ljava/util/Iterator;"))
                     })),
             new CfLoad(ValueType.OBJECT, 2),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Iterator;"),
-                    options.itemFactory.createProto(options.itemFactory.booleanType),
-                    options.itemFactory.createString("hasNext")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Iterator;"),
+                    factory.createProto(factory.booleanType),
+                    factory.createString("hasNext")),
                 true),
             new CfIf(If.Type.EQ, ValueType.INT, label5),
             new CfLoad(ValueType.OBJECT, 2),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Iterator;"),
-                    options.itemFactory.createProto(options.itemFactory.objectType),
-                    options.itemFactory.createString("next")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Iterator;"),
+                    factory.createProto(factory.objectType),
+                    factory.createString("next")),
                 true),
             new CfStore(ValueType.OBJECT, 3),
             label3,
@@ -1993,19 +1917,17 @@
             new CfLoad(ValueType.OBJECT, 3),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Objects;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.objectType, options.itemFactory.objectType),
-                    options.itemFactory.createString("requireNonNull")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Objects;"),
+                    factory.createProto(factory.objectType, factory.objectType),
+                    factory.createString("requireNonNull")),
                 false),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/HashSet;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.booleanType, options.itemFactory.objectType),
-                    options.itemFactory.createString("add")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/HashSet;"),
+                    factory.createProto(factory.booleanType, factory.objectType),
+                    factory.createString("add")),
                 false),
             new CfStackInstruction(CfStackInstruction.Opcode.Pop),
             label4,
@@ -2016,19 +1938,19 @@
                     new int[] {0, 1},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/Collection;")),
+                          factory.createType("Ljava/util/Collection;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/HashSet;"))
+                          factory.createType("Ljava/util/HashSet;"))
                     })),
             new CfLoad(ValueType.OBJECT, 1),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Collections;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/util/Set;"),
-                        options.itemFactory.createType("Ljava/util/Set;")),
-                    options.itemFactory.createString("unmodifiableSet")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Collections;"),
+                    factory.createProto(
+                        factory.createType("Ljava/util/Set;"),
+                        factory.createType("Ljava/util/Set;")),
+                    factory.createString("unmodifiableSet")),
                 false),
             new CfReturn(ValueType.OBJECT),
             label6),
@@ -2037,7 +1959,7 @@
   }
 
   public static CfCode CollectionsMethods_emptyEnumeration(
-      InternalOptions options, DexMethod method) {
+      DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     return new CfCode(
         method.holder,
@@ -2047,27 +1969,26 @@
             label0,
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Collections;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/util/List;")),
-                    options.itemFactory.createString("emptyList")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Collections;"),
+                    factory.createProto(factory.createType("Ljava/util/List;")),
+                    factory.createString("emptyList")),
                 false),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Collections;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/util/Enumeration;"),
-                        options.itemFactory.createType("Ljava/util/Collection;")),
-                    options.itemFactory.createString("enumeration")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Collections;"),
+                    factory.createProto(
+                        factory.createType("Ljava/util/Enumeration;"),
+                        factory.createType("Ljava/util/Collection;")),
+                    factory.createString("enumeration")),
                 false),
             new CfReturn(ValueType.OBJECT)),
         ImmutableList.of(),
         ImmutableList.of());
   }
 
-  public static CfCode CollectionsMethods_emptyIterator(InternalOptions options, DexMethod method) {
+  public static CfCode CollectionsMethods_emptyIterator(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     return new CfCode(
         method.holder,
@@ -2077,19 +1998,17 @@
             label0,
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Collections;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/util/List;")),
-                    options.itemFactory.createString("emptyList")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Collections;"),
+                    factory.createProto(factory.createType("Ljava/util/List;")),
+                    factory.createString("emptyList")),
                 false),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/List;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/util/Iterator;")),
-                    options.itemFactory.createString("iterator")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/List;"),
+                    factory.createProto(factory.createType("Ljava/util/Iterator;")),
+                    factory.createString("iterator")),
                 true),
             new CfReturn(ValueType.OBJECT)),
         ImmutableList.of(),
@@ -2097,7 +2016,7 @@
   }
 
   public static CfCode CollectionsMethods_emptyListIterator(
-      InternalOptions options, DexMethod method) {
+      DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     return new CfCode(
         method.holder,
@@ -2107,26 +2026,24 @@
             label0,
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Collections;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/util/List;")),
-                    options.itemFactory.createString("emptyList")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Collections;"),
+                    factory.createProto(factory.createType("Ljava/util/List;")),
+                    factory.createString("emptyList")),
                 false),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/List;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/util/ListIterator;")),
-                    options.itemFactory.createString("listIterator")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/List;"),
+                    factory.createProto(factory.createType("Ljava/util/ListIterator;")),
+                    factory.createString("listIterator")),
                 true),
             new CfReturn(ValueType.OBJECT)),
         ImmutableList.of(),
         ImmutableList.of());
   }
 
-  public static CfCode DoubleMethods_hashCode(InternalOptions options, DexMethod method) {
+  public static CfCode DoubleMethods_hashCode(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -2139,11 +2056,10 @@
             new CfLoad(ValueType.DOUBLE, 0),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Double;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.longType, options.itemFactory.doubleType),
-                    options.itemFactory.createString("doubleToLongBits")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Double;"),
+                    factory.createProto(factory.longType, factory.doubleType),
+                    factory.createString("doubleToLongBits")),
                 false),
             new CfStore(ValueType.LONG, 2),
             label1,
@@ -2159,7 +2075,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode DoubleMethods_isFinite(InternalOptions options, DexMethod method) {
+  public static CfCode DoubleMethods_isFinite(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -2173,21 +2089,19 @@
             new CfLoad(ValueType.DOUBLE, 0),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Double;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.booleanType, options.itemFactory.doubleType),
-                    options.itemFactory.createString("isInfinite")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Double;"),
+                    factory.createProto(factory.booleanType, factory.doubleType),
+                    factory.createString("isInfinite")),
                 false),
             new CfIf(If.Type.NE, ValueType.INT, label1),
             new CfLoad(ValueType.DOUBLE, 0),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Double;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.booleanType, options.itemFactory.doubleType),
-                    options.itemFactory.createString("isNaN")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Double;"),
+                    factory.createProto(factory.booleanType, factory.doubleType),
+                    factory.createString("isNaN")),
                 false),
             new CfIf(If.Type.NE, ValueType.INT, label1),
             new CfConstNumber(1, ValueType.INT),
@@ -2210,7 +2124,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode FloatMethods_isFinite(InternalOptions options, DexMethod method) {
+  public static CfCode FloatMethods_isFinite(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -2224,21 +2138,19 @@
             new CfLoad(ValueType.FLOAT, 0),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Float;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.booleanType, options.itemFactory.floatType),
-                    options.itemFactory.createString("isInfinite")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Float;"),
+                    factory.createProto(factory.booleanType, factory.floatType),
+                    factory.createString("isInfinite")),
                 false),
             new CfIf(If.Type.NE, ValueType.INT, label1),
             new CfLoad(ValueType.FLOAT, 0),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Float;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.booleanType, options.itemFactory.floatType),
-                    options.itemFactory.createString("isNaN")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Float;"),
+                    factory.createProto(factory.booleanType, factory.floatType),
+                    factory.createString("isNaN")),
                 false),
             new CfIf(If.Type.NE, ValueType.INT, label1),
             new CfConstNumber(1, ValueType.INT),
@@ -2257,7 +2169,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode IntegerMethods_compare(InternalOptions options, DexMethod method) {
+  public static CfCode IntegerMethods_compare(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -2299,7 +2211,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode IntegerMethods_compareUnsigned(InternalOptions options, DexMethod method) {
+  public static CfCode IntegerMethods_compareUnsigned(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -2324,13 +2236,10 @@
             new CfLoad(ValueType.INT, 3),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Integer;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.intType,
-                        options.itemFactory.intType,
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("compare")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Integer;"),
+                    factory.createProto(factory.intType, factory.intType, factory.intType),
+                    factory.createString("compare")),
                 false),
             new CfReturn(ValueType.INT),
             label3),
@@ -2338,7 +2247,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode IntegerMethods_divideUnsigned(InternalOptions options, DexMethod method) {
+  public static CfCode IntegerMethods_divideUnsigned(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -2372,7 +2281,7 @@
   }
 
   public static CfCode IntegerMethods_parseIntSubsequenceWithRadix(
-      InternalOptions options, DexMethod method) {
+      DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     return new CfCode(
@@ -2386,31 +2295,25 @@
             new CfLoad(ValueType.INT, 2),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.charSequenceType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.charSequenceType,
-                        options.itemFactory.intType,
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("subSequence")),
+                factory.createMethod(
+                    factory.charSequenceType,
+                    factory.createProto(factory.charSequenceType, factory.intType, factory.intType),
+                    factory.createString("subSequence")),
                 true),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.charSequenceType,
-                    options.itemFactory.createProto(options.itemFactory.stringType),
-                    options.itemFactory.createString("toString")),
+                factory.createMethod(
+                    factory.charSequenceType,
+                    factory.createProto(factory.stringType),
+                    factory.createString("toString")),
                 true),
             new CfLoad(ValueType.INT, 3),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Integer;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.intType,
-                        options.itemFactory.stringType,
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("parseInt")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Integer;"),
+                    factory.createProto(factory.intType, factory.stringType, factory.intType),
+                    factory.createString("parseInt")),
                 false),
             new CfReturn(ValueType.INT),
             label1),
@@ -2419,7 +2322,7 @@
   }
 
   public static CfCode IntegerMethods_parseIntSubsequenceWithRadixDalvik(
-      InternalOptions options, DexMethod method) {
+      DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -2442,11 +2345,10 @@
             label1,
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.charSequenceType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.charType, options.itemFactory.intType),
-                    options.itemFactory.createString("charAt")),
+                factory.createMethod(
+                    factory.charSequenceType,
+                    factory.createProto(factory.charType, factory.intType),
+                    factory.createString("charAt")),
                 true),
             new CfConstNumber(43, ValueType.INT),
             new CfIfCmp(If.Type.NE, ValueType.INT, label4),
@@ -2457,22 +2359,18 @@
             label2,
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.charSequenceType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.charType, options.itemFactory.intType),
-                    options.itemFactory.createString("charAt")),
+                factory.createMethod(
+                    factory.charSequenceType,
+                    factory.createProto(factory.charType, factory.intType),
+                    factory.createString("charAt")),
                 true),
             new CfLoad(ValueType.INT, 3),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.boxedCharType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.intType,
-                        options.itemFactory.charType,
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("digit")),
+                factory.createMethod(
+                    factory.boxedCharType,
+                    factory.createProto(factory.intType, factory.charType, factory.intType),
+                    factory.createString("digit")),
                 false),
             new CfIf(If.Type.LT, ValueType.INT, label4),
             label3,
@@ -2482,7 +2380,7 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2, 3},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.charSequenceType),
+                      FrameType.initializedNonNullReference(factory.charSequenceType),
                       FrameType.intType(),
                       FrameType.intType(),
                       FrameType.intType()
@@ -2492,31 +2390,25 @@
             new CfLoad(ValueType.INT, 2),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.charSequenceType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.charSequenceType,
-                        options.itemFactory.intType,
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("subSequence")),
+                factory.createMethod(
+                    factory.charSequenceType,
+                    factory.createProto(factory.charSequenceType, factory.intType, factory.intType),
+                    factory.createString("subSequence")),
                 true),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.charSequenceType,
-                    options.itemFactory.createProto(options.itemFactory.stringType),
-                    options.itemFactory.createString("toString")),
+                factory.createMethod(
+                    factory.charSequenceType,
+                    factory.createProto(factory.stringType),
+                    factory.createString("toString")),
                 true),
             new CfLoad(ValueType.INT, 3),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Integer;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.intType,
-                        options.itemFactory.stringType,
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("parseInt")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Integer;"),
+                    factory.createProto(factory.intType, factory.stringType, factory.intType),
+                    factory.createString("parseInt")),
                 false),
             new CfReturn(ValueType.INT),
             label5),
@@ -2524,7 +2416,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode IntegerMethods_parseUnsignedInt(InternalOptions options, DexMethod method) {
+  public static CfCode IntegerMethods_parseUnsignedInt(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     return new CfCode(
@@ -2537,13 +2429,10 @@
             new CfConstNumber(10, ValueType.INT),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Integer;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.intType,
-                        options.itemFactory.stringType,
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("parseUnsignedInt")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Integer;"),
+                    factory.createProto(factory.intType, factory.stringType, factory.intType),
+                    factory.createString("parseUnsignedInt")),
                 false),
             new CfReturn(ValueType.INT),
             label1),
@@ -2552,7 +2441,7 @@
   }
 
   public static CfCode IntegerMethods_parseUnsignedIntSubsequenceWithRadix(
-      InternalOptions options, DexMethod method) {
+      DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     return new CfCode(
@@ -2566,31 +2455,25 @@
             new CfLoad(ValueType.INT, 2),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.charSequenceType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.charSequenceType,
-                        options.itemFactory.intType,
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("subSequence")),
+                factory.createMethod(
+                    factory.charSequenceType,
+                    factory.createProto(factory.charSequenceType, factory.intType, factory.intType),
+                    factory.createString("subSequence")),
                 true),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.charSequenceType,
-                    options.itemFactory.createProto(options.itemFactory.stringType),
-                    options.itemFactory.createString("toString")),
+                factory.createMethod(
+                    factory.charSequenceType,
+                    factory.createProto(factory.stringType),
+                    factory.createString("toString")),
                 true),
             new CfLoad(ValueType.INT, 3),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Integer;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.intType,
-                        options.itemFactory.stringType,
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("parseUnsignedInt")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Integer;"),
+                    factory.createProto(factory.intType, factory.stringType, factory.intType),
+                    factory.createString("parseUnsignedInt")),
                 false),
             new CfReturn(ValueType.INT),
             label1),
@@ -2599,7 +2482,7 @@
   }
 
   public static CfCode IntegerMethods_parseUnsignedIntWithRadix(
-      InternalOptions options, DexMethod method) {
+      DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -2616,10 +2499,10 @@
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringType,
-                    options.itemFactory.createProto(options.itemFactory.intType),
-                    options.itemFactory.createString("length")),
+                factory.createMethod(
+                    factory.stringType,
+                    factory.createProto(factory.intType),
+                    factory.createString("length")),
                 false),
             new CfConstNumber(1, ValueType.INT),
             new CfIfCmp(If.Type.LE, ValueType.INT, label2),
@@ -2627,11 +2510,10 @@
             new CfConstNumber(0, ValueType.INT),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.charType, options.itemFactory.intType),
-                    options.itemFactory.createString("charAt")),
+                factory.createMethod(
+                    factory.stringType,
+                    factory.createProto(factory.charType, factory.intType),
+                    factory.createString("charAt")),
                 false),
             new CfConstNumber(43, ValueType.INT),
             new CfIfCmp(If.Type.NE, ValueType.INT, label2),
@@ -2640,11 +2522,10 @@
             new CfConstNumber(1, ValueType.INT),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringType, options.itemFactory.intType),
-                    options.itemFactory.createString("substring")),
+                factory.createMethod(
+                    factory.stringType,
+                    factory.createProto(factory.stringType, factory.intType),
+                    factory.createString("substring")),
                 false),
             new CfStore(ValueType.OBJECT, 0),
             label2,
@@ -2652,20 +2533,16 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.stringType),
-                      FrameType.intType()
+                      FrameType.initializedNonNullReference(factory.stringType), FrameType.intType()
                     })),
             new CfLoad(ValueType.OBJECT, 0),
             new CfLoad(ValueType.INT, 1),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Long;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.longType,
-                        options.itemFactory.stringType,
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("parseLong")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Long;"),
+                    factory.createProto(factory.longType, factory.stringType, factory.intType),
+                    factory.createString("parseLong")),
                 false),
             new CfStore(ValueType.LONG, 2),
             label3,
@@ -2676,77 +2553,70 @@
             new CfCmp(Cmp.Bias.NONE, NumericType.LONG),
             new CfIf(If.Type.EQ, ValueType.INT, label5),
             label4,
-            new CfNew(options.itemFactory.createType("Ljava/lang/NumberFormatException;")),
+            new CfNew(factory.createType("Ljava/lang/NumberFormatException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
-            new CfNew(options.itemFactory.stringBuilderType),
+            new CfNew(factory.stringBuilderType),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
-            new CfConstString(options.itemFactory.createString("Input ")),
+            new CfConstString(factory.createString("Input ")),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.stringType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.stringType),
+                    factory.createString("append")),
                 false),
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.stringType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.stringType),
+                    factory.createString("append")),
                 false),
-            new CfConstString(options.itemFactory.createString(" in base ")),
+            new CfConstString(factory.createString(" in base ")),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.stringType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.stringType),
+                    factory.createString("append")),
                 false),
             new CfLoad(ValueType.INT, 1),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.intType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.intType),
+                    factory.createString("append")),
                 false),
-            new CfConstString(
-                options.itemFactory.createString(" is not in the range of an unsigned integer")),
+            new CfConstString(factory.createString(" is not in the range of an unsigned integer")),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.stringType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.stringType),
+                    factory.createString("append")),
                 false),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(options.itemFactory.stringType),
-                    options.itemFactory.createString("toString")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringType),
+                    factory.createString("toString")),
                 false),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/NumberFormatException;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.stringType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/NumberFormatException;"),
+                    factory.createProto(factory.voidType, factory.stringType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label5,
@@ -2754,7 +2624,7 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2, 3},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.stringType),
+                      FrameType.initializedNonNullReference(factory.stringType),
                       FrameType.intType(),
                       FrameType.longType(),
                       FrameType.longHighType()
@@ -2767,7 +2637,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode IntegerMethods_remainderUnsigned(InternalOptions options, DexMethod method) {
+  public static CfCode IntegerMethods_remainderUnsigned(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -2800,7 +2670,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode IntegerMethods_toUnsignedLong(InternalOptions options, DexMethod method) {
+  public static CfCode IntegerMethods_toUnsignedLong(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     return new CfCode(
@@ -2819,7 +2689,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode IntegerMethods_toUnsignedString(InternalOptions options, DexMethod method) {
+  public static CfCode IntegerMethods_toUnsignedString(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     return new CfCode(
@@ -2832,13 +2702,10 @@
             new CfConstNumber(10, ValueType.INT),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Integer;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringType,
-                        options.itemFactory.intType,
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("toUnsignedString")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Integer;"),
+                    factory.createProto(factory.stringType, factory.intType, factory.intType),
+                    factory.createString("toUnsignedString")),
                 false),
             new CfReturn(ValueType.OBJECT),
             label1),
@@ -2847,7 +2714,7 @@
   }
 
   public static CfCode IntegerMethods_toUnsignedStringWithRadix(
-      InternalOptions options, DexMethod method) {
+      DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -2867,13 +2734,10 @@
             new CfLoad(ValueType.INT, 1),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Long;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringType,
-                        options.itemFactory.longType,
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("toString")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Long;"),
+                    factory.createProto(factory.stringType, factory.longType, factory.intType),
+                    factory.createString("toString")),
                 false),
             new CfReturn(ValueType.OBJECT),
             label2),
@@ -2881,7 +2745,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode LongMethods_compareUnsigned(InternalOptions options, DexMethod method) {
+  public static CfCode LongMethods_compareUnsigned(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -2906,13 +2770,10 @@
             new CfLoad(ValueType.LONG, 6),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Long;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.intType,
-                        options.itemFactory.longType,
-                        options.itemFactory.longType),
-                    options.itemFactory.createString("compare")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Long;"),
+                    factory.createProto(factory.intType, factory.longType, factory.longType),
+                    factory.createString("compare")),
                 false),
             new CfReturn(ValueType.INT),
             label3),
@@ -2920,7 +2781,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode LongMethods_divideUnsigned(InternalOptions options, DexMethod method) {
+  public static CfCode LongMethods_divideUnsigned(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -3090,7 +2951,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode LongMethods_hashCode(InternalOptions options, DexMethod method) {
+  public static CfCode LongMethods_hashCode(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     return new CfCode(
@@ -3112,7 +2973,7 @@
   }
 
   public static CfCode LongMethods_parseLongSubsequenceWithRadix(
-      InternalOptions options, DexMethod method) {
+      DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     return new CfCode(
@@ -3126,31 +2987,25 @@
             new CfLoad(ValueType.INT, 2),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.charSequenceType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.charSequenceType,
-                        options.itemFactory.intType,
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("subSequence")),
+                factory.createMethod(
+                    factory.charSequenceType,
+                    factory.createProto(factory.charSequenceType, factory.intType, factory.intType),
+                    factory.createString("subSequence")),
                 true),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.charSequenceType,
-                    options.itemFactory.createProto(options.itemFactory.stringType),
-                    options.itemFactory.createString("toString")),
+                factory.createMethod(
+                    factory.charSequenceType,
+                    factory.createProto(factory.stringType),
+                    factory.createString("toString")),
                 true),
             new CfLoad(ValueType.INT, 3),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Long;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.longType,
-                        options.itemFactory.stringType,
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("parseLong")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Long;"),
+                    factory.createProto(factory.longType, factory.stringType, factory.intType),
+                    factory.createString("parseLong")),
                 false),
             new CfReturn(ValueType.LONG),
             label1),
@@ -3159,7 +3014,7 @@
   }
 
   public static CfCode LongMethods_parseLongSubsequenceWithRadixDalvik(
-      InternalOptions options, DexMethod method) {
+      DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -3182,11 +3037,10 @@
             label1,
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.charSequenceType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.charType, options.itemFactory.intType),
-                    options.itemFactory.createString("charAt")),
+                factory.createMethod(
+                    factory.charSequenceType,
+                    factory.createProto(factory.charType, factory.intType),
+                    factory.createString("charAt")),
                 true),
             new CfConstNumber(43, ValueType.INT),
             new CfIfCmp(If.Type.NE, ValueType.INT, label4),
@@ -3197,22 +3051,18 @@
             label2,
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.charSequenceType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.charType, options.itemFactory.intType),
-                    options.itemFactory.createString("charAt")),
+                factory.createMethod(
+                    factory.charSequenceType,
+                    factory.createProto(factory.charType, factory.intType),
+                    factory.createString("charAt")),
                 true),
             new CfLoad(ValueType.INT, 3),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.boxedCharType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.intType,
-                        options.itemFactory.charType,
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("digit")),
+                factory.createMethod(
+                    factory.boxedCharType,
+                    factory.createProto(factory.intType, factory.charType, factory.intType),
+                    factory.createString("digit")),
                 false),
             new CfIf(If.Type.LT, ValueType.INT, label4),
             label3,
@@ -3222,7 +3072,7 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2, 3},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.charSequenceType),
+                      FrameType.initializedNonNullReference(factory.charSequenceType),
                       FrameType.intType(),
                       FrameType.intType(),
                       FrameType.intType()
@@ -3232,31 +3082,25 @@
             new CfLoad(ValueType.INT, 2),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.charSequenceType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.charSequenceType,
-                        options.itemFactory.intType,
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("subSequence")),
+                factory.createMethod(
+                    factory.charSequenceType,
+                    factory.createProto(factory.charSequenceType, factory.intType, factory.intType),
+                    factory.createString("subSequence")),
                 true),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.charSequenceType,
-                    options.itemFactory.createProto(options.itemFactory.stringType),
-                    options.itemFactory.createString("toString")),
+                factory.createMethod(
+                    factory.charSequenceType,
+                    factory.createProto(factory.stringType),
+                    factory.createString("toString")),
                 true),
             new CfLoad(ValueType.INT, 3),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Long;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.longType,
-                        options.itemFactory.stringType,
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("parseLong")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Long;"),
+                    factory.createProto(factory.longType, factory.stringType, factory.intType),
+                    factory.createString("parseLong")),
                 false),
             new CfReturn(ValueType.LONG),
             label5),
@@ -3264,7 +3108,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode LongMethods_parseUnsignedLong(InternalOptions options, DexMethod method) {
+  public static CfCode LongMethods_parseUnsignedLong(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     return new CfCode(
@@ -3277,13 +3121,10 @@
             new CfConstNumber(10, ValueType.INT),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Long;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.longType,
-                        options.itemFactory.stringType,
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("parseUnsignedLong")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Long;"),
+                    factory.createProto(factory.longType, factory.stringType, factory.intType),
+                    factory.createString("parseUnsignedLong")),
                 false),
             new CfReturn(ValueType.LONG),
             label1),
@@ -3292,7 +3133,7 @@
   }
 
   public static CfCode LongMethods_parseUnsignedLongSubsequenceWithRadix(
-      InternalOptions options, DexMethod method) {
+      DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -3329,16 +3170,15 @@
             new CfLoad(ValueType.INT, 4),
             new CfIf(If.Type.NE, ValueType.INT, label3),
             label2,
-            new CfNew(options.itemFactory.createType("Ljava/lang/NumberFormatException;")),
+            new CfNew(factory.createType("Ljava/lang/NumberFormatException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
-            new CfConstString(options.itemFactory.createString("empty string")),
+            new CfConstString(factory.createString("empty string")),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/NumberFormatException;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.stringType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/NumberFormatException;"),
+                    factory.createProto(factory.voidType, factory.stringType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label3,
@@ -3346,7 +3186,7 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2, 3, 4},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.charSequenceType),
+                      FrameType.initializedNonNullReference(factory.charSequenceType),
                       FrameType.intType(),
                       FrameType.intType(),
                       FrameType.intType(),
@@ -3363,39 +3203,36 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2, 3, 4},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.charSequenceType),
+                      FrameType.initializedNonNullReference(factory.charSequenceType),
                       FrameType.intType(),
                       FrameType.intType(),
                       FrameType.intType(),
                       FrameType.intType()
                     })),
-            new CfNew(options.itemFactory.createType("Ljava/lang/NumberFormatException;")),
+            new CfNew(factory.createType("Ljava/lang/NumberFormatException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
-            new CfConstString(options.itemFactory.createString("illegal radix: ")),
+            new CfConstString(factory.createString("illegal radix: ")),
             new CfLoad(ValueType.INT, 3),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringType, options.itemFactory.intType),
-                    options.itemFactory.createString("valueOf")),
+                factory.createMethod(
+                    factory.stringType,
+                    factory.createProto(factory.stringType, factory.intType),
+                    factory.createString("valueOf")),
                 false),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringType, options.itemFactory.stringType),
-                    options.itemFactory.createString("concat")),
+                factory.createMethod(
+                    factory.stringType,
+                    factory.createProto(factory.stringType, factory.stringType),
+                    factory.createString("concat")),
                 false),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/NumberFormatException;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.stringType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/NumberFormatException;"),
+                    factory.createProto(factory.voidType, factory.stringType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label5,
@@ -3403,7 +3240,7 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2, 3, 4},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.charSequenceType),
+                      FrameType.initializedNonNullReference(factory.charSequenceType),
                       FrameType.intType(),
                       FrameType.intType(),
                       FrameType.intType(),
@@ -3414,13 +3251,10 @@
             new CfNumberConversion(NumericType.INT, NumericType.LONG),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Long;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.longType,
-                        options.itemFactory.longType,
-                        options.itemFactory.longType),
-                    options.itemFactory.createString("divideUnsigned")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Long;"),
+                    factory.createProto(factory.longType, factory.longType, factory.longType),
+                    factory.createString("divideUnsigned")),
                 false),
             new CfStore(ValueType.LONG, 5),
             label6,
@@ -3428,11 +3262,10 @@
             new CfLoad(ValueType.INT, 1),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.charSequenceType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.charType, options.itemFactory.intType),
-                    options.itemFactory.createString("charAt")),
+                factory.createMethod(
+                    factory.charSequenceType,
+                    factory.createProto(factory.charType, factory.intType),
+                    factory.createString("charAt")),
                 true),
             new CfConstNumber(43, ValueType.INT),
             new CfIfCmp(If.Type.NE, ValueType.INT, label7),
@@ -3448,7 +3281,7 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2, 3, 4, 5, 6},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.charSequenceType),
+                      FrameType.initializedNonNullReference(factory.charSequenceType),
                       FrameType.intType(),
                       FrameType.intType(),
                       FrameType.intType(),
@@ -3462,7 +3295,7 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2, 3, 4, 5, 6},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.charSequenceType),
+                      FrameType.initializedNonNullReference(factory.charSequenceType),
                       FrameType.intType(),
                       FrameType.intType(),
                       FrameType.intType(),
@@ -3483,7 +3316,7 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.charSequenceType),
+                      FrameType.initializedNonNullReference(factory.charSequenceType),
                       FrameType.intType(),
                       FrameType.intType(),
                       FrameType.intType(),
@@ -3503,22 +3336,18 @@
             new CfLoad(ValueType.INT, 10),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.charSequenceType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.charType, options.itemFactory.intType),
-                    options.itemFactory.createString("charAt")),
+                factory.createMethod(
+                    factory.charSequenceType,
+                    factory.createProto(factory.charType, factory.intType),
+                    factory.createString("charAt")),
                 true),
             new CfLoad(ValueType.INT, 3),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.boxedCharType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.intType,
-                        options.itemFactory.charType,
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("digit")),
+                factory.createMethod(
+                    factory.boxedCharType,
+                    factory.createProto(factory.intType, factory.charType, factory.intType),
+                    factory.createString("digit")),
                 false),
             new CfStore(ValueType.INT, 11),
             label13,
@@ -3526,23 +3355,22 @@
             new CfConstNumber(-1, ValueType.INT),
             new CfIfCmp(If.Type.NE, ValueType.INT, label15),
             label14,
-            new CfNew(options.itemFactory.createType("Ljava/lang/NumberFormatException;")),
+            new CfNew(factory.createType("Ljava/lang/NumberFormatException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.charSequenceType,
-                    options.itemFactory.createProto(options.itemFactory.stringType),
-                    options.itemFactory.createString("toString")),
+                factory.createMethod(
+                    factory.charSequenceType,
+                    factory.createProto(factory.stringType),
+                    factory.createString("toString")),
                 true),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/NumberFormatException;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.stringType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/NumberFormatException;"),
+                    factory.createProto(factory.voidType, factory.stringType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label15,
@@ -3550,7 +3378,7 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.charSequenceType),
+                      FrameType.initializedNonNullReference(factory.charSequenceType),
                       FrameType.intType(),
                       FrameType.intType(),
                       FrameType.intType(),
@@ -3582,13 +3410,10 @@
             label16,
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Long;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.longType,
-                        options.itemFactory.longType,
-                        options.itemFactory.longType),
-                    options.itemFactory.createString("remainderUnsigned")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Long;"),
+                    factory.createProto(factory.longType, factory.longType, factory.longType),
+                    factory.createString("remainderUnsigned")),
                 false),
             new CfNumberConversion(NumericType.LONG, NumericType.INT),
             new CfIfCmp(If.Type.LE, ValueType.INT, label18),
@@ -3597,7 +3422,7 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.charSequenceType),
+                      FrameType.initializedNonNullReference(factory.charSequenceType),
                       FrameType.intType(),
                       FrameType.intType(),
                       FrameType.intType(),
@@ -3610,32 +3435,30 @@
                       FrameType.intType(),
                       FrameType.intType()
                     })),
-            new CfNew(options.itemFactory.createType("Ljava/lang/NumberFormatException;")),
+            new CfNew(factory.createType("Ljava/lang/NumberFormatException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
-            new CfConstString(options.itemFactory.createString("Too large for unsigned long: ")),
+            new CfConstString(factory.createString("Too large for unsigned long: ")),
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.charSequenceType,
-                    options.itemFactory.createProto(options.itemFactory.stringType),
-                    options.itemFactory.createString("toString")),
+                factory.createMethod(
+                    factory.charSequenceType,
+                    factory.createProto(factory.stringType),
+                    factory.createString("toString")),
                 true),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringType, options.itemFactory.stringType),
-                    options.itemFactory.createString("concat")),
+                factory.createMethod(
+                    factory.stringType,
+                    factory.createProto(factory.stringType, factory.stringType),
+                    factory.createString("concat")),
                 false),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/NumberFormatException;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.stringType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/NumberFormatException;"),
+                    factory.createProto(factory.voidType, factory.stringType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label18,
@@ -3643,7 +3466,7 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.charSequenceType),
+                      FrameType.initializedNonNullReference(factory.charSequenceType),
                       FrameType.intType(),
                       FrameType.intType(),
                       FrameType.intType(),
@@ -3672,7 +3495,7 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.charSequenceType),
+                      FrameType.initializedNonNullReference(factory.charSequenceType),
                       FrameType.intType(),
                       FrameType.intType(),
                       FrameType.intType(),
@@ -3691,7 +3514,7 @@
   }
 
   public static CfCode LongMethods_parseUnsignedLongWithRadix(
-      InternalOptions options, DexMethod method) {
+      DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     return new CfCode(
@@ -3705,23 +3528,23 @@
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringType,
-                    options.itemFactory.createProto(options.itemFactory.intType),
-                    options.itemFactory.createString("length")),
+                factory.createMethod(
+                    factory.stringType,
+                    factory.createProto(factory.intType),
+                    factory.createString("length")),
                 false),
             new CfLoad(ValueType.INT, 1),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Long;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.longType,
-                        options.itemFactory.charSequenceType,
-                        options.itemFactory.intType,
-                        options.itemFactory.intType,
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("parseUnsignedLong")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Long;"),
+                    factory.createProto(
+                        factory.longType,
+                        factory.charSequenceType,
+                        factory.intType,
+                        factory.intType,
+                        factory.intType),
+                    factory.createString("parseUnsignedLong")),
                 false),
             new CfReturn(ValueType.LONG),
             label1),
@@ -3729,7 +3552,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode LongMethods_remainderUnsigned(InternalOptions options, DexMethod method) {
+  public static CfCode LongMethods_remainderUnsigned(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -3900,7 +3723,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode LongMethods_toUnsignedString(InternalOptions options, DexMethod method) {
+  public static CfCode LongMethods_toUnsignedString(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     return new CfCode(
@@ -3913,13 +3736,10 @@
             new CfConstNumber(10, ValueType.INT),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Long;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringType,
-                        options.itemFactory.longType,
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("toUnsignedString")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Long;"),
+                    factory.createProto(factory.stringType, factory.longType, factory.intType),
+                    factory.createString("toUnsignedString")),
                 false),
             new CfReturn(ValueType.OBJECT),
             label1),
@@ -3928,7 +3748,7 @@
   }
 
   public static CfCode LongMethods_toUnsignedStringWithRadix(
-      InternalOptions options, DexMethod method) {
+      DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -3967,7 +3787,7 @@
             new CfCmp(Cmp.Bias.NONE, NumericType.LONG),
             new CfIf(If.Type.NE, ValueType.INT, label2),
             label1,
-            new CfConstString(options.itemFactory.createString("0")),
+            new CfConstString(factory.createString("0")),
             new CfReturn(ValueType.OBJECT),
             label2,
             new CfFrame(
@@ -3985,13 +3805,10 @@
             new CfLoad(ValueType.INT, 2),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Long;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringType,
-                        options.itemFactory.longType,
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("toString")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Long;"),
+                    factory.createProto(factory.stringType, factory.longType, factory.intType),
+                    factory.createString("toString")),
                 false),
             new CfReturn(ValueType.OBJECT),
             label4,
@@ -4024,7 +3841,7 @@
                       FrameType.longType(), FrameType.longHighType(), FrameType.intType()
                     })),
             new CfConstNumber(64, ValueType.INT),
-            new CfNewArray(options.itemFactory.charArrayType),
+            new CfNewArray(factory.charArrayType),
             new CfStore(ValueType.OBJECT, 3),
             label7,
             new CfLoad(ValueType.OBJECT, 3),
@@ -4041,11 +3858,10 @@
             new CfLoad(ValueType.INT, 2),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Integer;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.intType, options.itemFactory.intType),
-                    options.itemFactory.createString("numberOfTrailingZeros")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Integer;"),
+                    factory.createProto(factory.intType, factory.intType),
+                    factory.createString("numberOfTrailingZeros")),
                 false),
             new CfStore(ValueType.INT, 5),
             label10,
@@ -4061,7 +3877,7 @@
                       FrameType.longType(),
                       FrameType.longHighType(),
                       FrameType.intType(),
-                      FrameType.initializedNonNullReference(options.itemFactory.charArrayType),
+                      FrameType.initializedNonNullReference(factory.charArrayType),
                       FrameType.intType(),
                       FrameType.intType(),
                       FrameType.intType()
@@ -4076,13 +3892,10 @@
             new CfLoad(ValueType.INT, 2),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.boxedCharType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.charType,
-                        options.itemFactory.intType,
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("forDigit")),
+                factory.createMethod(
+                    factory.boxedCharType,
+                    factory.createProto(factory.charType, factory.intType, factory.intType),
+                    factory.createString("forDigit")),
                 false),
             new CfArrayStore(MemberType.CHAR),
             label12,
@@ -4105,7 +3918,7 @@
                       FrameType.longType(),
                       FrameType.longHighType(),
                       FrameType.intType(),
-                      FrameType.initializedNonNullReference(options.itemFactory.charArrayType),
+                      FrameType.initializedNonNullReference(factory.charArrayType),
                       FrameType.intType()
                     })),
             new CfLoad(ValueType.INT, 2),
@@ -4132,7 +3945,7 @@
                       FrameType.longType(),
                       FrameType.longHighType(),
                       FrameType.intType(),
-                      FrameType.initializedNonNullReference(options.itemFactory.charArrayType),
+                      FrameType.initializedNonNullReference(factory.charArrayType),
                       FrameType.intType()
                     })),
             new CfLoad(ValueType.LONG, 0),
@@ -4140,13 +3953,10 @@
             new CfNumberConversion(NumericType.INT, NumericType.LONG),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Long;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.longType,
-                        options.itemFactory.longType,
-                        options.itemFactory.longType),
-                    options.itemFactory.createString("divideUnsigned")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Long;"),
+                    factory.createProto(factory.longType, factory.longType, factory.longType),
+                    factory.createString("divideUnsigned")),
                 false),
             new CfStore(ValueType.LONG, 5),
             label19,
@@ -4157,7 +3967,7 @@
                       FrameType.longType(),
                       FrameType.longHighType(),
                       FrameType.intType(),
-                      FrameType.initializedNonNullReference(options.itemFactory.charArrayType),
+                      FrameType.initializedNonNullReference(factory.charArrayType),
                       FrameType.intType(),
                       FrameType.longType(),
                       FrameType.longHighType()
@@ -4178,13 +3988,10 @@
             new CfLoad(ValueType.INT, 2),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.boxedCharType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.charType,
-                        options.itemFactory.intType,
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("forDigit")),
+                factory.createMethod(
+                    factory.boxedCharType,
+                    factory.createProto(factory.charType, factory.intType, factory.intType),
+                    factory.createString("forDigit")),
                 false),
             new CfArrayStore(MemberType.CHAR),
             label21,
@@ -4198,7 +4005,7 @@
                       FrameType.longType(),
                       FrameType.longHighType(),
                       FrameType.intType(),
-                      FrameType.initializedNonNullReference(options.itemFactory.charArrayType),
+                      FrameType.initializedNonNullReference(factory.charArrayType),
                       FrameType.intType(),
                       FrameType.longType(),
                       FrameType.longHighType(),
@@ -4221,13 +4028,10 @@
             new CfLoad(ValueType.INT, 2),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.boxedCharType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.charType,
-                        options.itemFactory.intType,
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("forDigit")),
+                factory.createMethod(
+                    factory.boxedCharType,
+                    factory.createProto(factory.charType, factory.intType, factory.intType),
+                    factory.createString("forDigit")),
                 false),
             new CfArrayStore(MemberType.CHAR),
             label24,
@@ -4245,10 +4049,10 @@
                       FrameType.longType(),
                       FrameType.longHighType(),
                       FrameType.intType(),
-                      FrameType.initializedNonNullReference(options.itemFactory.charArrayType),
+                      FrameType.initializedNonNullReference(factory.charArrayType),
                       FrameType.intType()
                     })),
-            new CfNew(options.itemFactory.stringType),
+            new CfNew(factory.stringType),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfLoad(ValueType.OBJECT, 3),
             new CfLoad(ValueType.INT, 4),
@@ -4258,14 +4062,11 @@
             new CfArithmeticBinop(CfArithmeticBinop.Opcode.Sub, NumericType.INT),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType,
-                        options.itemFactory.charArrayType,
-                        options.itemFactory.intType,
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.stringType,
+                    factory.createProto(
+                        factory.voidType, factory.charArrayType, factory.intType, factory.intType),
+                    factory.createString("<init>")),
                 false),
             new CfReturn(ValueType.OBJECT),
             label26),
@@ -4273,7 +4074,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode MathMethods_addExactInt(InternalOptions options, DexMethod method) {
+  public static CfCode MathMethods_addExactInt(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -4316,14 +4117,14 @@
                       FrameType.longHighType(),
                       FrameType.intType()
                     })),
-            new CfNew(options.itemFactory.createType("Ljava/lang/ArithmeticException;")),
+            new CfNew(factory.createType("Ljava/lang/ArithmeticException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/ArithmeticException;"),
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/ArithmeticException;"),
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label5),
@@ -4331,7 +4132,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode MathMethods_addExactLong(InternalOptions options, DexMethod method) {
+  public static CfCode MathMethods_addExactLong(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -4438,14 +4239,14 @@
                       FrameType.longType(),
                       FrameType.longHighType()
                     })),
-            new CfNew(options.itemFactory.createType("Ljava/lang/ArithmeticException;")),
+            new CfNew(factory.createType("Ljava/lang/ArithmeticException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/ArithmeticException;"),
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/ArithmeticException;"),
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label8),
@@ -4453,7 +4254,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode MathMethods_decrementExactInt(InternalOptions options, DexMethod method) {
+  public static CfCode MathMethods_decrementExactInt(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -4468,14 +4269,14 @@
             new CfConstNumber(-2147483648, ValueType.INT),
             new CfIfCmp(If.Type.NE, ValueType.INT, label2),
             label1,
-            new CfNew(options.itemFactory.createType("Ljava/lang/ArithmeticException;")),
+            new CfNew(factory.createType("Ljava/lang/ArithmeticException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/ArithmeticException;"),
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/ArithmeticException;"),
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label2,
@@ -4490,7 +4291,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode MathMethods_decrementExactLong(InternalOptions options, DexMethod method) {
+  public static CfCode MathMethods_decrementExactLong(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -4506,14 +4307,14 @@
             new CfCmp(Cmp.Bias.NONE, NumericType.LONG),
             new CfIf(If.Type.NE, ValueType.INT, label2),
             label1,
-            new CfNew(options.itemFactory.createType("Ljava/lang/ArithmeticException;")),
+            new CfNew(factory.createType("Ljava/lang/ArithmeticException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/ArithmeticException;"),
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/ArithmeticException;"),
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label2,
@@ -4530,7 +4331,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode MathMethods_floorDivInt(InternalOptions options, DexMethod method) {
+  public static CfCode MathMethods_floorDivInt(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -4618,7 +4419,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode MathMethods_floorDivLong(InternalOptions options, DexMethod method) {
+  public static CfCode MathMethods_floorDivLong(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -4724,7 +4525,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode MathMethods_floorDivLongInt(InternalOptions options, DexMethod method) {
+  public static CfCode MathMethods_floorDivLongInt(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     return new CfCode(
@@ -4738,13 +4539,10 @@
             new CfNumberConversion(NumericType.INT, NumericType.LONG),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Math;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.longType,
-                        options.itemFactory.longType,
-                        options.itemFactory.longType),
-                    options.itemFactory.createString("floorDiv")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Math;"),
+                    factory.createProto(factory.longType, factory.longType, factory.longType),
+                    factory.createString("floorDiv")),
                 false),
             new CfReturn(ValueType.LONG),
             label1),
@@ -4752,7 +4550,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode MathMethods_floorModInt(InternalOptions options, DexMethod method) {
+  public static CfCode MathMethods_floorModInt(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -4827,7 +4625,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode MathMethods_floorModLong(InternalOptions options, DexMethod method) {
+  public static CfCode MathMethods_floorModLong(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -4919,7 +4717,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode MathMethods_floorModLongInt(InternalOptions options, DexMethod method) {
+  public static CfCode MathMethods_floorModLongInt(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     return new CfCode(
@@ -4933,13 +4731,10 @@
             new CfNumberConversion(NumericType.INT, NumericType.LONG),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Math;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.longType,
-                        options.itemFactory.longType,
-                        options.itemFactory.longType),
-                    options.itemFactory.createString("floorMod")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Math;"),
+                    factory.createProto(factory.longType, factory.longType, factory.longType),
+                    factory.createString("floorMod")),
                 false),
             new CfNumberConversion(NumericType.LONG, NumericType.INT),
             new CfReturn(ValueType.INT),
@@ -4948,7 +4743,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode MathMethods_incrementExactInt(InternalOptions options, DexMethod method) {
+  public static CfCode MathMethods_incrementExactInt(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -4963,14 +4758,14 @@
             new CfConstNumber(2147483647, ValueType.INT),
             new CfIfCmp(If.Type.NE, ValueType.INT, label2),
             label1,
-            new CfNew(options.itemFactory.createType("Ljava/lang/ArithmeticException;")),
+            new CfNew(factory.createType("Ljava/lang/ArithmeticException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/ArithmeticException;"),
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/ArithmeticException;"),
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label2,
@@ -4985,7 +4780,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode MathMethods_incrementExactLong(InternalOptions options, DexMethod method) {
+  public static CfCode MathMethods_incrementExactLong(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -5001,14 +4796,14 @@
             new CfCmp(Cmp.Bias.NONE, NumericType.LONG),
             new CfIf(If.Type.NE, ValueType.INT, label2),
             label1,
-            new CfNew(options.itemFactory.createType("Ljava/lang/ArithmeticException;")),
+            new CfNew(factory.createType("Ljava/lang/ArithmeticException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/ArithmeticException;"),
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/ArithmeticException;"),
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label2,
@@ -5025,7 +4820,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode MathMethods_multiplyExactInt(InternalOptions options, DexMethod method) {
+  public static CfCode MathMethods_multiplyExactInt(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -5068,14 +4863,14 @@
                       FrameType.longHighType(),
                       FrameType.intType()
                     })),
-            new CfNew(options.itemFactory.createType("Ljava/lang/ArithmeticException;")),
+            new CfNew(factory.createType("Ljava/lang/ArithmeticException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/ArithmeticException;"),
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/ArithmeticException;"),
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label5),
@@ -5083,7 +4878,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode MathMethods_multiplyExactLong(InternalOptions options, DexMethod method) {
+  public static CfCode MathMethods_multiplyExactLong(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -5111,11 +4906,10 @@
             label1,
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Long;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.intType, options.itemFactory.longType),
-                    options.itemFactory.createString("numberOfLeadingZeros")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Long;"),
+                    factory.createProto(factory.intType, factory.longType),
+                    factory.createString("numberOfLeadingZeros")),
                 false),
             new CfLoad(ValueType.LONG, 0),
             new CfConstNumber(-1, ValueType.LONG),
@@ -5123,22 +4917,20 @@
             label2,
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Long;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.intType, options.itemFactory.longType),
-                    options.itemFactory.createString("numberOfLeadingZeros")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Long;"),
+                    factory.createProto(factory.intType, factory.longType),
+                    factory.createString("numberOfLeadingZeros")),
                 false),
             new CfArithmeticBinop(CfArithmeticBinop.Opcode.Add, NumericType.INT),
             new CfLoad(ValueType.LONG, 2),
             label3,
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Long;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.intType, options.itemFactory.longType),
-                    options.itemFactory.createString("numberOfLeadingZeros")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Long;"),
+                    factory.createProto(factory.intType, factory.longType),
+                    factory.createString("numberOfLeadingZeros")),
                 false),
             new CfArithmeticBinop(CfArithmeticBinop.Opcode.Add, NumericType.INT),
             new CfLoad(ValueType.LONG, 2),
@@ -5147,11 +4939,10 @@
             label4,
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Long;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.intType, options.itemFactory.longType),
-                    options.itemFactory.createString("numberOfLeadingZeros")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Long;"),
+                    factory.createProto(factory.intType, factory.longType),
+                    factory.createString("numberOfLeadingZeros")),
                 false),
             new CfArithmeticBinop(CfArithmeticBinop.Opcode.Add, NumericType.INT),
             new CfStore(ValueType.INT, 4),
@@ -5283,14 +5074,14 @@
                       FrameType.longHighType(),
                       FrameType.intType()
                     })),
-            new CfNew(options.itemFactory.createType("Ljava/lang/ArithmeticException;")),
+            new CfNew(factory.createType("Ljava/lang/ArithmeticException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/ArithmeticException;"),
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/ArithmeticException;"),
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label16),
@@ -5298,7 +5089,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode MathMethods_multiplyExactLongInt(InternalOptions options, DexMethod method) {
+  public static CfCode MathMethods_multiplyExactLongInt(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     return new CfCode(
@@ -5312,13 +5103,10 @@
             new CfNumberConversion(NumericType.INT, NumericType.LONG),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Math;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.longType,
-                        options.itemFactory.longType,
-                        options.itemFactory.longType),
-                    options.itemFactory.createString("multiplyExact")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Math;"),
+                    factory.createProto(factory.longType, factory.longType, factory.longType),
+                    factory.createString("multiplyExact")),
                 false),
             new CfReturn(ValueType.LONG),
             label1),
@@ -5326,7 +5114,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode MathMethods_multiplyFull(InternalOptions options, DexMethod method) {
+  public static CfCode MathMethods_multiplyFull(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     return new CfCode(
@@ -5346,7 +5134,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode MathMethods_multiplyHigh(InternalOptions options, DexMethod method) {
+  public static CfCode MathMethods_multiplyHigh(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -5450,7 +5238,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode MathMethods_negateExactInt(InternalOptions options, DexMethod method) {
+  public static CfCode MathMethods_negateExactInt(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -5465,14 +5253,14 @@
             new CfConstNumber(-2147483648, ValueType.INT),
             new CfIfCmp(If.Type.NE, ValueType.INT, label2),
             label1,
-            new CfNew(options.itemFactory.createType("Ljava/lang/ArithmeticException;")),
+            new CfNew(factory.createType("Ljava/lang/ArithmeticException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/ArithmeticException;"),
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/ArithmeticException;"),
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label2,
@@ -5486,7 +5274,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode MathMethods_negateExactLong(InternalOptions options, DexMethod method) {
+  public static CfCode MathMethods_negateExactLong(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -5502,14 +5290,14 @@
             new CfCmp(Cmp.Bias.NONE, NumericType.LONG),
             new CfIf(If.Type.NE, ValueType.INT, label2),
             label1,
-            new CfNew(options.itemFactory.createType("Ljava/lang/ArithmeticException;")),
+            new CfNew(factory.createType("Ljava/lang/ArithmeticException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/ArithmeticException;"),
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/ArithmeticException;"),
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label2,
@@ -5525,7 +5313,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode MathMethods_nextDownDouble(InternalOptions options, DexMethod method) {
+  public static CfCode MathMethods_nextDownDouble(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     return new CfCode(
@@ -5538,11 +5326,10 @@
             new CfNeg(NumericType.DOUBLE),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Math;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.doubleType, options.itemFactory.doubleType),
-                    options.itemFactory.createString("nextUp")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Math;"),
+                    factory.createProto(factory.doubleType, factory.doubleType),
+                    factory.createString("nextUp")),
                 false),
             new CfNeg(NumericType.DOUBLE),
             new CfReturn(ValueType.DOUBLE),
@@ -5551,7 +5338,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode MathMethods_nextDownFloat(InternalOptions options, DexMethod method) {
+  public static CfCode MathMethods_nextDownFloat(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     return new CfCode(
@@ -5564,11 +5351,10 @@
             new CfNeg(NumericType.FLOAT),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Math;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.floatType, options.itemFactory.floatType),
-                    options.itemFactory.createString("nextUp")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Math;"),
+                    factory.createProto(factory.floatType, factory.floatType),
+                    factory.createString("nextUp")),
                 false),
             new CfNeg(NumericType.FLOAT),
             new CfReturn(ValueType.FLOAT),
@@ -5577,7 +5363,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode MathMethods_subtractExactInt(InternalOptions options, DexMethod method) {
+  public static CfCode MathMethods_subtractExactInt(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -5620,14 +5406,14 @@
                       FrameType.longHighType(),
                       FrameType.intType()
                     })),
-            new CfNew(options.itemFactory.createType("Ljava/lang/ArithmeticException;")),
+            new CfNew(factory.createType("Ljava/lang/ArithmeticException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/ArithmeticException;"),
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/ArithmeticException;"),
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label5),
@@ -5635,7 +5421,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode MathMethods_subtractExactLong(InternalOptions options, DexMethod method) {
+  public static CfCode MathMethods_subtractExactLong(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -5742,14 +5528,14 @@
                       FrameType.longType(),
                       FrameType.longHighType()
                     })),
-            new CfNew(options.itemFactory.createType("Ljava/lang/ArithmeticException;")),
+            new CfNew(factory.createType("Ljava/lang/ArithmeticException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/ArithmeticException;"),
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/ArithmeticException;"),
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label8),
@@ -5757,7 +5543,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode MathMethods_toIntExact(InternalOptions options, DexMethod method) {
+  public static CfCode MathMethods_toIntExact(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -5779,14 +5565,14 @@
             new CfCmp(Cmp.Bias.NONE, NumericType.LONG),
             new CfIf(If.Type.EQ, ValueType.INT, label3),
             label2,
-            new CfNew(options.itemFactory.createType("Ljava/lang/ArithmeticException;")),
+            new CfNew(factory.createType("Ljava/lang/ArithmeticException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/ArithmeticException;"),
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/ArithmeticException;"),
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label3,
@@ -5803,8 +5589,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode ObjectsMethods_checkFromIndexSize(
-      InternalOptions options, DexMethod method) {
+  public static CfCode ObjectsMethods_checkFromIndexSize(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -5833,103 +5618,94 @@
                     new FrameType[] {
                       FrameType.intType(), FrameType.intType(), FrameType.intType()
                     })),
-            new CfNew(options.itemFactory.createType("Ljava/lang/IndexOutOfBoundsException;")),
+            new CfNew(factory.createType("Ljava/lang/IndexOutOfBoundsException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
-            new CfNew(options.itemFactory.stringBuilderType),
+            new CfNew(factory.stringBuilderType),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
-            new CfConstString(options.itemFactory.createString("Range [")),
+            new CfConstString(factory.createString("Range [")),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.stringType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.stringType),
+                    factory.createString("append")),
                 false),
             new CfLoad(ValueType.INT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.intType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.intType),
+                    factory.createString("append")),
                 false),
-            new CfConstString(options.itemFactory.createString(", ")),
+            new CfConstString(factory.createString(", ")),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.stringType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.stringType),
+                    factory.createString("append")),
                 false),
             new CfLoad(ValueType.INT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.intType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.intType),
+                    factory.createString("append")),
                 false),
-            new CfConstString(options.itemFactory.createString(" + ")),
+            new CfConstString(factory.createString(" + ")),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.stringType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.stringType),
+                    factory.createString("append")),
                 false),
             new CfLoad(ValueType.INT, 1),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.intType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.intType),
+                    factory.createString("append")),
                 false),
-            new CfConstString(options.itemFactory.createString(") out of bounds for length ")),
+            new CfConstString(factory.createString(") out of bounds for length ")),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.stringType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.stringType),
+                    factory.createString("append")),
                 false),
             new CfLoad(ValueType.INT, 2),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.intType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.intType),
+                    factory.createString("append")),
                 false),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(options.itemFactory.stringType),
-                    options.itemFactory.createString("toString")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringType),
+                    factory.createString("toString")),
                 false),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/IndexOutOfBoundsException;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.stringType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/IndexOutOfBoundsException;"),
+                    factory.createProto(factory.voidType, factory.stringType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label2,
@@ -5946,7 +5722,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode ObjectsMethods_checkFromToIndex(InternalOptions options, DexMethod method) {
+  public static CfCode ObjectsMethods_checkFromToIndex(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -5972,85 +5748,78 @@
                     new FrameType[] {
                       FrameType.intType(), FrameType.intType(), FrameType.intType()
                     })),
-            new CfNew(options.itemFactory.createType("Ljava/lang/IndexOutOfBoundsException;")),
+            new CfNew(factory.createType("Ljava/lang/IndexOutOfBoundsException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
-            new CfNew(options.itemFactory.stringBuilderType),
+            new CfNew(factory.stringBuilderType),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
-            new CfConstString(options.itemFactory.createString("Range [")),
+            new CfConstString(factory.createString("Range [")),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.stringType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.stringType),
+                    factory.createString("append")),
                 false),
             new CfLoad(ValueType.INT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.intType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.intType),
+                    factory.createString("append")),
                 false),
-            new CfConstString(options.itemFactory.createString(", ")),
+            new CfConstString(factory.createString(", ")),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.stringType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.stringType),
+                    factory.createString("append")),
                 false),
             new CfLoad(ValueType.INT, 1),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.intType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.intType),
+                    factory.createString("append")),
                 false),
-            new CfConstString(options.itemFactory.createString(") out of bounds for length ")),
+            new CfConstString(factory.createString(") out of bounds for length ")),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.stringType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.stringType),
+                    factory.createString("append")),
                 false),
             new CfLoad(ValueType.INT, 2),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.intType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.intType),
+                    factory.createString("append")),
                 false),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(options.itemFactory.stringType),
-                    options.itemFactory.createString("toString")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringType),
+                    factory.createString("toString")),
                 false),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/IndexOutOfBoundsException;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.stringType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/IndexOutOfBoundsException;"),
+                    factory.createProto(factory.voidType, factory.stringType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label2,
@@ -6067,7 +5836,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode ObjectsMethods_checkIndex(InternalOptions options, DexMethod method) {
+  public static CfCode ObjectsMethods_checkIndex(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -6087,67 +5856,62 @@
             new CfFrame(
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1}, new FrameType[] {FrameType.intType(), FrameType.intType()})),
-            new CfNew(options.itemFactory.createType("Ljava/lang/IndexOutOfBoundsException;")),
+            new CfNew(factory.createType("Ljava/lang/IndexOutOfBoundsException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
-            new CfNew(options.itemFactory.stringBuilderType),
+            new CfNew(factory.stringBuilderType),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
-            new CfConstString(options.itemFactory.createString("Index ")),
+            new CfConstString(factory.createString("Index ")),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.stringType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.stringType),
+                    factory.createString("append")),
                 false),
             new CfLoad(ValueType.INT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.intType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.intType),
+                    factory.createString("append")),
                 false),
-            new CfConstString(options.itemFactory.createString(" out of bounds for length ")),
+            new CfConstString(factory.createString(" out of bounds for length ")),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.stringType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.stringType),
+                    factory.createString("append")),
                 false),
             new CfLoad(ValueType.INT, 1),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.intType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.intType),
+                    factory.createString("append")),
                 false),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(options.itemFactory.stringType),
-                    options.itemFactory.createString("toString")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringType),
+                    factory.createString("toString")),
                 false),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/IndexOutOfBoundsException;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.stringType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/IndexOutOfBoundsException;"),
+                    factory.createProto(factory.voidType, factory.stringType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label2,
@@ -6161,7 +5925,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode ObjectsMethods_compare(InternalOptions options, DexMethod method) {
+  public static CfCode ObjectsMethods_compare(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -6182,33 +5946,30 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/Comparator;"))
+                          factory.createType("Ljava/util/Comparator;"))
                     })),
             new CfLoad(ValueType.OBJECT, 2),
             new CfLoad(ValueType.OBJECT, 0),
             new CfLoad(ValueType.OBJECT, 1),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Comparator;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.intType,
-                        options.itemFactory.objectType,
-                        options.itemFactory.objectType),
-                    options.itemFactory.createString("compare")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Comparator;"),
+                    factory.createProto(factory.intType, factory.objectType, factory.objectType),
+                    factory.createString("compare")),
                 true),
             label2,
             new CfFrame(
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/Comparator;"))
+                          factory.createType("Ljava/util/Comparator;"))
                     }),
                 new ArrayDeque<>(Arrays.asList(FrameType.intType()))),
             new CfReturn(ValueType.INT),
@@ -6217,7 +5978,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode ObjectsMethods_deepEquals(InternalOptions options, DexMethod method) {
+  public static CfCode ObjectsMethods_deepEquals(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -6274,8 +6035,8 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfLoad(ValueType.OBJECT, 0),
             new CfIf(If.Type.NE, ValueType.OBJECT, label2),
@@ -6286,29 +6047,27 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfLoad(ValueType.OBJECT, 0),
-            new CfInstanceOf(options.itemFactory.booleanArrayType),
+            new CfInstanceOf(factory.booleanArrayType),
             new CfIf(If.Type.EQ, ValueType.INT, label6),
             label3,
             new CfLoad(ValueType.OBJECT, 1),
-            new CfInstanceOf(options.itemFactory.booleanArrayType),
+            new CfInstanceOf(factory.booleanArrayType),
             new CfIf(If.Type.EQ, ValueType.INT, label4),
             new CfLoad(ValueType.OBJECT, 0),
-            new CfCheckCast(options.itemFactory.booleanArrayType),
+            new CfCheckCast(factory.booleanArrayType),
             new CfLoad(ValueType.OBJECT, 1),
-            new CfCheckCast(options.itemFactory.booleanArrayType),
+            new CfCheckCast(factory.booleanArrayType),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Arrays;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.booleanType,
-                        options.itemFactory.booleanArrayType,
-                        options.itemFactory.booleanArrayType),
-                    options.itemFactory.createString("equals")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Arrays;"),
+                    factory.createProto(
+                        factory.booleanType, factory.booleanArrayType, factory.booleanArrayType),
+                    factory.createString("equals")),
                 false),
             new CfIf(If.Type.EQ, ValueType.INT, label4),
             new CfConstNumber(1, ValueType.INT),
@@ -6318,8 +6077,8 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfConstNumber(0, ValueType.INT),
             label5,
@@ -6327,8 +6086,8 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     }),
                 new ArrayDeque<>(Arrays.asList(FrameType.intType()))),
             new CfReturn(ValueType.INT),
@@ -6337,29 +6096,27 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfLoad(ValueType.OBJECT, 0),
-            new CfInstanceOf(options.itemFactory.byteArrayType),
+            new CfInstanceOf(factory.byteArrayType),
             new CfIf(If.Type.EQ, ValueType.INT, label10),
             label7,
             new CfLoad(ValueType.OBJECT, 1),
-            new CfInstanceOf(options.itemFactory.byteArrayType),
+            new CfInstanceOf(factory.byteArrayType),
             new CfIf(If.Type.EQ, ValueType.INT, label8),
             new CfLoad(ValueType.OBJECT, 0),
-            new CfCheckCast(options.itemFactory.byteArrayType),
+            new CfCheckCast(factory.byteArrayType),
             new CfLoad(ValueType.OBJECT, 1),
-            new CfCheckCast(options.itemFactory.byteArrayType),
+            new CfCheckCast(factory.byteArrayType),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Arrays;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.booleanType,
-                        options.itemFactory.byteArrayType,
-                        options.itemFactory.byteArrayType),
-                    options.itemFactory.createString("equals")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Arrays;"),
+                    factory.createProto(
+                        factory.booleanType, factory.byteArrayType, factory.byteArrayType),
+                    factory.createString("equals")),
                 false),
             new CfIf(If.Type.EQ, ValueType.INT, label8),
             new CfConstNumber(1, ValueType.INT),
@@ -6369,8 +6126,8 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfConstNumber(0, ValueType.INT),
             label9,
@@ -6378,8 +6135,8 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     }),
                 new ArrayDeque<>(Arrays.asList(FrameType.intType()))),
             new CfReturn(ValueType.INT),
@@ -6388,29 +6145,27 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfLoad(ValueType.OBJECT, 0),
-            new CfInstanceOf(options.itemFactory.charArrayType),
+            new CfInstanceOf(factory.charArrayType),
             new CfIf(If.Type.EQ, ValueType.INT, label14),
             label11,
             new CfLoad(ValueType.OBJECT, 1),
-            new CfInstanceOf(options.itemFactory.charArrayType),
+            new CfInstanceOf(factory.charArrayType),
             new CfIf(If.Type.EQ, ValueType.INT, label12),
             new CfLoad(ValueType.OBJECT, 0),
-            new CfCheckCast(options.itemFactory.charArrayType),
+            new CfCheckCast(factory.charArrayType),
             new CfLoad(ValueType.OBJECT, 1),
-            new CfCheckCast(options.itemFactory.charArrayType),
+            new CfCheckCast(factory.charArrayType),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Arrays;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.booleanType,
-                        options.itemFactory.charArrayType,
-                        options.itemFactory.charArrayType),
-                    options.itemFactory.createString("equals")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Arrays;"),
+                    factory.createProto(
+                        factory.booleanType, factory.charArrayType, factory.charArrayType),
+                    factory.createString("equals")),
                 false),
             new CfIf(If.Type.EQ, ValueType.INT, label12),
             new CfConstNumber(1, ValueType.INT),
@@ -6420,8 +6175,8 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfConstNumber(0, ValueType.INT),
             label13,
@@ -6429,8 +6184,8 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     }),
                 new ArrayDeque<>(Arrays.asList(FrameType.intType()))),
             new CfReturn(ValueType.INT),
@@ -6439,29 +6194,27 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfLoad(ValueType.OBJECT, 0),
-            new CfInstanceOf(options.itemFactory.doubleArrayType),
+            new CfInstanceOf(factory.doubleArrayType),
             new CfIf(If.Type.EQ, ValueType.INT, label18),
             label15,
             new CfLoad(ValueType.OBJECT, 1),
-            new CfInstanceOf(options.itemFactory.doubleArrayType),
+            new CfInstanceOf(factory.doubleArrayType),
             new CfIf(If.Type.EQ, ValueType.INT, label16),
             new CfLoad(ValueType.OBJECT, 0),
-            new CfCheckCast(options.itemFactory.doubleArrayType),
+            new CfCheckCast(factory.doubleArrayType),
             new CfLoad(ValueType.OBJECT, 1),
-            new CfCheckCast(options.itemFactory.doubleArrayType),
+            new CfCheckCast(factory.doubleArrayType),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Arrays;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.booleanType,
-                        options.itemFactory.doubleArrayType,
-                        options.itemFactory.doubleArrayType),
-                    options.itemFactory.createString("equals")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Arrays;"),
+                    factory.createProto(
+                        factory.booleanType, factory.doubleArrayType, factory.doubleArrayType),
+                    factory.createString("equals")),
                 false),
             new CfIf(If.Type.EQ, ValueType.INT, label16),
             new CfConstNumber(1, ValueType.INT),
@@ -6471,8 +6224,8 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfConstNumber(0, ValueType.INT),
             label17,
@@ -6480,8 +6233,8 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     }),
                 new ArrayDeque<>(Arrays.asList(FrameType.intType()))),
             new CfReturn(ValueType.INT),
@@ -6490,29 +6243,27 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfLoad(ValueType.OBJECT, 0),
-            new CfInstanceOf(options.itemFactory.floatArrayType),
+            new CfInstanceOf(factory.floatArrayType),
             new CfIf(If.Type.EQ, ValueType.INT, label22),
             label19,
             new CfLoad(ValueType.OBJECT, 1),
-            new CfInstanceOf(options.itemFactory.floatArrayType),
+            new CfInstanceOf(factory.floatArrayType),
             new CfIf(If.Type.EQ, ValueType.INT, label20),
             new CfLoad(ValueType.OBJECT, 0),
-            new CfCheckCast(options.itemFactory.floatArrayType),
+            new CfCheckCast(factory.floatArrayType),
             new CfLoad(ValueType.OBJECT, 1),
-            new CfCheckCast(options.itemFactory.floatArrayType),
+            new CfCheckCast(factory.floatArrayType),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Arrays;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.booleanType,
-                        options.itemFactory.floatArrayType,
-                        options.itemFactory.floatArrayType),
-                    options.itemFactory.createString("equals")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Arrays;"),
+                    factory.createProto(
+                        factory.booleanType, factory.floatArrayType, factory.floatArrayType),
+                    factory.createString("equals")),
                 false),
             new CfIf(If.Type.EQ, ValueType.INT, label20),
             new CfConstNumber(1, ValueType.INT),
@@ -6522,8 +6273,8 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfConstNumber(0, ValueType.INT),
             label21,
@@ -6531,8 +6282,8 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     }),
                 new ArrayDeque<>(Arrays.asList(FrameType.intType()))),
             new CfReturn(ValueType.INT),
@@ -6541,29 +6292,27 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfLoad(ValueType.OBJECT, 0),
-            new CfInstanceOf(options.itemFactory.intArrayType),
+            new CfInstanceOf(factory.intArrayType),
             new CfIf(If.Type.EQ, ValueType.INT, label26),
             label23,
             new CfLoad(ValueType.OBJECT, 1),
-            new CfInstanceOf(options.itemFactory.intArrayType),
+            new CfInstanceOf(factory.intArrayType),
             new CfIf(If.Type.EQ, ValueType.INT, label24),
             new CfLoad(ValueType.OBJECT, 0),
-            new CfCheckCast(options.itemFactory.intArrayType),
+            new CfCheckCast(factory.intArrayType),
             new CfLoad(ValueType.OBJECT, 1),
-            new CfCheckCast(options.itemFactory.intArrayType),
+            new CfCheckCast(factory.intArrayType),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Arrays;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.booleanType,
-                        options.itemFactory.intArrayType,
-                        options.itemFactory.intArrayType),
-                    options.itemFactory.createString("equals")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Arrays;"),
+                    factory.createProto(
+                        factory.booleanType, factory.intArrayType, factory.intArrayType),
+                    factory.createString("equals")),
                 false),
             new CfIf(If.Type.EQ, ValueType.INT, label24),
             new CfConstNumber(1, ValueType.INT),
@@ -6573,8 +6322,8 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfConstNumber(0, ValueType.INT),
             label25,
@@ -6582,8 +6331,8 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     }),
                 new ArrayDeque<>(Arrays.asList(FrameType.intType()))),
             new CfReturn(ValueType.INT),
@@ -6592,29 +6341,27 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfLoad(ValueType.OBJECT, 0),
-            new CfInstanceOf(options.itemFactory.longArrayType),
+            new CfInstanceOf(factory.longArrayType),
             new CfIf(If.Type.EQ, ValueType.INT, label30),
             label27,
             new CfLoad(ValueType.OBJECT, 1),
-            new CfInstanceOf(options.itemFactory.longArrayType),
+            new CfInstanceOf(factory.longArrayType),
             new CfIf(If.Type.EQ, ValueType.INT, label28),
             new CfLoad(ValueType.OBJECT, 0),
-            new CfCheckCast(options.itemFactory.longArrayType),
+            new CfCheckCast(factory.longArrayType),
             new CfLoad(ValueType.OBJECT, 1),
-            new CfCheckCast(options.itemFactory.longArrayType),
+            new CfCheckCast(factory.longArrayType),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Arrays;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.booleanType,
-                        options.itemFactory.longArrayType,
-                        options.itemFactory.longArrayType),
-                    options.itemFactory.createString("equals")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Arrays;"),
+                    factory.createProto(
+                        factory.booleanType, factory.longArrayType, factory.longArrayType),
+                    factory.createString("equals")),
                 false),
             new CfIf(If.Type.EQ, ValueType.INT, label28),
             new CfConstNumber(1, ValueType.INT),
@@ -6624,8 +6371,8 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfConstNumber(0, ValueType.INT),
             label29,
@@ -6633,8 +6380,8 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     }),
                 new ArrayDeque<>(Arrays.asList(FrameType.intType()))),
             new CfReturn(ValueType.INT),
@@ -6643,29 +6390,27 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfLoad(ValueType.OBJECT, 0),
-            new CfInstanceOf(options.itemFactory.shortArrayType),
+            new CfInstanceOf(factory.shortArrayType),
             new CfIf(If.Type.EQ, ValueType.INT, label34),
             label31,
             new CfLoad(ValueType.OBJECT, 1),
-            new CfInstanceOf(options.itemFactory.shortArrayType),
+            new CfInstanceOf(factory.shortArrayType),
             new CfIf(If.Type.EQ, ValueType.INT, label32),
             new CfLoad(ValueType.OBJECT, 0),
-            new CfCheckCast(options.itemFactory.shortArrayType),
+            new CfCheckCast(factory.shortArrayType),
             new CfLoad(ValueType.OBJECT, 1),
-            new CfCheckCast(options.itemFactory.shortArrayType),
+            new CfCheckCast(factory.shortArrayType),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Arrays;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.booleanType,
-                        options.itemFactory.shortArrayType,
-                        options.itemFactory.shortArrayType),
-                    options.itemFactory.createString("equals")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Arrays;"),
+                    factory.createProto(
+                        factory.booleanType, factory.shortArrayType, factory.shortArrayType),
+                    factory.createString("equals")),
                 false),
             new CfIf(If.Type.EQ, ValueType.INT, label32),
             new CfConstNumber(1, ValueType.INT),
@@ -6675,8 +6420,8 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfConstNumber(0, ValueType.INT),
             label33,
@@ -6684,8 +6429,8 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     }),
                 new ArrayDeque<>(Arrays.asList(FrameType.intType()))),
             new CfReturn(ValueType.INT),
@@ -6694,29 +6439,29 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfLoad(ValueType.OBJECT, 0),
-            new CfInstanceOf(options.itemFactory.createType("[Ljava/lang/Object;")),
+            new CfInstanceOf(factory.createType("[Ljava/lang/Object;")),
             new CfIf(If.Type.EQ, ValueType.INT, label38),
             label35,
             new CfLoad(ValueType.OBJECT, 1),
-            new CfInstanceOf(options.itemFactory.createType("[Ljava/lang/Object;")),
+            new CfInstanceOf(factory.createType("[Ljava/lang/Object;")),
             new CfIf(If.Type.EQ, ValueType.INT, label36),
             new CfLoad(ValueType.OBJECT, 0),
-            new CfCheckCast(options.itemFactory.createType("[Ljava/lang/Object;")),
+            new CfCheckCast(factory.createType("[Ljava/lang/Object;")),
             new CfLoad(ValueType.OBJECT, 1),
-            new CfCheckCast(options.itemFactory.createType("[Ljava/lang/Object;")),
+            new CfCheckCast(factory.createType("[Ljava/lang/Object;")),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Arrays;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.booleanType,
-                        options.itemFactory.createType("[Ljava/lang/Object;"),
-                        options.itemFactory.createType("[Ljava/lang/Object;")),
-                    options.itemFactory.createString("deepEquals")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Arrays;"),
+                    factory.createProto(
+                        factory.booleanType,
+                        factory.createType("[Ljava/lang/Object;"),
+                        factory.createType("[Ljava/lang/Object;")),
+                    factory.createString("deepEquals")),
                 false),
             new CfIf(If.Type.EQ, ValueType.INT, label36),
             new CfConstNumber(1, ValueType.INT),
@@ -6726,8 +6471,8 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfConstNumber(0, ValueType.INT),
             label37,
@@ -6735,8 +6480,8 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     }),
                 new ArrayDeque<>(Arrays.asList(FrameType.intType()))),
             new CfReturn(ValueType.INT),
@@ -6745,18 +6490,17 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfLoad(ValueType.OBJECT, 0),
             new CfLoad(ValueType.OBJECT, 1),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.objectType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.booleanType, options.itemFactory.objectType),
-                    options.itemFactory.createString("equals")),
+                factory.createMethod(
+                    factory.objectType,
+                    factory.createProto(factory.booleanType, factory.objectType),
+                    factory.createString("equals")),
                 false),
             new CfReturn(ValueType.INT),
             label39),
@@ -6764,7 +6508,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode ObjectsMethods_equals(InternalOptions options, DexMethod method) {
+  public static CfCode ObjectsMethods_equals(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -6785,11 +6529,10 @@
             new CfLoad(ValueType.OBJECT, 1),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.objectType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.booleanType, options.itemFactory.objectType),
-                    options.itemFactory.createString("equals")),
+                factory.createMethod(
+                    factory.objectType,
+                    factory.createProto(factory.booleanType, factory.objectType),
+                    factory.createString("equals")),
                 false),
             new CfIf(If.Type.EQ, ValueType.INT, label2),
             label1,
@@ -6797,8 +6540,8 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfConstNumber(1, ValueType.INT),
             new CfGoto(label3),
@@ -6807,8 +6550,8 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfConstNumber(0, ValueType.INT),
             label3,
@@ -6816,8 +6559,8 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     }),
                 new ArrayDeque<>(Arrays.asList(FrameType.intType()))),
             new CfReturn(ValueType.INT),
@@ -6826,7 +6569,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode ObjectsMethods_hashCode(InternalOptions options, DexMethod method) {
+  public static CfCode ObjectsMethods_hashCode(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -6845,24 +6588,20 @@
             new CfFrame(
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0},
-                    new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
-                    })),
+                    new FrameType[] {FrameType.initializedNonNullReference(factory.objectType)})),
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.objectType,
-                    options.itemFactory.createProto(options.itemFactory.intType),
-                    options.itemFactory.createString("hashCode")),
+                factory.createMethod(
+                    factory.objectType,
+                    factory.createProto(factory.intType),
+                    factory.createString("hashCode")),
                 false),
             label2,
             new CfFrame(
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0},
-                    new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
-                    }),
+                    new FrameType[] {FrameType.initializedNonNullReference(factory.objectType)}),
                 new ArrayDeque<>(Arrays.asList(FrameType.intType()))),
             new CfReturn(ValueType.INT),
             label3),
@@ -6870,7 +6609,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode ObjectsMethods_isNull(InternalOptions options, DexMethod method) {
+  public static CfCode ObjectsMethods_isNull(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -6889,17 +6628,13 @@
             new CfFrame(
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0},
-                    new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
-                    })),
+                    new FrameType[] {FrameType.initializedNonNullReference(factory.objectType)})),
             new CfConstNumber(0, ValueType.INT),
             label2,
             new CfFrame(
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0},
-                    new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
-                    }),
+                    new FrameType[] {FrameType.initializedNonNullReference(factory.objectType)}),
                 new ArrayDeque<>(Arrays.asList(FrameType.intType()))),
             new CfReturn(ValueType.INT),
             label3),
@@ -6907,7 +6642,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode ObjectsMethods_nonNull(InternalOptions options, DexMethod method) {
+  public static CfCode ObjectsMethods_nonNull(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -6926,17 +6661,13 @@
             new CfFrame(
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0},
-                    new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
-                    })),
+                    new FrameType[] {FrameType.initializedNonNullReference(factory.objectType)})),
             new CfConstNumber(0, ValueType.INT),
             label2,
             new CfFrame(
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0},
-                    new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
-                    }),
+                    new FrameType[] {FrameType.initializedNonNullReference(factory.objectType)}),
                 new ArrayDeque<>(Arrays.asList(FrameType.intType()))),
             new CfReturn(ValueType.INT),
             label3),
@@ -6944,8 +6675,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode ObjectsMethods_requireNonNullElse(
-      InternalOptions options, DexMethod method) {
+  public static CfCode ObjectsMethods_requireNonNullElse(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -6964,20 +6694,17 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfLoad(ValueType.OBJECT, 1),
-            new CfConstString(options.itemFactory.createString("defaultObj")),
+            new CfConstString(factory.createString("defaultObj")),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Objects;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.objectType,
-                        options.itemFactory.objectType,
-                        options.itemFactory.stringType),
-                    options.itemFactory.createString("requireNonNull")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Objects;"),
+                    factory.createProto(factory.objectType, factory.objectType, factory.stringType),
+                    factory.createString("requireNonNull")),
                 false),
             new CfReturn(ValueType.OBJECT),
             label2),
@@ -6986,7 +6713,7 @@
   }
 
   public static CfCode ObjectsMethods_requireNonNullElseGet(
-      InternalOptions options, DexMethod method) {
+      DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -7006,43 +6733,37 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/function/Supplier;"))
+                          factory.createType("Ljava/util/function/Supplier;"))
                     })),
             new CfLoad(ValueType.OBJECT, 1),
-            new CfConstString(options.itemFactory.createString("supplier")),
+            new CfConstString(factory.createString("supplier")),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Objects;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.objectType,
-                        options.itemFactory.objectType,
-                        options.itemFactory.stringType),
-                    options.itemFactory.createString("requireNonNull")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Objects;"),
+                    factory.createProto(factory.objectType, factory.objectType, factory.stringType),
+                    factory.createString("requireNonNull")),
                 false),
-            new CfCheckCast(options.itemFactory.createType("Ljava/util/function/Supplier;")),
+            new CfCheckCast(factory.createType("Ljava/util/function/Supplier;")),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/function/Supplier;"),
-                    options.itemFactory.createProto(options.itemFactory.objectType),
-                    options.itemFactory.createString("get")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/function/Supplier;"),
+                    factory.createProto(factory.objectType),
+                    factory.createString("get")),
                 true),
             new CfStore(ValueType.OBJECT, 2),
             label2,
             new CfLoad(ValueType.OBJECT, 2),
-            new CfConstString(options.itemFactory.createString("supplier.get()")),
+            new CfConstString(factory.createString("supplier.get()")),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Objects;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.objectType,
-                        options.itemFactory.objectType,
-                        options.itemFactory.stringType),
-                    options.itemFactory.createString("requireNonNull")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Objects;"),
+                    factory.createProto(factory.objectType, factory.objectType, factory.stringType),
+                    factory.createString("requireNonNull")),
                 false),
             new CfReturn(ValueType.OBJECT),
             label3),
@@ -7051,7 +6772,7 @@
   }
 
   public static CfCode ObjectsMethods_requireNonNullMessage(
-      InternalOptions options, DexMethod method) {
+      DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -7065,16 +6786,15 @@
             new CfLoad(ValueType.OBJECT, 0),
             new CfIf(If.Type.NE, ValueType.OBJECT, label2),
             label1,
-            new CfNew(options.itemFactory.createType("Ljava/lang/NullPointerException;")),
+            new CfNew(factory.createType("Ljava/lang/NullPointerException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfLoad(ValueType.OBJECT, 1),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/NullPointerException;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.stringType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/NullPointerException;"),
+                    factory.createProto(factory.voidType, factory.stringType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label2,
@@ -7082,8 +6802,8 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.stringType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.stringType)
                     })),
             new CfLoad(ValueType.OBJECT, 0),
             new CfReturn(ValueType.OBJECT),
@@ -7093,7 +6813,7 @@
   }
 
   public static CfCode ObjectsMethods_requireNonNullSupplier(
-      InternalOptions options, DexMethod method) {
+      DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -7115,21 +6835,21 @@
             new CfLoad(ValueType.OBJECT, 1),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/function/Supplier;"),
-                    options.itemFactory.createProto(options.itemFactory.objectType),
-                    options.itemFactory.createString("get")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/function/Supplier;"),
+                    factory.createProto(factory.objectType),
+                    factory.createString("get")),
                 true),
-            new CfCheckCast(options.itemFactory.stringType),
+            new CfCheckCast(factory.stringType),
             new CfGoto(label3),
             label2,
             new CfFrame(
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/function/Supplier;"))
+                          factory.createType("Ljava/util/function/Supplier;"))
                     })),
             new CfConstNull(),
             label3,
@@ -7137,25 +6857,23 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/function/Supplier;"))
+                          factory.createType("Ljava/util/function/Supplier;"))
                     }),
                 new ArrayDeque<>(
-                    Arrays.asList(
-                        FrameType.initializedNonNullReference(options.itemFactory.stringType)))),
+                    Arrays.asList(FrameType.initializedNonNullReference(factory.stringType)))),
             new CfStore(ValueType.OBJECT, 2),
             label4,
-            new CfNew(options.itemFactory.createType("Ljava/lang/NullPointerException;")),
+            new CfNew(factory.createType("Ljava/lang/NullPointerException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfLoad(ValueType.OBJECT, 2),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/NullPointerException;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.stringType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/NullPointerException;"),
+                    factory.createProto(factory.voidType, factory.stringType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label5,
@@ -7163,9 +6881,9 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/function/Supplier;"))
+                          factory.createType("Ljava/util/function/Supplier;"))
                     })),
             new CfLoad(ValueType.OBJECT, 0),
             new CfReturn(ValueType.OBJECT),
@@ -7174,7 +6892,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode ObjectsMethods_toString(InternalOptions options, DexMethod method) {
+  public static CfCode ObjectsMethods_toString(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     return new CfCode(
@@ -7184,16 +6902,13 @@
         ImmutableList.of(
             label0,
             new CfLoad(ValueType.OBJECT, 0),
-            new CfConstString(options.itemFactory.createString("null")),
+            new CfConstString(factory.createString("null")),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Objects;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringType,
-                        options.itemFactory.objectType,
-                        options.itemFactory.stringType),
-                    options.itemFactory.createString("toString")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Objects;"),
+                    factory.createProto(factory.stringType, factory.objectType, factory.stringType),
+                    factory.createString("toString")),
                 false),
             new CfReturn(ValueType.OBJECT),
             label1),
@@ -7201,7 +6916,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode ObjectsMethods_toStringDefault(InternalOptions options, DexMethod method) {
+  public static CfCode ObjectsMethods_toStringDefault(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -7221,35 +6936,34 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.stringType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.stringType)
                     })),
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.objectType,
-                    options.itemFactory.createProto(options.itemFactory.stringType),
-                    options.itemFactory.createString("toString")),
+                factory.createMethod(
+                    factory.objectType,
+                    factory.createProto(factory.stringType),
+                    factory.createString("toString")),
                 false),
             label2,
             new CfFrame(
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.stringType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.stringType)
                     }),
                 new ArrayDeque<>(
-                    Arrays.asList(
-                        FrameType.initializedNonNullReference(options.itemFactory.stringType)))),
+                    Arrays.asList(FrameType.initializedNonNullReference(factory.stringType)))),
             new CfReturn(ValueType.OBJECT),
             label3),
         ImmutableList.of(),
         ImmutableList.of());
   }
 
-  public static CfCode OptionalMethods_ifPresentOrElse(InternalOptions options, DexMethod method) {
+  public static CfCode OptionalMethods_ifPresentOrElse(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -7264,10 +6978,10 @@
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Optional;"),
-                    options.itemFactory.createProto(options.itemFactory.booleanType),
-                    options.itemFactory.createString("isPresent")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Optional;"),
+                    factory.createProto(factory.booleanType),
+                    factory.createString("isPresent")),
                 false),
             new CfIf(If.Type.EQ, ValueType.INT, label2),
             label1,
@@ -7275,18 +6989,17 @@
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Optional;"),
-                    options.itemFactory.createProto(options.itemFactory.objectType),
-                    options.itemFactory.createString("get")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Optional;"),
+                    factory.createProto(factory.objectType),
+                    factory.createString("get")),
                 false),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/function/Consumer;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.objectType),
-                    options.itemFactory.createString("accept")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/function/Consumer;"),
+                    factory.createProto(factory.voidType, factory.objectType),
+                    factory.createString("accept")),
                 true),
             new CfGoto(label3),
             label2,
@@ -7295,19 +7008,19 @@
                     new int[] {0, 1, 2},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/Optional;")),
+                          factory.createType("Ljava/util/Optional;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/function/Consumer;")),
+                          factory.createType("Ljava/util/function/Consumer;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/lang/Runnable;"))
+                          factory.createType("Ljava/lang/Runnable;"))
                     })),
             new CfLoad(ValueType.OBJECT, 2),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Runnable;"),
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("run")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Runnable;"),
+                    factory.createProto(factory.voidType),
+                    factory.createString("run")),
                 true),
             label3,
             new CfFrame(
@@ -7315,11 +7028,11 @@
                     new int[] {0, 1, 2},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/Optional;")),
+                          factory.createType("Ljava/util/Optional;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/function/Consumer;")),
+                          factory.createType("Ljava/util/function/Consumer;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/lang/Runnable;"))
+                          factory.createType("Ljava/lang/Runnable;"))
                     })),
             new CfReturnVoid(),
             label4),
@@ -7328,7 +7041,7 @@
   }
 
   public static CfCode OptionalMethods_ifPresentOrElseDouble(
-      InternalOptions options, DexMethod method) {
+      DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -7343,10 +7056,10 @@
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/OptionalDouble;"),
-                    options.itemFactory.createProto(options.itemFactory.booleanType),
-                    options.itemFactory.createString("isPresent")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/OptionalDouble;"),
+                    factory.createProto(factory.booleanType),
+                    factory.createString("isPresent")),
                 false),
             new CfIf(If.Type.EQ, ValueType.INT, label2),
             label1,
@@ -7354,18 +7067,17 @@
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/OptionalDouble;"),
-                    options.itemFactory.createProto(options.itemFactory.doubleType),
-                    options.itemFactory.createString("getAsDouble")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/OptionalDouble;"),
+                    factory.createProto(factory.doubleType),
+                    factory.createString("getAsDouble")),
                 false),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/function/DoubleConsumer;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.doubleType),
-                    options.itemFactory.createString("accept")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/function/DoubleConsumer;"),
+                    factory.createProto(factory.voidType, factory.doubleType),
+                    factory.createString("accept")),
                 true),
             new CfGoto(label3),
             label2,
@@ -7374,19 +7086,19 @@
                     new int[] {0, 1, 2},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/OptionalDouble;")),
+                          factory.createType("Ljava/util/OptionalDouble;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/function/DoubleConsumer;")),
+                          factory.createType("Ljava/util/function/DoubleConsumer;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/lang/Runnable;"))
+                          factory.createType("Ljava/lang/Runnable;"))
                     })),
             new CfLoad(ValueType.OBJECT, 2),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Runnable;"),
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("run")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Runnable;"),
+                    factory.createProto(factory.voidType),
+                    factory.createString("run")),
                 true),
             label3,
             new CfFrame(
@@ -7394,11 +7106,11 @@
                     new int[] {0, 1, 2},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/OptionalDouble;")),
+                          factory.createType("Ljava/util/OptionalDouble;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/function/DoubleConsumer;")),
+                          factory.createType("Ljava/util/function/DoubleConsumer;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/lang/Runnable;"))
+                          factory.createType("Ljava/lang/Runnable;"))
                     })),
             new CfReturnVoid(),
             label4),
@@ -7407,7 +7119,7 @@
   }
 
   public static CfCode OptionalMethods_ifPresentOrElseInt(
-      InternalOptions options, DexMethod method) {
+      DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -7422,10 +7134,10 @@
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/OptionalInt;"),
-                    options.itemFactory.createProto(options.itemFactory.booleanType),
-                    options.itemFactory.createString("isPresent")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/OptionalInt;"),
+                    factory.createProto(factory.booleanType),
+                    factory.createString("isPresent")),
                 false),
             new CfIf(If.Type.EQ, ValueType.INT, label2),
             label1,
@@ -7433,18 +7145,17 @@
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/OptionalInt;"),
-                    options.itemFactory.createProto(options.itemFactory.intType),
-                    options.itemFactory.createString("getAsInt")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/OptionalInt;"),
+                    factory.createProto(factory.intType),
+                    factory.createString("getAsInt")),
                 false),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/function/IntConsumer;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.intType),
-                    options.itemFactory.createString("accept")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/function/IntConsumer;"),
+                    factory.createProto(factory.voidType, factory.intType),
+                    factory.createString("accept")),
                 true),
             new CfGoto(label3),
             label2,
@@ -7453,19 +7164,19 @@
                     new int[] {0, 1, 2},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/OptionalInt;")),
+                          factory.createType("Ljava/util/OptionalInt;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/function/IntConsumer;")),
+                          factory.createType("Ljava/util/function/IntConsumer;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/lang/Runnable;"))
+                          factory.createType("Ljava/lang/Runnable;"))
                     })),
             new CfLoad(ValueType.OBJECT, 2),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Runnable;"),
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("run")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Runnable;"),
+                    factory.createProto(factory.voidType),
+                    factory.createString("run")),
                 true),
             label3,
             new CfFrame(
@@ -7473,11 +7184,11 @@
                     new int[] {0, 1, 2},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/OptionalInt;")),
+                          factory.createType("Ljava/util/OptionalInt;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/function/IntConsumer;")),
+                          factory.createType("Ljava/util/function/IntConsumer;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/lang/Runnable;"))
+                          factory.createType("Ljava/lang/Runnable;"))
                     })),
             new CfReturnVoid(),
             label4),
@@ -7486,7 +7197,7 @@
   }
 
   public static CfCode OptionalMethods_ifPresentOrElseLong(
-      InternalOptions options, DexMethod method) {
+      DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -7501,10 +7212,10 @@
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/OptionalLong;"),
-                    options.itemFactory.createProto(options.itemFactory.booleanType),
-                    options.itemFactory.createString("isPresent")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/OptionalLong;"),
+                    factory.createProto(factory.booleanType),
+                    factory.createString("isPresent")),
                 false),
             new CfIf(If.Type.EQ, ValueType.INT, label2),
             label1,
@@ -7512,18 +7223,17 @@
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/OptionalLong;"),
-                    options.itemFactory.createProto(options.itemFactory.longType),
-                    options.itemFactory.createString("getAsLong")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/OptionalLong;"),
+                    factory.createProto(factory.longType),
+                    factory.createString("getAsLong")),
                 false),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/function/LongConsumer;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.longType),
-                    options.itemFactory.createString("accept")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/function/LongConsumer;"),
+                    factory.createProto(factory.voidType, factory.longType),
+                    factory.createString("accept")),
                 true),
             new CfGoto(label3),
             label2,
@@ -7532,19 +7242,19 @@
                     new int[] {0, 1, 2},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/OptionalLong;")),
+                          factory.createType("Ljava/util/OptionalLong;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/function/LongConsumer;")),
+                          factory.createType("Ljava/util/function/LongConsumer;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/lang/Runnable;"))
+                          factory.createType("Ljava/lang/Runnable;"))
                     })),
             new CfLoad(ValueType.OBJECT, 2),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Runnable;"),
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("run")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Runnable;"),
+                    factory.createProto(factory.voidType),
+                    factory.createString("run")),
                 true),
             label3,
             new CfFrame(
@@ -7552,11 +7262,11 @@
                     new int[] {0, 1, 2},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/OptionalLong;")),
+                          factory.createType("Ljava/util/OptionalLong;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/function/LongConsumer;")),
+                          factory.createType("Ljava/util/function/LongConsumer;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/lang/Runnable;"))
+                          factory.createType("Ljava/lang/Runnable;"))
                     })),
             new CfReturnVoid(),
             label4),
@@ -7564,7 +7274,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode OptionalMethods_isEmpty(InternalOptions options, DexMethod method) {
+  public static CfCode OptionalMethods_isEmpty(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -7578,10 +7288,10 @@
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Optional;"),
-                    options.itemFactory.createProto(options.itemFactory.booleanType),
-                    options.itemFactory.createString("isPresent")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Optional;"),
+                    factory.createProto(factory.booleanType),
+                    factory.createString("isPresent")),
                 false),
             new CfIf(If.Type.NE, ValueType.INT, label1),
             new CfConstNumber(1, ValueType.INT),
@@ -7592,7 +7302,7 @@
                     new int[] {0},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/Optional;"))
+                          factory.createType("Ljava/util/Optional;"))
                     })),
             new CfConstNumber(0, ValueType.INT),
             label2,
@@ -7601,7 +7311,7 @@
                     new int[] {0},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/Optional;"))
+                          factory.createType("Ljava/util/Optional;"))
                     }),
                 new ArrayDeque<>(Arrays.asList(FrameType.intType()))),
             new CfReturn(ValueType.INT),
@@ -7610,7 +7320,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode OptionalMethods_isEmptyDouble(InternalOptions options, DexMethod method) {
+  public static CfCode OptionalMethods_isEmptyDouble(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -7624,10 +7334,10 @@
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/OptionalDouble;"),
-                    options.itemFactory.createProto(options.itemFactory.booleanType),
-                    options.itemFactory.createString("isPresent")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/OptionalDouble;"),
+                    factory.createProto(factory.booleanType),
+                    factory.createString("isPresent")),
                 false),
             new CfIf(If.Type.NE, ValueType.INT, label1),
             new CfConstNumber(1, ValueType.INT),
@@ -7638,7 +7348,7 @@
                     new int[] {0},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/OptionalDouble;"))
+                          factory.createType("Ljava/util/OptionalDouble;"))
                     })),
             new CfConstNumber(0, ValueType.INT),
             label2,
@@ -7647,7 +7357,7 @@
                     new int[] {0},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/OptionalDouble;"))
+                          factory.createType("Ljava/util/OptionalDouble;"))
                     }),
                 new ArrayDeque<>(Arrays.asList(FrameType.intType()))),
             new CfReturn(ValueType.INT),
@@ -7656,7 +7366,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode OptionalMethods_isEmptyInt(InternalOptions options, DexMethod method) {
+  public static CfCode OptionalMethods_isEmptyInt(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -7670,10 +7380,10 @@
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/OptionalInt;"),
-                    options.itemFactory.createProto(options.itemFactory.booleanType),
-                    options.itemFactory.createString("isPresent")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/OptionalInt;"),
+                    factory.createProto(factory.booleanType),
+                    factory.createString("isPresent")),
                 false),
             new CfIf(If.Type.NE, ValueType.INT, label1),
             new CfConstNumber(1, ValueType.INT),
@@ -7684,7 +7394,7 @@
                     new int[] {0},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/OptionalInt;"))
+                          factory.createType("Ljava/util/OptionalInt;"))
                     })),
             new CfConstNumber(0, ValueType.INT),
             label2,
@@ -7693,7 +7403,7 @@
                     new int[] {0},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/OptionalInt;"))
+                          factory.createType("Ljava/util/OptionalInt;"))
                     }),
                 new ArrayDeque<>(Arrays.asList(FrameType.intType()))),
             new CfReturn(ValueType.INT),
@@ -7702,7 +7412,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode OptionalMethods_isEmptyLong(InternalOptions options, DexMethod method) {
+  public static CfCode OptionalMethods_isEmptyLong(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -7716,10 +7426,10 @@
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/OptionalLong;"),
-                    options.itemFactory.createProto(options.itemFactory.booleanType),
-                    options.itemFactory.createString("isPresent")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/OptionalLong;"),
+                    factory.createProto(factory.booleanType),
+                    factory.createString("isPresent")),
                 false),
             new CfIf(If.Type.NE, ValueType.INT, label1),
             new CfConstNumber(1, ValueType.INT),
@@ -7730,7 +7440,7 @@
                     new int[] {0},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/OptionalLong;"))
+                          factory.createType("Ljava/util/OptionalLong;"))
                     })),
             new CfConstNumber(0, ValueType.INT),
             label2,
@@ -7739,7 +7449,7 @@
                     new int[] {0},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/OptionalLong;"))
+                          factory.createType("Ljava/util/OptionalLong;"))
                     }),
                 new ArrayDeque<>(Arrays.asList(FrameType.intType()))),
             new CfReturn(ValueType.INT),
@@ -7748,7 +7458,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode OptionalMethods_or(InternalOptions options, DexMethod method) {
+  public static CfCode OptionalMethods_or(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -7764,21 +7474,20 @@
             new CfLoad(ValueType.OBJECT, 1),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Objects;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.objectType, options.itemFactory.objectType),
-                    options.itemFactory.createString("requireNonNull")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Objects;"),
+                    factory.createProto(factory.objectType, factory.objectType),
+                    factory.createString("requireNonNull")),
                 false),
             new CfStackInstruction(CfStackInstruction.Opcode.Pop),
             label1,
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Optional;"),
-                    options.itemFactory.createProto(options.itemFactory.booleanType),
-                    options.itemFactory.createString("isPresent")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Optional;"),
+                    factory.createProto(factory.booleanType),
+                    factory.createString("isPresent")),
                 false),
             new CfIf(If.Type.EQ, ValueType.INT, label3),
             label2,
@@ -7790,38 +7499,37 @@
                     new int[] {0, 1},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/Optional;")),
+                          factory.createType("Ljava/util/Optional;")),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/function/Supplier;"))
+                          factory.createType("Ljava/util/function/Supplier;"))
                     })),
             new CfLoad(ValueType.OBJECT, 1),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/function/Supplier;"),
-                    options.itemFactory.createProto(options.itemFactory.objectType),
-                    options.itemFactory.createString("get")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/function/Supplier;"),
+                    factory.createProto(factory.objectType),
+                    factory.createString("get")),
                 true),
-            new CfCheckCast(options.itemFactory.createType("Ljava/util/Optional;")),
+            new CfCheckCast(factory.createType("Ljava/util/Optional;")),
             new CfStore(ValueType.OBJECT, 2),
             label4,
             new CfLoad(ValueType.OBJECT, 2),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Objects;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.objectType, options.itemFactory.objectType),
-                    options.itemFactory.createString("requireNonNull")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Objects;"),
+                    factory.createProto(factory.objectType, factory.objectType),
+                    factory.createString("requireNonNull")),
                 false),
-            new CfCheckCast(options.itemFactory.createType("Ljava/util/Optional;")),
+            new CfCheckCast(factory.createType("Ljava/util/Optional;")),
             new CfReturn(ValueType.OBJECT),
             label5),
         ImmutableList.of(),
         ImmutableList.of());
   }
 
-  public static CfCode OptionalMethods_stream(InternalOptions options, DexMethod method) {
+  public static CfCode OptionalMethods_stream(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -7835,29 +7543,28 @@
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Optional;"),
-                    options.itemFactory.createProto(options.itemFactory.booleanType),
-                    options.itemFactory.createString("isPresent")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Optional;"),
+                    factory.createProto(factory.booleanType),
+                    factory.createString("isPresent")),
                 false),
             new CfIf(If.Type.EQ, ValueType.INT, label2),
             label1,
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Optional;"),
-                    options.itemFactory.createProto(options.itemFactory.objectType),
-                    options.itemFactory.createString("get")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Optional;"),
+                    factory.createProto(factory.objectType),
+                    factory.createString("get")),
                 false),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/stream/Stream;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/util/stream/Stream;"),
-                        options.itemFactory.objectType),
-                    options.itemFactory.createString("of")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/stream/Stream;"),
+                    factory.createProto(
+                        factory.createType("Ljava/util/stream/Stream;"), factory.objectType),
+                    factory.createString("of")),
                 true),
             new CfReturn(ValueType.OBJECT),
             label2,
@@ -7866,15 +7573,14 @@
                     new int[] {0},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/Optional;"))
+                          factory.createType("Ljava/util/Optional;"))
                     })),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/stream/Stream;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/util/stream/Stream;")),
-                    options.itemFactory.createString("empty")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/stream/Stream;"),
+                    factory.createProto(factory.createType("Ljava/util/stream/Stream;")),
+                    factory.createString("empty")),
                 true),
             new CfReturn(ValueType.OBJECT),
             label3),
@@ -7882,7 +7588,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode OptionalMethods_streamDouble(InternalOptions options, DexMethod method) {
+  public static CfCode OptionalMethods_streamDouble(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -7896,29 +7602,28 @@
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/OptionalDouble;"),
-                    options.itemFactory.createProto(options.itemFactory.booleanType),
-                    options.itemFactory.createString("isPresent")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/OptionalDouble;"),
+                    factory.createProto(factory.booleanType),
+                    factory.createString("isPresent")),
                 false),
             new CfIf(If.Type.EQ, ValueType.INT, label2),
             label1,
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/OptionalDouble;"),
-                    options.itemFactory.createProto(options.itemFactory.doubleType),
-                    options.itemFactory.createString("getAsDouble")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/OptionalDouble;"),
+                    factory.createProto(factory.doubleType),
+                    factory.createString("getAsDouble")),
                 false),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/stream/DoubleStream;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/util/stream/DoubleStream;"),
-                        options.itemFactory.doubleType),
-                    options.itemFactory.createString("of")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/stream/DoubleStream;"),
+                    factory.createProto(
+                        factory.createType("Ljava/util/stream/DoubleStream;"), factory.doubleType),
+                    factory.createString("of")),
                 true),
             new CfReturn(ValueType.OBJECT),
             label2,
@@ -7927,15 +7632,14 @@
                     new int[] {0},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/OptionalDouble;"))
+                          factory.createType("Ljava/util/OptionalDouble;"))
                     })),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/stream/DoubleStream;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/util/stream/DoubleStream;")),
-                    options.itemFactory.createString("empty")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/stream/DoubleStream;"),
+                    factory.createProto(factory.createType("Ljava/util/stream/DoubleStream;")),
+                    factory.createString("empty")),
                 true),
             new CfReturn(ValueType.OBJECT),
             label3),
@@ -7943,7 +7647,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode OptionalMethods_streamInt(InternalOptions options, DexMethod method) {
+  public static CfCode OptionalMethods_streamInt(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -7957,29 +7661,28 @@
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/OptionalInt;"),
-                    options.itemFactory.createProto(options.itemFactory.booleanType),
-                    options.itemFactory.createString("isPresent")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/OptionalInt;"),
+                    factory.createProto(factory.booleanType),
+                    factory.createString("isPresent")),
                 false),
             new CfIf(If.Type.EQ, ValueType.INT, label2),
             label1,
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/OptionalInt;"),
-                    options.itemFactory.createProto(options.itemFactory.intType),
-                    options.itemFactory.createString("getAsInt")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/OptionalInt;"),
+                    factory.createProto(factory.intType),
+                    factory.createString("getAsInt")),
                 false),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/stream/IntStream;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/util/stream/IntStream;"),
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("of")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/stream/IntStream;"),
+                    factory.createProto(
+                        factory.createType("Ljava/util/stream/IntStream;"), factory.intType),
+                    factory.createString("of")),
                 true),
             new CfReturn(ValueType.OBJECT),
             label2,
@@ -7988,15 +7691,14 @@
                     new int[] {0},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/OptionalInt;"))
+                          factory.createType("Ljava/util/OptionalInt;"))
                     })),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/stream/IntStream;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/util/stream/IntStream;")),
-                    options.itemFactory.createString("empty")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/stream/IntStream;"),
+                    factory.createProto(factory.createType("Ljava/util/stream/IntStream;")),
+                    factory.createString("empty")),
                 true),
             new CfReturn(ValueType.OBJECT),
             label3),
@@ -8004,7 +7706,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode OptionalMethods_streamLong(InternalOptions options, DexMethod method) {
+  public static CfCode OptionalMethods_streamLong(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -8018,29 +7720,28 @@
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/OptionalLong;"),
-                    options.itemFactory.createProto(options.itemFactory.booleanType),
-                    options.itemFactory.createString("isPresent")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/OptionalLong;"),
+                    factory.createProto(factory.booleanType),
+                    factory.createString("isPresent")),
                 false),
             new CfIf(If.Type.EQ, ValueType.INT, label2),
             label1,
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/OptionalLong;"),
-                    options.itemFactory.createProto(options.itemFactory.longType),
-                    options.itemFactory.createString("getAsLong")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/OptionalLong;"),
+                    factory.createProto(factory.longType),
+                    factory.createString("getAsLong")),
                 false),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/stream/LongStream;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/util/stream/LongStream;"),
-                        options.itemFactory.longType),
-                    options.itemFactory.createString("of")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/stream/LongStream;"),
+                    factory.createProto(
+                        factory.createType("Ljava/util/stream/LongStream;"), factory.longType),
+                    factory.createString("of")),
                 true),
             new CfReturn(ValueType.OBJECT),
             label2,
@@ -8049,15 +7750,14 @@
                     new int[] {0},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/OptionalLong;"))
+                          factory.createType("Ljava/util/OptionalLong;"))
                     })),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/stream/LongStream;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/util/stream/LongStream;")),
-                    options.itemFactory.createString("empty")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/stream/LongStream;"),
+                    factory.createProto(factory.createType("Ljava/util/stream/LongStream;")),
+                    factory.createString("empty")),
                 true),
             new CfReturn(ValueType.OBJECT),
             label3),
@@ -8065,7 +7765,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode PredicateMethods_not(InternalOptions options, DexMethod method) {
+  public static CfCode PredicateMethods_not(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     return new CfCode(
@@ -8077,11 +7777,10 @@
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/function/Predicate;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/util/function/Predicate;")),
-                    options.itemFactory.createString("negate")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/function/Predicate;"),
+                    factory.createProto(factory.createType("Ljava/util/function/Predicate;")),
+                    factory.createString("negate")),
                 true),
             new CfReturn(ValueType.OBJECT),
             label1),
@@ -8089,7 +7788,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode ShortMethods_compare(InternalOptions options, DexMethod method) {
+  public static CfCode ShortMethods_compare(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     return new CfCode(
@@ -8107,7 +7806,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode ShortMethods_compareUnsigned(InternalOptions options, DexMethod method) {
+  public static CfCode ShortMethods_compareUnsigned(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     return new CfCode(
@@ -8129,7 +7828,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode ShortMethods_toUnsignedInt(InternalOptions options, DexMethod method) {
+  public static CfCode ShortMethods_toUnsignedInt(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     return new CfCode(
@@ -8147,7 +7846,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode ShortMethods_toUnsignedLong(InternalOptions options, DexMethod method) {
+  public static CfCode ShortMethods_toUnsignedLong(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     return new CfCode(
@@ -8166,7 +7865,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode StreamMethods_ofNullable(InternalOptions options, DexMethod method) {
+  public static CfCode StreamMethods_ofNullable(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -8181,48 +7880,42 @@
             new CfIf(If.Type.NE, ValueType.OBJECT, label1),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/stream/Stream;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/util/stream/Stream;")),
-                    options.itemFactory.createString("empty")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/stream/Stream;"),
+                    factory.createProto(factory.createType("Ljava/util/stream/Stream;")),
+                    factory.createString("empty")),
                 true),
             new CfGoto(label2),
             label1,
             new CfFrame(
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0},
-                    new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
-                    })),
+                    new FrameType[] {FrameType.initializedNonNullReference(factory.objectType)})),
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/stream/Stream;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/util/stream/Stream;"),
-                        options.itemFactory.objectType),
-                    options.itemFactory.createString("of")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/stream/Stream;"),
+                    factory.createProto(
+                        factory.createType("Ljava/util/stream/Stream;"), factory.objectType),
+                    factory.createString("of")),
                 true),
             label2,
             new CfFrame(
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0},
-                    new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
-                    }),
+                    new FrameType[] {FrameType.initializedNonNullReference(factory.objectType)}),
                 new ArrayDeque<>(
                     Arrays.asList(
                         FrameType.initializedNonNullReference(
-                            options.itemFactory.createType("Ljava/util/stream/Stream;"))))),
+                            factory.createType("Ljava/util/stream/Stream;"))))),
             new CfReturn(ValueType.OBJECT),
             label3),
         ImmutableList.of(),
         ImmutableList.of());
   }
 
-  public static CfCode StringMethods_isBlank(InternalOptions options, DexMethod method) {
+  public static CfCode StringMethods_isBlank(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -8245,10 +7938,10 @@
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringType,
-                    options.itemFactory.createProto(options.itemFactory.intType),
-                    options.itemFactory.createString("length")),
+                factory.createMethod(
+                    factory.stringType,
+                    factory.createProto(factory.intType),
+                    factory.createString("length")),
                 false),
             new CfStore(ValueType.INT, 2),
             label2,
@@ -8256,7 +7949,7 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.stringType),
+                      FrameType.initializedNonNullReference(factory.stringType),
                       FrameType.intType(),
                       FrameType.intType()
                     })),
@@ -8268,22 +7961,20 @@
             new CfLoad(ValueType.INT, 1),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.intType, options.itemFactory.intType),
-                    options.itemFactory.createString("codePointAt")),
+                factory.createMethod(
+                    factory.stringType,
+                    factory.createProto(factory.intType, factory.intType),
+                    factory.createString("codePointAt")),
                 false),
             new CfStore(ValueType.INT, 3),
             label4,
             new CfLoad(ValueType.INT, 3),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.boxedCharType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.booleanType, options.itemFactory.intType),
-                    options.itemFactory.createString("isWhitespace")),
+                factory.createMethod(
+                    factory.boxedCharType,
+                    factory.createProto(factory.booleanType, factory.intType),
+                    factory.createString("isWhitespace")),
                 false),
             new CfIf(If.Type.NE, ValueType.INT, label6),
             label5,
@@ -8294,7 +7985,7 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2, 3},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.stringType),
+                      FrameType.initializedNonNullReference(factory.stringType),
                       FrameType.intType(),
                       FrameType.intType(),
                       FrameType.intType()
@@ -8303,11 +7994,10 @@
             new CfLoad(ValueType.INT, 3),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.boxedCharType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.intType, options.itemFactory.intType),
-                    options.itemFactory.createString("charCount")),
+                factory.createMethod(
+                    factory.boxedCharType,
+                    factory.createProto(factory.intType, factory.intType),
+                    factory.createString("charCount")),
                 false),
             new CfArithmeticBinop(CfArithmeticBinop.Opcode.Add, NumericType.INT),
             new CfStore(ValueType.INT, 1),
@@ -8317,9 +8007,7 @@
             new CfFrame(
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0},
-                    new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.stringType)
-                    })),
+                    new FrameType[] {FrameType.initializedNonNullReference(factory.stringType)})),
             new CfConstNumber(1, ValueType.INT),
             new CfReturn(ValueType.INT),
             label9),
@@ -8327,7 +8015,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode StringMethods_joinArray(InternalOptions options, DexMethod method) {
+  public static CfCode StringMethods_joinArray(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -8347,16 +8035,15 @@
             label0,
             new CfLoad(ValueType.OBJECT, 0),
             new CfIf(If.Type.NE, ValueType.OBJECT, label1),
-            new CfNew(options.itemFactory.createType("Ljava/lang/NullPointerException;")),
+            new CfNew(factory.createType("Ljava/lang/NullPointerException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
-            new CfConstString(options.itemFactory.createString("delimiter")),
+            new CfConstString(factory.createString("delimiter")),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/NullPointerException;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.stringType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/NullPointerException;"),
+                    factory.createProto(factory.voidType, factory.stringType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label1,
@@ -8364,18 +8051,18 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.charSequenceType),
+                      FrameType.initializedNonNullReference(factory.charSequenceType),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("[Ljava/lang/CharSequence;"))
+                          factory.createType("[Ljava/lang/CharSequence;"))
                     })),
-            new CfNew(options.itemFactory.stringBuilderType),
+            new CfNew(factory.stringBuilderType),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
             new CfStore(ValueType.OBJECT, 2),
             label2,
@@ -8389,12 +8076,10 @@
             new CfArrayLoad(MemberType.OBJECT),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType,
-                        options.itemFactory.charSequenceType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.charSequenceType),
+                    factory.createString("append")),
                 false),
             new CfStackInstruction(CfStackInstruction.Opcode.Pop),
             label4,
@@ -8405,10 +8090,10 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2, 3},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.charSequenceType),
+                      FrameType.initializedNonNullReference(factory.charSequenceType),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("[Ljava/lang/CharSequence;")),
-                      FrameType.initializedNonNullReference(options.itemFactory.stringBuilderType),
+                          factory.createType("[Ljava/lang/CharSequence;")),
+                      FrameType.initializedNonNullReference(factory.stringBuilderType),
                       FrameType.intType()
                     })),
             new CfLoad(ValueType.INT, 3),
@@ -8420,12 +8105,10 @@
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType,
-                        options.itemFactory.charSequenceType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.charSequenceType),
+                    factory.createString("append")),
                 false),
             new CfStackInstruction(CfStackInstruction.Opcode.Pop),
             label7,
@@ -8435,12 +8118,10 @@
             new CfArrayLoad(MemberType.OBJECT),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType,
-                        options.itemFactory.charSequenceType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.charSequenceType),
+                    factory.createString("append")),
                 false),
             new CfStackInstruction(CfStackInstruction.Opcode.Pop),
             label8,
@@ -8451,18 +8132,18 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.charSequenceType),
+                      FrameType.initializedNonNullReference(factory.charSequenceType),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("[Ljava/lang/CharSequence;")),
-                      FrameType.initializedNonNullReference(options.itemFactory.stringBuilderType)
+                          factory.createType("[Ljava/lang/CharSequence;")),
+                      FrameType.initializedNonNullReference(factory.stringBuilderType)
                     })),
             new CfLoad(ValueType.OBJECT, 2),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(options.itemFactory.stringType),
-                    options.itemFactory.createString("toString")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringType),
+                    factory.createString("toString")),
                 false),
             new CfReturn(ValueType.OBJECT),
             label10),
@@ -8470,7 +8151,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode StringMethods_joinIterable(InternalOptions options, DexMethod method) {
+  public static CfCode StringMethods_joinIterable(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -8489,16 +8170,15 @@
             label0,
             new CfLoad(ValueType.OBJECT, 0),
             new CfIf(If.Type.NE, ValueType.OBJECT, label1),
-            new CfNew(options.itemFactory.createType("Ljava/lang/NullPointerException;")),
+            new CfNew(factory.createType("Ljava/lang/NullPointerException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
-            new CfConstString(options.itemFactory.createString("delimiter")),
+            new CfConstString(factory.createString("delimiter")),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/NullPointerException;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.stringType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/NullPointerException;"),
+                    factory.createProto(factory.voidType, factory.stringType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label1,
@@ -8506,39 +8186,38 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.charSequenceType),
+                      FrameType.initializedNonNullReference(factory.charSequenceType),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/lang/Iterable;"))
+                          factory.createType("Ljava/lang/Iterable;"))
                     })),
-            new CfNew(options.itemFactory.stringBuilderType),
+            new CfNew(factory.stringBuilderType),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
             new CfStore(ValueType.OBJECT, 2),
             label2,
             new CfLoad(ValueType.OBJECT, 1),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/Iterable;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/util/Iterator;")),
-                    options.itemFactory.createString("iterator")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/Iterable;"),
+                    factory.createProto(factory.createType("Ljava/util/Iterator;")),
+                    factory.createString("iterator")),
                 true),
             new CfStore(ValueType.OBJECT, 3),
             label3,
             new CfLoad(ValueType.OBJECT, 3),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Iterator;"),
-                    options.itemFactory.createProto(options.itemFactory.booleanType),
-                    options.itemFactory.createString("hasNext")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Iterator;"),
+                    factory.createProto(factory.booleanType),
+                    factory.createString("hasNext")),
                 true),
             new CfIf(If.Type.EQ, ValueType.INT, label8),
             label4,
@@ -8546,20 +8225,18 @@
             new CfLoad(ValueType.OBJECT, 3),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Iterator;"),
-                    options.itemFactory.createProto(options.itemFactory.objectType),
-                    options.itemFactory.createString("next")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Iterator;"),
+                    factory.createProto(factory.objectType),
+                    factory.createString("next")),
                 true),
-            new CfCheckCast(options.itemFactory.charSequenceType),
+            new CfCheckCast(factory.charSequenceType),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType,
-                        options.itemFactory.charSequenceType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.charSequenceType),
+                    factory.createString("append")),
                 false),
             new CfStackInstruction(CfStackInstruction.Opcode.Pop),
             label5,
@@ -8567,20 +8244,20 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2, 3},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.charSequenceType),
+                      FrameType.initializedNonNullReference(factory.charSequenceType),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/lang/Iterable;")),
-                      FrameType.initializedNonNullReference(options.itemFactory.stringBuilderType),
+                          factory.createType("Ljava/lang/Iterable;")),
+                      FrameType.initializedNonNullReference(factory.stringBuilderType),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/Iterator;"))
+                          factory.createType("Ljava/util/Iterator;"))
                     })),
             new CfLoad(ValueType.OBJECT, 3),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Iterator;"),
-                    options.itemFactory.createProto(options.itemFactory.booleanType),
-                    options.itemFactory.createString("hasNext")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Iterator;"),
+                    factory.createProto(factory.booleanType),
+                    factory.createString("hasNext")),
                 true),
             new CfIf(If.Type.EQ, ValueType.INT, label8),
             label6,
@@ -8588,12 +8265,10 @@
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType,
-                        options.itemFactory.charSequenceType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.charSequenceType),
+                    factory.createString("append")),
                 false),
             new CfStackInstruction(CfStackInstruction.Opcode.Pop),
             label7,
@@ -8601,20 +8276,18 @@
             new CfLoad(ValueType.OBJECT, 3),
             new CfInvoke(
                 185,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Iterator;"),
-                    options.itemFactory.createProto(options.itemFactory.objectType),
-                    options.itemFactory.createString("next")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Iterator;"),
+                    factory.createProto(factory.objectType),
+                    factory.createString("next")),
                 true),
-            new CfCheckCast(options.itemFactory.charSequenceType),
+            new CfCheckCast(factory.charSequenceType),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType,
-                        options.itemFactory.charSequenceType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.charSequenceType),
+                    factory.createString("append")),
                 false),
             new CfStackInstruction(CfStackInstruction.Opcode.Pop),
             new CfGoto(label5),
@@ -8623,20 +8296,20 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2, 3},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.charSequenceType),
+                      FrameType.initializedNonNullReference(factory.charSequenceType),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/lang/Iterable;")),
-                      FrameType.initializedNonNullReference(options.itemFactory.stringBuilderType),
+                          factory.createType("Ljava/lang/Iterable;")),
+                      FrameType.initializedNonNullReference(factory.stringBuilderType),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/util/Iterator;"))
+                          factory.createType("Ljava/util/Iterator;"))
                     })),
             new CfLoad(ValueType.OBJECT, 2),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(options.itemFactory.stringType),
-                    options.itemFactory.createString("toString")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringType),
+                    factory.createString("toString")),
                 false),
             new CfReturn(ValueType.OBJECT),
             label9),
@@ -8644,7 +8317,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode StringMethods_repeat(InternalOptions options, DexMethod method) {
+  public static CfCode StringMethods_repeat(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -8671,49 +8344,46 @@
             new CfLoad(ValueType.INT, 1),
             new CfIf(If.Type.GE, ValueType.INT, label2),
             label1,
-            new CfNew(options.itemFactory.createType("Ljava/lang/IllegalArgumentException;")),
+            new CfNew(factory.createType("Ljava/lang/IllegalArgumentException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
-            new CfNew(options.itemFactory.stringBuilderType),
+            new CfNew(factory.stringBuilderType),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
-            new CfConstString(options.itemFactory.createString("count is negative: ")),
+            new CfConstString(factory.createString("count is negative: ")),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.stringType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.stringType),
+                    factory.createString("append")),
                 false),
             new CfLoad(ValueType.INT, 1),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.intType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.intType),
+                    factory.createString("append")),
                 false),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(options.itemFactory.stringType),
-                    options.itemFactory.createString("toString")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringType),
+                    factory.createString("toString")),
                 false),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/IllegalArgumentException;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.stringType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/IllegalArgumentException;"),
+                    factory.createProto(factory.voidType, factory.stringType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label2,
@@ -8721,16 +8391,15 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.stringType),
-                      FrameType.intType()
+                      FrameType.initializedNonNullReference(factory.stringType), FrameType.intType()
                     })),
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringType,
-                    options.itemFactory.createProto(options.itemFactory.intType),
-                    options.itemFactory.createString("length")),
+                factory.createMethod(
+                    factory.stringType,
+                    factory.createProto(factory.intType),
+                    factory.createString("length")),
                 false),
             new CfStore(ValueType.INT, 2),
             label3,
@@ -8743,18 +8412,18 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.stringType),
+                      FrameType.initializedNonNullReference(factory.stringType),
                       FrameType.intType(),
                       FrameType.intType()
                     })),
-            new CfConstString(options.itemFactory.createString("")),
+            new CfConstString(factory.createString("")),
             new CfReturn(ValueType.OBJECT),
             label5,
             new CfFrame(
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.stringType),
+                      FrameType.initializedNonNullReference(factory.stringType),
                       FrameType.intType(),
                       FrameType.intType()
                     })),
@@ -8769,103 +8438,96 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.stringType),
+                      FrameType.initializedNonNullReference(factory.stringType),
                       FrameType.intType(),
                       FrameType.intType()
                     })),
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringType,
-                    options.itemFactory.createProto(options.itemFactory.intType),
-                    options.itemFactory.createString("length")),
+                factory.createMethod(
+                    factory.stringType,
+                    factory.createProto(factory.intType),
+                    factory.createString("length")),
                 false),
             new CfConstNumber(2147483647, ValueType.INT),
             new CfLoad(ValueType.INT, 1),
             new CfArithmeticBinop(CfArithmeticBinop.Opcode.Div, NumericType.INT),
             new CfIfCmp(If.Type.LE, ValueType.INT, label10),
             label8,
-            new CfNew(options.itemFactory.createType("Ljava/lang/OutOfMemoryError;")),
+            new CfNew(factory.createType("Ljava/lang/OutOfMemoryError;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
-            new CfNew(options.itemFactory.stringBuilderType),
+            new CfNew(factory.stringBuilderType),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
-            new CfConstString(options.itemFactory.createString("Repeating ")),
+            new CfConstString(factory.createString("Repeating ")),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.stringType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.stringType),
+                    factory.createString("append")),
                 false),
             new CfLoad(ValueType.OBJECT, 0),
             label9,
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringType,
-                    options.itemFactory.createProto(options.itemFactory.intType),
-                    options.itemFactory.createString("length")),
+                factory.createMethod(
+                    factory.stringType,
+                    factory.createProto(factory.intType),
+                    factory.createString("length")),
                 false),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.intType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.intType),
+                    factory.createString("append")),
                 false),
-            new CfConstString(options.itemFactory.createString(" bytes String ")),
+            new CfConstString(factory.createString(" bytes String ")),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.stringType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.stringType),
+                    factory.createString("append")),
                 false),
             new CfLoad(ValueType.INT, 1),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.intType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.intType),
+                    factory.createString("append")),
                 false),
             new CfConstString(
-                options.itemFactory.createString(
-                    " times will produce a String exceeding maximum size.")),
+                factory.createString(" times will produce a String exceeding maximum size.")),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.stringType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.stringType),
+                    factory.createString("append")),
                 false),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(options.itemFactory.stringType),
-                    options.itemFactory.createString("toString")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringType),
+                    factory.createString("toString")),
                 false),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/OutOfMemoryError;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.stringType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/OutOfMemoryError;"),
+                    factory.createProto(factory.voidType, factory.stringType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label10,
@@ -8873,22 +8535,21 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.stringType),
+                      FrameType.initializedNonNullReference(factory.stringType),
                       FrameType.intType(),
                       FrameType.intType()
                     })),
-            new CfNew(options.itemFactory.stringBuilderType),
+            new CfNew(factory.stringBuilderType),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfLoad(ValueType.INT, 2),
             new CfLoad(ValueType.INT, 1),
             new CfArithmeticBinop(CfArithmeticBinop.Opcode.Mul, NumericType.INT),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.intType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.voidType, factory.intType),
+                    factory.createString("<init>")),
                 false),
             new CfStore(ValueType.OBJECT, 3),
             label11,
@@ -8899,10 +8560,10 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2, 3, 4},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.stringType),
+                      FrameType.initializedNonNullReference(factory.stringType),
                       FrameType.intType(),
                       FrameType.intType(),
-                      FrameType.initializedNonNullReference(options.itemFactory.stringBuilderType),
+                      FrameType.initializedNonNullReference(factory.stringBuilderType),
                       FrameType.intType()
                     })),
             new CfLoad(ValueType.INT, 4),
@@ -8913,11 +8574,10 @@
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.stringType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.stringType),
+                    factory.createString("append")),
                 false),
             new CfStackInstruction(CfStackInstruction.Opcode.Pop),
             label14,
@@ -8928,18 +8588,18 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2, 3},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.stringType),
+                      FrameType.initializedNonNullReference(factory.stringType),
                       FrameType.intType(),
                       FrameType.intType(),
-                      FrameType.initializedNonNullReference(options.itemFactory.stringBuilderType)
+                      FrameType.initializedNonNullReference(factory.stringBuilderType)
                     })),
             new CfLoad(ValueType.OBJECT, 3),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(options.itemFactory.stringType),
-                    options.itemFactory.createString("toString")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringType),
+                    factory.createString("toString")),
                 false),
             new CfReturn(ValueType.OBJECT),
             label16),
@@ -8947,7 +8607,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode StringMethods_strip(InternalOptions options, DexMethod method) {
+  public static CfCode StringMethods_strip(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -8976,10 +8636,10 @@
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringType,
-                    options.itemFactory.createProto(options.itemFactory.intType),
-                    options.itemFactory.createString("length")),
+                factory.createMethod(
+                    factory.stringType,
+                    factory.createProto(factory.intType),
+                    factory.createString("length")),
                 false),
             new CfStore(ValueType.INT, 2),
             label2,
@@ -8987,7 +8647,7 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.stringType),
+                      FrameType.initializedNonNullReference(factory.stringType),
                       FrameType.intType(),
                       FrameType.intType()
                     })),
@@ -8999,22 +8659,20 @@
             new CfLoad(ValueType.INT, 1),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.intType, options.itemFactory.intType),
-                    options.itemFactory.createString("codePointAt")),
+                factory.createMethod(
+                    factory.stringType,
+                    factory.createProto(factory.intType, factory.intType),
+                    factory.createString("codePointAt")),
                 false),
             new CfStore(ValueType.INT, 3),
             label4,
             new CfLoad(ValueType.INT, 3),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.boxedCharType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.booleanType, options.itemFactory.intType),
-                    options.itemFactory.createString("isWhitespace")),
+                factory.createMethod(
+                    factory.boxedCharType,
+                    factory.createProto(factory.booleanType, factory.intType),
+                    factory.createString("isWhitespace")),
                 false),
             new CfIf(If.Type.NE, ValueType.INT, label6),
             label5,
@@ -9024,7 +8682,7 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2, 3},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.stringType),
+                      FrameType.initializedNonNullReference(factory.stringType),
                       FrameType.intType(),
                       FrameType.intType(),
                       FrameType.intType()
@@ -9033,11 +8691,10 @@
             new CfLoad(ValueType.INT, 3),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.boxedCharType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.intType, options.itemFactory.intType),
-                    options.itemFactory.createString("charCount")),
+                factory.createMethod(
+                    factory.boxedCharType,
+                    factory.createProto(factory.intType, factory.intType),
+                    factory.createString("charCount")),
                 false),
             new CfArithmeticBinop(CfArithmeticBinop.Opcode.Add, NumericType.INT),
             new CfStore(ValueType.INT, 1),
@@ -9048,7 +8705,7 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.stringType),
+                      FrameType.initializedNonNullReference(factory.stringType),
                       FrameType.intType(),
                       FrameType.intType()
                     })),
@@ -9060,24 +8717,20 @@
             new CfLoad(ValueType.INT, 2),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.boxedCharType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.intType,
-                        options.itemFactory.charSequenceType,
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("codePointBefore")),
+                factory.createMethod(
+                    factory.boxedCharType,
+                    factory.createProto(factory.intType, factory.charSequenceType, factory.intType),
+                    factory.createString("codePointBefore")),
                 false),
             new CfStore(ValueType.INT, 3),
             label10,
             new CfLoad(ValueType.INT, 3),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.boxedCharType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.booleanType, options.itemFactory.intType),
-                    options.itemFactory.createString("isWhitespace")),
+                factory.createMethod(
+                    factory.boxedCharType,
+                    factory.createProto(factory.booleanType, factory.intType),
+                    factory.createString("isWhitespace")),
                 false),
             new CfIf(If.Type.NE, ValueType.INT, label12),
             label11,
@@ -9087,7 +8740,7 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2, 3},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.stringType),
+                      FrameType.initializedNonNullReference(factory.stringType),
                       FrameType.intType(),
                       FrameType.intType(),
                       FrameType.intType()
@@ -9096,11 +8749,10 @@
             new CfLoad(ValueType.INT, 3),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.boxedCharType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.intType, options.itemFactory.intType),
-                    options.itemFactory.createString("charCount")),
+                factory.createMethod(
+                    factory.boxedCharType,
+                    factory.createProto(factory.intType, factory.intType),
+                    factory.createString("charCount")),
                 false),
             new CfArithmeticBinop(CfArithmeticBinop.Opcode.Sub, NumericType.INT),
             new CfStore(ValueType.INT, 2),
@@ -9111,7 +8763,7 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.stringType),
+                      FrameType.initializedNonNullReference(factory.stringType),
                       FrameType.intType(),
                       FrameType.intType()
                     })),
@@ -9120,13 +8772,10 @@
             new CfLoad(ValueType.INT, 2),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringType,
-                        options.itemFactory.intType,
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("substring")),
+                factory.createMethod(
+                    factory.stringType,
+                    factory.createProto(factory.stringType, factory.intType, factory.intType),
+                    factory.createString("substring")),
                 false),
             new CfReturn(ValueType.OBJECT),
             label15),
@@ -9134,7 +8783,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode StringMethods_stripLeading(InternalOptions options, DexMethod method) {
+  public static CfCode StringMethods_stripLeading(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -9157,10 +8806,10 @@
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringType,
-                    options.itemFactory.createProto(options.itemFactory.intType),
-                    options.itemFactory.createString("length")),
+                factory.createMethod(
+                    factory.stringType,
+                    factory.createProto(factory.intType),
+                    factory.createString("length")),
                 false),
             new CfStore(ValueType.INT, 2),
             label2,
@@ -9168,7 +8817,7 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.stringType),
+                      FrameType.initializedNonNullReference(factory.stringType),
                       FrameType.intType(),
                       FrameType.intType()
                     })),
@@ -9180,22 +8829,20 @@
             new CfLoad(ValueType.INT, 1),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.intType, options.itemFactory.intType),
-                    options.itemFactory.createString("codePointAt")),
+                factory.createMethod(
+                    factory.stringType,
+                    factory.createProto(factory.intType, factory.intType),
+                    factory.createString("codePointAt")),
                 false),
             new CfStore(ValueType.INT, 3),
             label4,
             new CfLoad(ValueType.INT, 3),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.boxedCharType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.booleanType, options.itemFactory.intType),
-                    options.itemFactory.createString("isWhitespace")),
+                factory.createMethod(
+                    factory.boxedCharType,
+                    factory.createProto(factory.booleanType, factory.intType),
+                    factory.createString("isWhitespace")),
                 false),
             new CfIf(If.Type.NE, ValueType.INT, label6),
             label5,
@@ -9205,7 +8852,7 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2, 3},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.stringType),
+                      FrameType.initializedNonNullReference(factory.stringType),
                       FrameType.intType(),
                       FrameType.intType(),
                       FrameType.intType()
@@ -9214,11 +8861,10 @@
             new CfLoad(ValueType.INT, 3),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.boxedCharType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.intType, options.itemFactory.intType),
-                    options.itemFactory.createString("charCount")),
+                factory.createMethod(
+                    factory.boxedCharType,
+                    factory.createProto(factory.intType, factory.intType),
+                    factory.createString("charCount")),
                 false),
             new CfArithmeticBinop(CfArithmeticBinop.Opcode.Add, NumericType.INT),
             new CfStore(ValueType.INT, 1),
@@ -9229,7 +8875,7 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.stringType),
+                      FrameType.initializedNonNullReference(factory.stringType),
                       FrameType.intType(),
                       FrameType.intType()
                     })),
@@ -9238,13 +8884,10 @@
             new CfLoad(ValueType.INT, 2),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringType,
-                        options.itemFactory.intType,
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("substring")),
+                factory.createMethod(
+                    factory.stringType,
+                    factory.createProto(factory.stringType, factory.intType, factory.intType),
+                    factory.createString("substring")),
                 false),
             new CfReturn(ValueType.OBJECT),
             label9),
@@ -9252,7 +8895,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode StringMethods_stripTrailing(InternalOptions options, DexMethod method) {
+  public static CfCode StringMethods_stripTrailing(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -9271,10 +8914,10 @@
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringType,
-                    options.itemFactory.createProto(options.itemFactory.intType),
-                    options.itemFactory.createString("length")),
+                factory.createMethod(
+                    factory.stringType,
+                    factory.createProto(factory.intType),
+                    factory.createString("length")),
                 false),
             new CfStore(ValueType.INT, 1),
             label1,
@@ -9282,8 +8925,7 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.stringType),
-                      FrameType.intType()
+                      FrameType.initializedNonNullReference(factory.stringType), FrameType.intType()
                     })),
             new CfLoad(ValueType.INT, 1),
             new CfIf(If.Type.LE, ValueType.INT, label7),
@@ -9292,24 +8934,20 @@
             new CfLoad(ValueType.INT, 1),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.boxedCharType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.intType,
-                        options.itemFactory.charSequenceType,
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("codePointBefore")),
+                factory.createMethod(
+                    factory.boxedCharType,
+                    factory.createProto(factory.intType, factory.charSequenceType, factory.intType),
+                    factory.createString("codePointBefore")),
                 false),
             new CfStore(ValueType.INT, 2),
             label3,
             new CfLoad(ValueType.INT, 2),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.boxedCharType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.booleanType, options.itemFactory.intType),
-                    options.itemFactory.createString("isWhitespace")),
+                factory.createMethod(
+                    factory.boxedCharType,
+                    factory.createProto(factory.booleanType, factory.intType),
+                    factory.createString("isWhitespace")),
                 false),
             new CfIf(If.Type.NE, ValueType.INT, label5),
             label4,
@@ -9319,7 +8957,7 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1, 2},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.stringType),
+                      FrameType.initializedNonNullReference(factory.stringType),
                       FrameType.intType(),
                       FrameType.intType()
                     })),
@@ -9327,11 +8965,10 @@
             new CfLoad(ValueType.INT, 2),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.boxedCharType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.intType, options.itemFactory.intType),
-                    options.itemFactory.createString("charCount")),
+                factory.createMethod(
+                    factory.boxedCharType,
+                    factory.createProto(factory.intType, factory.intType),
+                    factory.createString("charCount")),
                 false),
             new CfArithmeticBinop(CfArithmeticBinop.Opcode.Sub, NumericType.INT),
             new CfStore(ValueType.INT, 1),
@@ -9342,21 +8979,17 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.stringType),
-                      FrameType.intType()
+                      FrameType.initializedNonNullReference(factory.stringType), FrameType.intType()
                     })),
             new CfLoad(ValueType.OBJECT, 0),
             new CfConstNumber(0, ValueType.INT),
             new CfLoad(ValueType.INT, 1),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringType,
-                        options.itemFactory.intType,
-                        options.itemFactory.intType),
-                    options.itemFactory.createString("substring")),
+                factory.createMethod(
+                    factory.stringType,
+                    factory.createProto(factory.stringType, factory.intType, factory.intType),
+                    factory.createString("substring")),
                 false),
             new CfReturn(ValueType.OBJECT),
             label8),
@@ -9364,7 +8997,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode ThrowableMethods_addSuppressed(InternalOptions options, DexMethod method) {
+  public static CfCode ThrowableMethods_addSuppressed(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -9377,43 +9010,43 @@
         3,
         ImmutableList.of(
             label0,
-            new CfConstClass(options.itemFactory.throwableType),
-            new CfConstString(options.itemFactory.createString("addSuppressed")),
+            new CfConstClass(factory.throwableType),
+            new CfConstString(factory.createString("addSuppressed")),
             new CfConstNumber(1, ValueType.INT),
-            new CfNewArray(options.itemFactory.createType("[Ljava/lang/Class;")),
+            new CfNewArray(factory.createType("[Ljava/lang/Class;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfConstNumber(0, ValueType.INT),
-            new CfConstClass(options.itemFactory.throwableType),
+            new CfConstClass(factory.throwableType),
             new CfArrayStore(MemberType.OBJECT),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.classType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/lang/reflect/Method;"),
-                        options.itemFactory.stringType,
-                        options.itemFactory.createType("[Ljava/lang/Class;")),
-                    options.itemFactory.createString("getDeclaredMethod")),
+                factory.createMethod(
+                    factory.classType,
+                    factory.createProto(
+                        factory.createType("Ljava/lang/reflect/Method;"),
+                        factory.stringType,
+                        factory.createType("[Ljava/lang/Class;")),
+                    factory.createString("getDeclaredMethod")),
                 false),
             new CfStore(ValueType.OBJECT, 2),
             label1,
             new CfLoad(ValueType.OBJECT, 2),
             new CfLoad(ValueType.OBJECT, 0),
             new CfConstNumber(1, ValueType.INT),
-            new CfNewArray(options.itemFactory.createType("[Ljava/lang/Object;")),
+            new CfNewArray(factory.createType("[Ljava/lang/Object;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfConstNumber(0, ValueType.INT),
             new CfLoad(ValueType.OBJECT, 1),
             new CfArrayStore(MemberType.OBJECT),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/reflect/Method;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.objectType,
-                        options.itemFactory.objectType,
-                        options.itemFactory.createType("[Ljava/lang/Object;")),
-                    options.itemFactory.createString("invoke")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/reflect/Method;"),
+                    factory.createProto(
+                        factory.objectType,
+                        factory.objectType,
+                        factory.createType("[Ljava/lang/Object;")),
+                    factory.createString("invoke")),
                 false),
             new CfStackInstruction(CfStackInstruction.Opcode.Pop),
             label2,
@@ -9423,21 +9056,21 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.throwableType),
-                      FrameType.initializedNonNullReference(options.itemFactory.throwableType)
+                      FrameType.initializedNonNullReference(factory.throwableType),
+                      FrameType.initializedNonNullReference(factory.throwableType)
                     }),
                 new ArrayDeque<>(
                     Arrays.asList(
                         FrameType.initializedNonNullReference(
-                            options.itemFactory.createType("Ljava/lang/Exception;"))))),
+                            factory.createType("Ljava/lang/Exception;"))))),
             new CfStore(ValueType.OBJECT, 2),
             label4,
             new CfFrame(
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.throwableType),
-                      FrameType.initializedNonNullReference(options.itemFactory.throwableType)
+                      FrameType.initializedNonNullReference(factory.throwableType),
+                      FrameType.initializedNonNullReference(factory.throwableType)
                     })),
             new CfReturnVoid(),
             label5),
@@ -9445,12 +9078,12 @@
             new CfTryCatch(
                 label0,
                 label2,
-                ImmutableList.of(options.itemFactory.createType("Ljava/lang/Exception;")),
+                ImmutableList.of(factory.createType("Ljava/lang/Exception;")),
                 ImmutableList.of(label3))),
         ImmutableList.of());
   }
 
-  public static CfCode ThrowableMethods_getSuppressed(InternalOptions options, DexMethod method) {
+  public static CfCode ThrowableMethods_getSuppressed(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -9463,67 +9096,65 @@
         2,
         ImmutableList.of(
             label0,
-            new CfConstClass(options.itemFactory.throwableType),
-            new CfConstString(options.itemFactory.createString("getSuppressed")),
+            new CfConstClass(factory.throwableType),
+            new CfConstString(factory.createString("getSuppressed")),
             new CfConstNumber(0, ValueType.INT),
-            new CfNewArray(options.itemFactory.createType("[Ljava/lang/Class;")),
+            new CfNewArray(factory.createType("[Ljava/lang/Class;")),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.classType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/lang/reflect/Method;"),
-                        options.itemFactory.stringType,
-                        options.itemFactory.createType("[Ljava/lang/Class;")),
-                    options.itemFactory.createString("getDeclaredMethod")),
+                factory.createMethod(
+                    factory.classType,
+                    factory.createProto(
+                        factory.createType("Ljava/lang/reflect/Method;"),
+                        factory.stringType,
+                        factory.createType("[Ljava/lang/Class;")),
+                    factory.createString("getDeclaredMethod")),
                 false),
             new CfStore(ValueType.OBJECT, 1),
             label1,
             new CfLoad(ValueType.OBJECT, 1),
             new CfLoad(ValueType.OBJECT, 0),
             new CfConstNumber(0, ValueType.INT),
-            new CfNewArray(options.itemFactory.createType("[Ljava/lang/Object;")),
+            new CfNewArray(factory.createType("[Ljava/lang/Object;")),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/reflect/Method;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.objectType,
-                        options.itemFactory.objectType,
-                        options.itemFactory.createType("[Ljava/lang/Object;")),
-                    options.itemFactory.createString("invoke")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/reflect/Method;"),
+                    factory.createProto(
+                        factory.objectType,
+                        factory.objectType,
+                        factory.createType("[Ljava/lang/Object;")),
+                    factory.createString("invoke")),
                 false),
-            new CfCheckCast(options.itemFactory.createType("[Ljava/lang/Throwable;")),
+            new CfCheckCast(factory.createType("[Ljava/lang/Throwable;")),
             label2,
             new CfReturn(ValueType.OBJECT),
             label3,
             new CfFrame(
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0},
-                    new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.throwableType)
-                    }),
+                    new FrameType[] {FrameType.initializedNonNullReference(factory.throwableType)}),
                 new ArrayDeque<>(
                     Arrays.asList(
                         FrameType.initializedNonNullReference(
-                            options.itemFactory.createType("Ljava/lang/Exception;"))))),
+                            factory.createType("Ljava/lang/Exception;"))))),
             new CfStore(ValueType.OBJECT, 1),
             label4,
             new CfConstNumber(0, ValueType.INT),
-            new CfNewArray(options.itemFactory.createType("[Ljava/lang/Throwable;")),
+            new CfNewArray(factory.createType("[Ljava/lang/Throwable;")),
             new CfReturn(ValueType.OBJECT),
             label5),
         ImmutableList.of(
             new CfTryCatch(
                 label0,
                 label2,
-                ImmutableList.of(options.itemFactory.createType("Ljava/lang/Exception;")),
+                ImmutableList.of(factory.createType("Ljava/lang/Exception;")),
                 ImmutableList.of(label3))),
         ImmutableList.of());
   }
 
   public static CfCode UnsafeMethods_compareAndSwapObject(
-      InternalOptions options, DexMethod method) {
+      DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -9540,12 +9171,12 @@
                     new int[] {0, 1, 2, 3, 4, 5},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Lsun/misc/Unsafe;")),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
+                          factory.createType("Lsun/misc/Unsafe;")),
+                      FrameType.initializedNonNullReference(factory.objectType),
                       FrameType.longType(),
                       FrameType.longHighType(),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfLoad(ValueType.OBJECT, 0),
             new CfLoad(ValueType.OBJECT, 1),
@@ -9554,15 +9185,15 @@
             new CfLoad(ValueType.OBJECT, 5),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Lsun/misc/Unsafe;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.booleanType,
-                        options.itemFactory.objectType,
-                        options.itemFactory.longType,
-                        options.itemFactory.objectType,
-                        options.itemFactory.objectType),
-                    options.itemFactory.createString("compareAndSwapObject")),
+                factory.createMethod(
+                    factory.createType("Lsun/misc/Unsafe;"),
+                    factory.createProto(
+                        factory.booleanType,
+                        factory.objectType,
+                        factory.longType,
+                        factory.objectType,
+                        factory.objectType),
+                    factory.createString("compareAndSwapObject")),
                 false),
             new CfIf(If.Type.EQ, ValueType.INT, label2),
             label1,
@@ -9574,25 +9205,22 @@
                     new int[] {0, 1, 2, 3, 4, 5},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Lsun/misc/Unsafe;")),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
+                          factory.createType("Lsun/misc/Unsafe;")),
+                      FrameType.initializedNonNullReference(factory.objectType),
                       FrameType.longType(),
                       FrameType.longHighType(),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType),
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
+                      FrameType.initializedNonNullReference(factory.objectType),
+                      FrameType.initializedNonNullReference(factory.objectType)
                     })),
             new CfLoad(ValueType.OBJECT, 0),
             new CfLoad(ValueType.OBJECT, 1),
             new CfLoad(ValueType.LONG, 2),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Lsun/misc/Unsafe;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.objectType,
-                        options.itemFactory.objectType,
-                        options.itemFactory.longType),
-                    options.itemFactory.createString("getObject")),
+                factory.createMethod(
+                    factory.createType("Lsun/misc/Unsafe;"),
+                    factory.createProto(factory.objectType, factory.objectType, factory.longType),
+                    factory.createString("getObject")),
                 false),
             new CfLoad(ValueType.OBJECT, 4),
             new CfIfCmp(If.Type.EQ, ValueType.OBJECT, label0),
diff --git a/src/main/java/com/android/tools/r8/ir/desugar/backports/CollectionMethodGenerators.java b/src/main/java/com/android/tools/r8/ir/desugar/backports/CollectionMethodGenerators.java
index cd385e8..f6b6ac3 100644
--- a/src/main/java/com/android/tools/r8/ir/desugar/backports/CollectionMethodGenerators.java
+++ b/src/main/java/com/android/tools/r8/ir/desugar/backports/CollectionMethodGenerators.java
@@ -14,11 +14,11 @@
 import com.android.tools.r8.cf.code.CfStackInstruction;
 import com.android.tools.r8.dex.Constants;
 import com.android.tools.r8.graph.CfCode;
+import com.android.tools.r8.graph.DexItemFactory;
 import com.android.tools.r8.graph.DexMethod;
 import com.android.tools.r8.graph.DexType;
 import com.android.tools.r8.ir.code.MemberType;
 import com.android.tools.r8.ir.code.ValueType;
-import com.android.tools.r8.utils.InternalOptions;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableList.Builder;
 import org.objectweb.asm.Opcodes;
@@ -27,20 +27,19 @@
 
   private CollectionMethodGenerators() {}
 
-  public static CfCode generateListOf(InternalOptions options, DexMethod method, int formalCount) {
-    return generateFixedMethods(options, method, formalCount, options.itemFactory.listType);
+  public static CfCode generateListOf(DexItemFactory factory, DexMethod method, int formalCount) {
+    return generateFixedMethods(factory, method, formalCount, factory.listType);
   }
 
-  public static CfCode generateSetOf(InternalOptions options, DexMethod method, int formalCount) {
-    return generateFixedMethods(options, method, formalCount, options.itemFactory.setType);
+  public static CfCode generateSetOf(DexItemFactory factory, DexMethod method, int formalCount) {
+    return generateFixedMethods(factory, method, formalCount, factory.setType);
   }
 
   private static CfCode generateFixedMethods(
-      InternalOptions options, DexMethod method, int formalCount, DexType returnType) {
+      DexItemFactory factory, DexMethod method, int formalCount, DexType returnType) {
     Builder<CfInstruction> builder = ImmutableList.builder();
     builder.add(
-        new CfConstNumber(formalCount, ValueType.INT),
-        new CfNewArray(options.itemFactory.objectArrayType));
+        new CfConstNumber(formalCount, ValueType.INT), new CfNewArray(factory.objectArrayType));
 
     for (int i = 0; i < formalCount; i++) {
       builder.add(
@@ -53,28 +52,24 @@
     builder.add(
         new CfInvoke(
             Opcodes.INVOKESTATIC,
-            options.itemFactory.createMethod(
+            factory.createMethod(
                 returnType,
-                options.itemFactory.createProto(returnType, options.itemFactory.objectArrayType),
-                options.itemFactory.createString("of")),
+                factory.createProto(returnType, factory.objectArrayType),
+                factory.createString("of")),
             false),
         new CfReturn(ValueType.OBJECT));
 
     return new CfCode(method.holder, 4, formalCount, builder.build());
   }
 
-  public static CfCode generateMapOf(
-      InternalOptions options, DexMethod method, int formalCount) {
-    DexType mapEntryArray =
-        options.itemFactory.createArrayType(1, options.itemFactory.mapEntryType);
-    DexType simpleEntry = options.itemFactory.abstractMapSimpleEntryType;
-    DexMethod simpleEntryConstructor = options.itemFactory.createMethod(
-        simpleEntry,
-        options.itemFactory.createProto(
-            options.itemFactory.voidType,
-            options.itemFactory.objectType,
-            options.itemFactory.objectType),
-        Constants.INSTANCE_INITIALIZER_NAME);
+  public static CfCode generateMapOf(DexItemFactory factory, DexMethod method, int formalCount) {
+    DexType mapEntryArray = factory.createArrayType(1, factory.mapEntryType);
+    DexType simpleEntry = factory.abstractMapSimpleEntryType;
+    DexMethod simpleEntryConstructor =
+        factory.createMethod(
+            simpleEntry,
+            factory.createProto(factory.voidType, factory.objectType, factory.objectType),
+            Constants.INSTANCE_INITIALIZER_NAME);
 
     Builder<CfInstruction> builder = ImmutableList.builder();
     builder.add(
@@ -96,12 +91,10 @@
     builder.add(
         new CfInvoke(
             Opcodes.INVOKESTATIC,
-            options.itemFactory.createMethod(
-                options.itemFactory.mapType,
-                options.itemFactory.createProto(
-                    options.itemFactory.mapType,
-                    mapEntryArray),
-                options.itemFactory.createString("ofEntries")),
+            factory.createMethod(
+                factory.mapType,
+                factory.createProto(factory.mapType, mapEntryArray),
+                factory.createString("ofEntries")),
             false),
         new CfReturn(ValueType.OBJECT));
 
diff --git a/src/main/java/com/android/tools/r8/ir/desugar/desugaredlibrary/DesugaredLibraryAmender.java b/src/main/java/com/android/tools/r8/ir/desugar/desugaredlibrary/DesugaredLibraryAmender.java
index 92bd91e..f83ab04 100644
--- a/src/main/java/com/android/tools/r8/ir/desugar/desugaredlibrary/DesugaredLibraryAmender.java
+++ b/src/main/java/com/android/tools/r8/ir/desugar/desugaredlibrary/DesugaredLibraryAmender.java
@@ -99,7 +99,6 @@
         DexEncodedMethod.syntheticBuilder()
             .setMethod(method)
             .setAccessFlags(methodAccessFlags)
-            .setCode(null)
             .setApiLevelForDefinition(minAPILevel)
             .build();
     libClass.getMethodCollection().addMethod(encodedMethod);
diff --git a/src/main/java/com/android/tools/r8/ir/desugar/records/RecordCfMethods.java b/src/main/java/com/android/tools/r8/ir/desugar/records/RecordCfMethods.java
index d3955b6..accc84e 100644
--- a/src/main/java/com/android/tools/r8/ir/desugar/records/RecordCfMethods.java
+++ b/src/main/java/com/android/tools/r8/ir/desugar/records/RecordCfMethods.java
@@ -34,7 +34,6 @@
 import com.android.tools.r8.ir.code.MemberType;
 import com.android.tools.r8.ir.code.NumericType;
 import com.android.tools.r8.ir.code.ValueType;
-import com.android.tools.r8.utils.InternalOptions;
 import com.google.common.collect.ImmutableList;
 import it.unimi.dsi.fastutil.ints.Int2ObjectAVLTreeMap;
 import java.util.ArrayDeque;
@@ -48,7 +47,7 @@
     factory.createSynthesizedType("[Ljava/lang/String;");
   }
 
-  public static CfCode RecordMethods_hashCode(InternalOptions options, DexMethod method) {
+  public static CfCode RecordMethods_hashCode(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     return new CfCode(
@@ -61,21 +60,19 @@
             new CfLoad(ValueType.OBJECT, 1),
             new CfInvoke(
                 184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/util/Arrays;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.intType,
-                        options.itemFactory.createType("[Ljava/lang/Object;")),
-                    options.itemFactory.createString("hashCode")),
+                factory.createMethod(
+                    factory.createType("Ljava/util/Arrays;"),
+                    factory.createProto(factory.intType, factory.createType("[Ljava/lang/Object;")),
+                    factory.createString("hashCode")),
                 false),
             new CfArithmeticBinop(CfArithmeticBinop.Opcode.Mul, NumericType.INT),
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.objectType,
-                    options.itemFactory.createProto(options.itemFactory.intType),
-                    options.itemFactory.createString("hashCode")),
+                factory.createMethod(
+                    factory.objectType,
+                    factory.createProto(factory.intType),
+                    factory.createString("hashCode")),
                 false),
             new CfArithmeticBinop(CfArithmeticBinop.Opcode.Add, NumericType.INT),
             new CfReturn(ValueType.INT),
@@ -84,7 +81,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode RecordMethods_toString(InternalOptions options, DexMethod method) {
+  public static CfCode RecordMethods_toString(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -108,14 +105,14 @@
             new CfLoad(ValueType.OBJECT, 2),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringType,
-                    options.itemFactory.createProto(options.itemFactory.intType),
-                    options.itemFactory.createString("length")),
+                factory.createMethod(
+                    factory.stringType,
+                    factory.createProto(factory.intType),
+                    factory.createString("length")),
                 false),
             new CfIf(If.Type.NE, ValueType.INT, label1),
             new CfConstNumber(0, ValueType.INT),
-            new CfNewArray(options.itemFactory.createType("[Ljava/lang/String;")),
+            new CfNewArray(factory.createType("[Ljava/lang/String;")),
             new CfGoto(label2),
             label1,
             new CfFrame(
@@ -123,20 +120,19 @@
                     new int[] {0, 1, 2},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("[Ljava/lang/Object;")),
-                      FrameType.initializedNonNullReference(options.itemFactory.classType),
-                      FrameType.initializedNonNullReference(options.itemFactory.stringType)
+                          factory.createType("[Ljava/lang/Object;")),
+                      FrameType.initializedNonNullReference(factory.classType),
+                      FrameType.initializedNonNullReference(factory.stringType)
                     })),
             new CfLoad(ValueType.OBJECT, 2),
-            new CfConstString(options.itemFactory.createString(";")),
+            new CfConstString(factory.createString(";")),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("[Ljava/lang/String;"),
-                        options.itemFactory.stringType),
-                    options.itemFactory.createString("split")),
+                factory.createMethod(
+                    factory.stringType,
+                    factory.createProto(
+                        factory.createType("[Ljava/lang/String;"), factory.stringType),
+                    factory.createString("split")),
                 false),
             label2,
             new CfFrame(
@@ -144,24 +140,24 @@
                     new int[] {0, 1, 2},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("[Ljava/lang/Object;")),
-                      FrameType.initializedNonNullReference(options.itemFactory.classType),
-                      FrameType.initializedNonNullReference(options.itemFactory.stringType)
+                          factory.createType("[Ljava/lang/Object;")),
+                      FrameType.initializedNonNullReference(factory.classType),
+                      FrameType.initializedNonNullReference(factory.stringType)
                     }),
                 new ArrayDeque<>(
                     Arrays.asList(
                         FrameType.initializedNonNullReference(
-                            options.itemFactory.createType("[Ljava/lang/String;"))))),
+                            factory.createType("[Ljava/lang/String;"))))),
             new CfStore(ValueType.OBJECT, 3),
             label3,
-            new CfNew(options.itemFactory.stringBuilderType),
+            new CfNew(factory.stringBuilderType),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
             new CfStore(ValueType.OBJECT, 4),
             label4,
@@ -169,27 +165,25 @@
             new CfLoad(ValueType.OBJECT, 1),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.classType,
-                    options.itemFactory.createProto(options.itemFactory.stringType),
-                    options.itemFactory.createString("getSimpleName")),
+                factory.createMethod(
+                    factory.classType,
+                    factory.createProto(factory.stringType),
+                    factory.createString("getSimpleName")),
                 false),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.stringType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.stringType),
+                    factory.createString("append")),
                 false),
-            new CfConstString(options.itemFactory.createString("[")),
+            new CfConstString(factory.createString("[")),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.stringType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.stringType),
+                    factory.createString("append")),
                 false),
             new CfStackInstruction(CfStackInstruction.Opcode.Pop),
             label5,
@@ -201,12 +195,12 @@
                     new int[] {0, 1, 2, 3, 4, 5},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("[Ljava/lang/Object;")),
-                      FrameType.initializedNonNullReference(options.itemFactory.classType),
-                      FrameType.initializedNonNullReference(options.itemFactory.stringType),
+                          factory.createType("[Ljava/lang/Object;")),
+                      FrameType.initializedNonNullReference(factory.classType),
+                      FrameType.initializedNonNullReference(factory.stringType),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("[Ljava/lang/String;")),
-                      FrameType.initializedNonNullReference(options.itemFactory.stringBuilderType),
+                          factory.createType("[Ljava/lang/String;")),
+                      FrameType.initializedNonNullReference(factory.stringBuilderType),
                       FrameType.intType()
                     })),
             new CfLoad(ValueType.INT, 5),
@@ -220,31 +214,28 @@
             new CfArrayLoad(MemberType.OBJECT),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.stringType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.stringType),
+                    factory.createString("append")),
                 false),
-            new CfConstString(options.itemFactory.createString("=")),
+            new CfConstString(factory.createString("=")),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.stringType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.stringType),
+                    factory.createString("append")),
                 false),
             new CfLoad(ValueType.OBJECT, 0),
             new CfLoad(ValueType.INT, 5),
             new CfArrayLoad(MemberType.OBJECT),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.objectType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.objectType),
+                    factory.createString("append")),
                 false),
             new CfStackInstruction(CfStackInstruction.Opcode.Pop),
             label8,
@@ -256,14 +247,13 @@
             new CfIfCmp(If.Type.EQ, ValueType.INT, label10),
             label9,
             new CfLoad(ValueType.OBJECT, 4),
-            new CfConstString(options.itemFactory.createString(", ")),
+            new CfConstString(factory.createString(", ")),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.stringType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.stringType),
+                    factory.createString("append")),
                 false),
             new CfStackInstruction(CfStackInstruction.Opcode.Pop),
             label10,
@@ -272,12 +262,12 @@
                     new int[] {0, 1, 2, 3, 4, 5},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("[Ljava/lang/Object;")),
-                      FrameType.initializedNonNullReference(options.itemFactory.classType),
-                      FrameType.initializedNonNullReference(options.itemFactory.stringType),
+                          factory.createType("[Ljava/lang/Object;")),
+                      FrameType.initializedNonNullReference(factory.classType),
+                      FrameType.initializedNonNullReference(factory.stringType),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("[Ljava/lang/String;")),
-                      FrameType.initializedNonNullReference(options.itemFactory.stringBuilderType),
+                          factory.createType("[Ljava/lang/String;")),
+                      FrameType.initializedNonNullReference(factory.stringBuilderType),
                       FrameType.intType()
                     })),
             new CfIinc(5, 1),
@@ -288,32 +278,31 @@
                     new int[] {0, 1, 2, 3, 4},
                     new FrameType[] {
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("[Ljava/lang/Object;")),
-                      FrameType.initializedNonNullReference(options.itemFactory.classType),
-                      FrameType.initializedNonNullReference(options.itemFactory.stringType),
+                          factory.createType("[Ljava/lang/Object;")),
+                      FrameType.initializedNonNullReference(factory.classType),
+                      FrameType.initializedNonNullReference(factory.stringType),
                       FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("[Ljava/lang/String;")),
-                      FrameType.initializedNonNullReference(options.itemFactory.stringBuilderType)
+                          factory.createType("[Ljava/lang/String;")),
+                      FrameType.initializedNonNullReference(factory.stringBuilderType)
                     })),
             new CfLoad(ValueType.OBJECT, 4),
-            new CfConstString(options.itemFactory.createString("]")),
+            new CfConstString(factory.createString("]")),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.stringType),
-                    options.itemFactory.createString("append")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.stringType),
+                    factory.createString("append")),
                 false),
             new CfStackInstruction(CfStackInstruction.Opcode.Pop),
             label12,
             new CfLoad(ValueType.OBJECT, 4),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(options.itemFactory.stringType),
-                    options.itemFactory.createString("toString")),
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringType),
+                    factory.createString("toString")),
                 false),
             new CfReturn(ValueType.OBJECT),
             label13),
diff --git a/src/main/java/com/android/tools/r8/ir/desugar/records/RecordDesugaring.java b/src/main/java/com/android/tools/r8/ir/desugar/records/RecordDesugaring.java
index f0ec7b2..81736ab 100644
--- a/src/main/java/com/android/tools/r8/ir/desugar/records/RecordDesugaring.java
+++ b/src/main/java/com/android/tools/r8/ir/desugar/records/RecordDesugaring.java
@@ -54,7 +54,6 @@
 import com.android.tools.r8.ir.synthetic.RecordCfCodeProvider.RecordEqualsCfCodeProvider;
 import com.android.tools.r8.ir.synthetic.RecordCfCodeProvider.RecordGetFieldsAsObjectsCfCodeProvider;
 import com.android.tools.r8.ir.synthetic.SyntheticCfCodeProvider;
-import com.android.tools.r8.utils.InternalOptions;
 import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -240,7 +239,6 @@
         DexEncodedMethod.syntheticBuilder()
             .setMethod(method)
             .setAccessFlags(methodAccessFlags)
-            .setCode(null)
             // Will be traced by the enqueuer.
             .disableAndroidApiLevelCheck()
             .build();
@@ -285,7 +283,7 @@
 
   private ProgramMethod synthesizeRecordHelper(
       DexProto helperProto,
-      BiFunction<InternalOptions, DexMethod, CfCode> codeGenerator,
+      BiFunction<DexItemFactory, DexMethod, CfCode> codeGenerator,
       MethodProcessingContext methodProcessingContext) {
     return appView
         .getSyntheticItems()
@@ -297,7 +295,7 @@
                 builder
                     .setProto(helperProto)
                     .setAccessFlags(MethodAccessFlags.createPublicStaticSynthetic())
-                    .setCode(methodSig -> codeGenerator.apply(appView.options(), methodSig))
+                    .setCode(methodSig -> codeGenerator.apply(appView.dexItemFactory(), methodSig))
                     .disableAndroidApiLevelCheck());
   }
 
diff --git a/src/main/java/com/android/tools/r8/ir/desugar/twr/TwrInstructionDesugaring.java b/src/main/java/com/android/tools/r8/ir/desugar/twr/TwrInstructionDesugaring.java
index 017ba89..7a9423b 100644
--- a/src/main/java/com/android/tools/r8/ir/desugar/twr/TwrInstructionDesugaring.java
+++ b/src/main/java/com/android/tools/r8/ir/desugar/twr/TwrInstructionDesugaring.java
@@ -23,7 +23,6 @@
 import com.android.tools.r8.ir.desugar.LocalStackAllocator;
 import com.android.tools.r8.ir.desugar.backports.BackportedMethods;
 import com.android.tools.r8.synthesis.SyntheticItems.SyntheticKindSelector;
-import com.android.tools.r8.utils.InternalOptions;
 import com.google.common.collect.ImmutableList;
 import java.util.Collection;
 import java.util.function.BiConsumer;
@@ -122,7 +121,7 @@
   private ImmutableList<CfInstruction> createAndCallSyntheticMethod(
       SyntheticKindSelector kindSelector,
       DexProto proto,
-      BiFunction<InternalOptions, DexMethod, CfCode> generator,
+      BiFunction<DexItemFactory, DexMethod, CfCode> generator,
       MethodProcessingContext methodProcessingContext,
       BiConsumer<ProgramMethod, ProgramMethod> eventConsumerCallback,
       ProgramMethod context) {
@@ -139,7 +138,8 @@
                         .disableAndroidApiLevelCheck()
                         .setProto(proto)
                         .setAccessFlags(MethodAccessFlags.createPublicStaticSynthetic())
-                        .setCode(methodSig -> generator.apply(appView.options(), methodSig)));
+                        .setCode(
+                            methodSig -> generator.apply(appView.dexItemFactory(), methodSig)));
     eventConsumerCallback.accept(method, context);
     return ImmutableList.of(new CfInvoke(Opcodes.INVOKESTATIC, method.getReference(), false));
   }
diff --git a/src/main/java/com/android/tools/r8/ir/optimize/UtilityMethodsForCodeOptimizations.java b/src/main/java/com/android/tools/r8/ir/optimize/UtilityMethodsForCodeOptimizations.java
index 33e5159..d4d8601 100644
--- a/src/main/java/com/android/tools/r8/ir/optimize/UtilityMethodsForCodeOptimizations.java
+++ b/src/main/java/com/android/tools/r8/ir/optimize/UtilityMethodsForCodeOptimizations.java
@@ -17,7 +17,6 @@
 import com.android.tools.r8.ir.conversion.MethodProcessor;
 import com.android.tools.r8.ir.optimize.templates.CfUtilityMethodsForCodeOptimizations;
 import com.android.tools.r8.synthesis.SyntheticItems;
-import com.android.tools.r8.utils.InternalOptions;
 
 public class UtilityMethodsForCodeOptimizations {
 
@@ -29,7 +28,6 @@
 
   public static UtilityMethodForCodeOptimizations synthesizeToStringIfNotNullMethod(
       AppView<?> appView, MethodProcessingContext methodProcessingContext) {
-    InternalOptions options = appView.options();
     DexItemFactory dexItemFactory = appView.dexItemFactory();
     DexProto proto = dexItemFactory.createProto(dexItemFactory.voidType, dexItemFactory.objectType);
     SyntheticItems syntheticItems = appView.getSyntheticItems();
@@ -44,20 +42,19 @@
                     .setClassFileVersion(CfVersion.V1_8)
                     .setApiLevelForDefinition(appView.computedMinApiLevel())
                     .setApiLevelForCode(appView.computedMinApiLevel())
-                    .setCode(method -> getToStringIfNotNullCodeTemplate(method, options))
+                    .setCode(method -> getToStringIfNotNullCodeTemplate(method, dexItemFactory))
                     .setProto(proto));
     return new UtilityMethodForCodeOptimizations(syntheticMethod);
   }
 
   private static CfCode getToStringIfNotNullCodeTemplate(
-      DexMethod method, InternalOptions options) {
+      DexMethod method, DexItemFactory dexItemFactory) {
     return CfUtilityMethodsForCodeOptimizations
-        .CfUtilityMethodsForCodeOptimizationsTemplates_toStringIfNotNull(options, method);
+        .CfUtilityMethodsForCodeOptimizationsTemplates_toStringIfNotNull(dexItemFactory, method);
   }
 
   public static UtilityMethodForCodeOptimizations synthesizeThrowClassCastExceptionIfNotNullMethod(
       AppView<?> appView, MethodProcessingContext methodProcessingContext) {
-    InternalOptions options = appView.options();
     DexItemFactory dexItemFactory = appView.dexItemFactory();
     DexProto proto = dexItemFactory.createProto(dexItemFactory.voidType, dexItemFactory.objectType);
     SyntheticItems syntheticItems = appView.getSyntheticItems();
@@ -74,21 +71,21 @@
                     .setApiLevelForDefinition(appView.computedMinApiLevel())
                     .setApiLevelForCode(appView.computedMinApiLevel())
                     .setCode(
-                        method -> getThrowClassCastExceptionIfNotNullCodeTemplate(method, options))
+                        method ->
+                            getThrowClassCastExceptionIfNotNullCodeTemplate(method, dexItemFactory))
                     .setProto(proto));
     return new UtilityMethodForCodeOptimizations(syntheticMethod);
   }
 
   private static CfCode getThrowClassCastExceptionIfNotNullCodeTemplate(
-      DexMethod method, InternalOptions options) {
+      DexMethod method, DexItemFactory dexItemFactory) {
     return CfUtilityMethodsForCodeOptimizations
         .CfUtilityMethodsForCodeOptimizationsTemplates_throwClassCastExceptionIfNotNull(
-            options, method);
+            dexItemFactory, method);
   }
 
   public static UtilityMethodForCodeOptimizations synthesizeThrowIllegalAccessErrorMethod(
       AppView<?> appView, MethodProcessingContext methodProcessingContext) {
-    InternalOptions options = appView.options();
     DexItemFactory dexItemFactory = appView.dexItemFactory();
     DexProto proto = dexItemFactory.createProto(dexItemFactory.illegalAccessErrorType);
     SyntheticItems syntheticItems = appView.getSyntheticItems();
@@ -103,20 +100,21 @@
                     .setClassFileVersion(CfVersion.V1_8)
                     .setApiLevelForDefinition(appView.computedMinApiLevel())
                     .setApiLevelForCode(appView.computedMinApiLevel())
-                    .setCode(method -> getThrowIllegalAccessErrorCodeTemplate(method, options))
+                    .setCode(
+                        method -> getThrowIllegalAccessErrorCodeTemplate(method, dexItemFactory))
                     .setProto(proto));
     return new UtilityMethodForCodeOptimizations(syntheticMethod);
   }
 
   private static CfCode getThrowIllegalAccessErrorCodeTemplate(
-      DexMethod method, InternalOptions options) {
+      DexMethod method, DexItemFactory dexItemFactory) {
     return CfUtilityMethodsForCodeOptimizations
-        .CfUtilityMethodsForCodeOptimizationsTemplates_throwIllegalAccessError(options, method);
+        .CfUtilityMethodsForCodeOptimizationsTemplates_throwIllegalAccessError(
+            dexItemFactory, method);
   }
 
   public static UtilityMethodForCodeOptimizations synthesizeThrowIncompatibleClassChangeErrorMethod(
       AppView<?> appView, MethodProcessingContext methodProcessingContext) {
-    InternalOptions options = appView.options();
     DexItemFactory dexItemFactory = appView.dexItemFactory();
     DexProto proto = dexItemFactory.createProto(dexItemFactory.icceType);
     SyntheticItems syntheticItems = appView.getSyntheticItems();
@@ -132,21 +130,22 @@
                     .setApiLevelForDefinition(appView.computedMinApiLevel())
                     .setApiLevelForCode(appView.computedMinApiLevel())
                     .setCode(
-                        method -> getThrowIncompatibleClassChangeErrorCodeTemplate(method, options))
+                        method ->
+                            getThrowIncompatibleClassChangeErrorCodeTemplate(
+                                method, dexItemFactory))
                     .setProto(proto));
     return new UtilityMethodForCodeOptimizations(syntheticMethod);
   }
 
   private static CfCode getThrowIncompatibleClassChangeErrorCodeTemplate(
-      DexMethod method, InternalOptions options) {
+      DexMethod method, DexItemFactory dexItemFactory) {
     return CfUtilityMethodsForCodeOptimizations
         .CfUtilityMethodsForCodeOptimizationsTemplates_throwIncompatibleClassChangeError(
-            options, method);
+            dexItemFactory, method);
   }
 
   public static UtilityMethodForCodeOptimizations synthesizeThrowNoSuchMethodErrorMethod(
       AppView<?> appView, MethodProcessingContext methodProcessingContext) {
-    InternalOptions options = appView.options();
     DexItemFactory dexItemFactory = appView.dexItemFactory();
     DexProto proto = dexItemFactory.createProto(dexItemFactory.noSuchMethodErrorType);
     SyntheticItems syntheticItems = appView.getSyntheticItems();
@@ -161,20 +160,21 @@
                     .setClassFileVersion(CfVersion.V1_8)
                     .setApiLevelForDefinition(appView.computedMinApiLevel())
                     .setApiLevelForCode(appView.computedMinApiLevel())
-                    .setCode(method -> getThrowNoSuchMethodErrorCodeTemplate(method, options))
+                    .setCode(
+                        method -> getThrowNoSuchMethodErrorCodeTemplate(method, dexItemFactory))
                     .setProto(proto));
     return new UtilityMethodForCodeOptimizations(syntheticMethod);
   }
 
   private static CfCode getThrowNoSuchMethodErrorCodeTemplate(
-      DexMethod method, InternalOptions options) {
+      DexMethod method, DexItemFactory dexItemFactory) {
     return CfUtilityMethodsForCodeOptimizations
-        .CfUtilityMethodsForCodeOptimizationsTemplates_throwNoSuchMethodError(options, method);
+        .CfUtilityMethodsForCodeOptimizationsTemplates_throwNoSuchMethodError(
+            dexItemFactory, method);
   }
 
   public static UtilityMethodForCodeOptimizations synthesizeThrowRuntimeExceptionWithMessageMethod(
       AppView<?> appView, MethodProcessingContext methodProcessingContext) {
-    InternalOptions options = appView.options();
     DexItemFactory dexItemFactory = appView.dexItemFactory();
     DexProto proto =
         dexItemFactory.createProto(dexItemFactory.runtimeExceptionType, dexItemFactory.stringType);
@@ -191,16 +191,17 @@
                     .setApiLevelForDefinition(appView.computedMinApiLevel())
                     .setApiLevelForCode(appView.computedMinApiLevel())
                     .setCode(
-                        method -> getThrowRuntimeExceptionWithMessageCodeTemplate(method, options))
+                        method ->
+                            getThrowRuntimeExceptionWithMessageCodeTemplate(method, dexItemFactory))
                     .setProto(proto));
     return new UtilityMethodForCodeOptimizations(syntheticMethod);
   }
 
   private static CfCode getThrowRuntimeExceptionWithMessageCodeTemplate(
-      DexMethod method, InternalOptions options) {
+      DexMethod method, DexItemFactory dexItemFactory) {
     return CfUtilityMethodsForCodeOptimizations
         .CfUtilityMethodsForCodeOptimizationsTemplates_throwRuntimeExceptionWithMessage(
-            options, method);
+            dexItemFactory, method);
   }
 
   public static class UtilityMethodForCodeOptimizations {
diff --git a/src/main/java/com/android/tools/r8/ir/optimize/enums/EnumUnboxingCfMethods.java b/src/main/java/com/android/tools/r8/ir/optimize/enums/EnumUnboxingCfMethods.java
index 3a20e47..8ab61f6 100644
--- a/src/main/java/com/android/tools/r8/ir/optimize/enums/EnumUnboxingCfMethods.java
+++ b/src/main/java/com/android/tools/r8/ir/optimize/enums/EnumUnboxingCfMethods.java
@@ -35,7 +35,6 @@
 import com.android.tools.r8.ir.code.MemberType;
 import com.android.tools.r8.ir.code.NumericType;
 import com.android.tools.r8.ir.code.ValueType;
-import com.android.tools.r8.utils.InternalOptions;
 import com.google.common.collect.ImmutableList;
 import it.unimi.dsi.fastutil.ints.Int2ObjectAVLTreeMap;
 import java.util.ArrayDeque;
@@ -47,7 +46,7 @@
     factory.createSynthesizedType("Ljava/lang/NullPointerException;");
   }
 
-  public static CfCode EnumUnboxingMethods_compareTo(InternalOptions options, DexMethod method) {
+  public static CfCode EnumUnboxingMethods_compareTo(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -66,14 +65,14 @@
             new CfFrame(
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1}, new FrameType[] {FrameType.intType(), FrameType.intType()})),
-            new CfNew(options.itemFactory.createType("Ljava/lang/NullPointerException;")),
+            new CfNew(factory.createType("Ljava/lang/NullPointerException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/NullPointerException;"),
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/NullPointerException;"),
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label2,
@@ -89,7 +88,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode EnumUnboxingMethods_equals(InternalOptions options, DexMethod method) {
+  public static CfCode EnumUnboxingMethods_equals(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -105,14 +104,14 @@
             new CfLoad(ValueType.INT, 0),
             new CfIf(If.Type.NE, ValueType.INT, label2),
             label1,
-            new CfNew(options.itemFactory.createType("Ljava/lang/NullPointerException;")),
+            new CfNew(factory.createType("Ljava/lang/NullPointerException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/NullPointerException;"),
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/NullPointerException;"),
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label2,
@@ -140,7 +139,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode EnumUnboxingMethods_ordinal(InternalOptions options, DexMethod method) {
+  public static CfCode EnumUnboxingMethods_ordinal(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -154,14 +153,14 @@
             new CfLoad(ValueType.INT, 0),
             new CfIf(If.Type.NE, ValueType.INT, label2),
             label1,
-            new CfNew(options.itemFactory.createType("Ljava/lang/NullPointerException;")),
+            new CfNew(factory.createType("Ljava/lang/NullPointerException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/NullPointerException;"),
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/NullPointerException;"),
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label2,
@@ -176,7 +175,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode EnumUnboxingMethods_values(InternalOptions options, DexMethod method) {
+  public static CfCode EnumUnboxingMethods_values(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -191,7 +190,7 @@
         ImmutableList.of(
             label0,
             new CfLoad(ValueType.INT, 0),
-            new CfNewArray(options.itemFactory.intArrayType),
+            new CfNewArray(factory.intArrayType),
             new CfStore(ValueType.OBJECT, 1),
             label1,
             new CfConstNumber(0, ValueType.INT),
@@ -202,7 +201,7 @@
                     new int[] {0, 1, 2},
                     new FrameType[] {
                       FrameType.intType(),
-                      FrameType.initializedNonNullReference(options.itemFactory.intArrayType),
+                      FrameType.initializedNonNullReference(factory.intArrayType),
                       FrameType.intType()
                     })),
             new CfLoad(ValueType.INT, 2),
@@ -225,7 +224,7 @@
                     new int[] {0, 1},
                     new FrameType[] {
                       FrameType.intType(),
-                      FrameType.initializedNonNullReference(options.itemFactory.intArrayType)
+                      FrameType.initializedNonNullReference(factory.intArrayType)
                     })),
             new CfLoad(ValueType.OBJECT, 1),
             new CfReturn(ValueType.OBJECT),
@@ -234,7 +233,7 @@
         ImmutableList.of());
   }
 
-  public static CfCode EnumUnboxingMethods_zeroCheck(InternalOptions options, DexMethod method) {
+  public static CfCode EnumUnboxingMethods_zeroCheck(DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -248,14 +247,14 @@
             new CfLoad(ValueType.INT, 0),
             new CfIf(If.Type.NE, ValueType.INT, label2),
             label1,
-            new CfNew(options.itemFactory.createType("Ljava/lang/NullPointerException;")),
+            new CfNew(factory.createType("Ljava/lang/NullPointerException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/NullPointerException;"),
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/NullPointerException;"),
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label2,
@@ -268,7 +267,7 @@
   }
 
   public static CfCode EnumUnboxingMethods_zeroCheckMessage(
-      InternalOptions options, DexMethod method) {
+      DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -282,16 +281,15 @@
             new CfLoad(ValueType.INT, 0),
             new CfIf(If.Type.NE, ValueType.INT, label2),
             label1,
-            new CfNew(options.itemFactory.createType("Ljava/lang/NullPointerException;")),
+            new CfNew(factory.createType("Ljava/lang/NullPointerException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfLoad(ValueType.OBJECT, 1),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/NullPointerException;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.stringType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/NullPointerException;"),
+                    factory.createProto(factory.voidType, factory.stringType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label2,
@@ -299,8 +297,7 @@
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0, 1},
                     new FrameType[] {
-                      FrameType.intType(),
-                      FrameType.initializedNonNullReference(options.itemFactory.stringType)
+                      FrameType.intType(), FrameType.initializedNonNullReference(factory.stringType)
                     })),
             new CfReturnVoid(),
             label3),
diff --git a/src/main/java/com/android/tools/r8/ir/optimize/enums/SharedEnumUnboxingUtilityClass.java b/src/main/java/com/android/tools/r8/ir/optimize/enums/SharedEnumUnboxingUtilityClass.java
index 5edfe2e..c24a972 100644
--- a/src/main/java/com/android/tools/r8/ir/optimize/enums/SharedEnumUnboxingUtilityClass.java
+++ b/src/main/java/com/android/tools/r8/ir/optimize/enums/SharedEnumUnboxingUtilityClass.java
@@ -81,7 +81,7 @@
         appView,
         dexItemFactory.createString("checkNotZero"),
         dexItemFactory.createProto(dexItemFactory.voidType, dexItemFactory.intType),
-        method -> EnumUnboxingCfMethods.EnumUnboxingMethods_zeroCheck(appView.options(), method));
+        method -> EnumUnboxingCfMethods.EnumUnboxingMethods_zeroCheck(dexItemFactory, method));
   }
 
   public ProgramMethod ensureCheckNotZeroWithMessageMethod(AppView<AppInfoWithLiveness> appView) {
@@ -92,7 +92,7 @@
         dexItemFactory.createProto(
             dexItemFactory.voidType, dexItemFactory.intType, dexItemFactory.stringType),
         method ->
-            EnumUnboxingCfMethods.EnumUnboxingMethods_zeroCheckMessage(appView.options(), method));
+            EnumUnboxingCfMethods.EnumUnboxingMethods_zeroCheckMessage(dexItemFactory, method));
   }
 
   public ProgramMethod ensureCompareToMethod(AppView<AppInfoWithLiveness> appView) {
@@ -102,7 +102,7 @@
         dexItemFactory.enumMembers.compareTo.getName(),
         dexItemFactory.createProto(
             dexItemFactory.intType, dexItemFactory.intType, dexItemFactory.intType),
-        method -> EnumUnboxingCfMethods.EnumUnboxingMethods_compareTo(appView.options(), method));
+        method -> EnumUnboxingCfMethods.EnumUnboxingMethods_compareTo(dexItemFactory, method));
   }
 
   public ProgramMethod ensureEqualsMethod(AppView<AppInfoWithLiveness> appView) {
@@ -112,7 +112,7 @@
         dexItemFactory.enumMembers.equals.getName(),
         dexItemFactory.createProto(
             dexItemFactory.booleanType, dexItemFactory.intType, dexItemFactory.intType),
-        method -> EnumUnboxingCfMethods.EnumUnboxingMethods_equals(appView.options(), method));
+        method -> EnumUnboxingCfMethods.EnumUnboxingMethods_equals(dexItemFactory, method));
   }
 
   public ProgramMethod ensureOrdinalMethod(AppView<AppInfoWithLiveness> appView) {
@@ -121,7 +121,7 @@
         appView,
         dexItemFactory.enumMembers.ordinalMethod.getName(),
         dexItemFactory.createProto(dexItemFactory.intType, dexItemFactory.intType),
-        method -> EnumUnboxingCfMethods.EnumUnboxingMethods_ordinal(appView.options(), method));
+        method -> EnumUnboxingCfMethods.EnumUnboxingMethods_ordinal(dexItemFactory, method));
   }
 
   private ProgramMethod internalEnsureMethod(
diff --git a/src/main/java/com/android/tools/r8/ir/optimize/templates/CfUtilityMethodsForCodeOptimizations.java b/src/main/java/com/android/tools/r8/ir/optimize/templates/CfUtilityMethodsForCodeOptimizations.java
index d512ff4..f06beb7 100644
--- a/src/main/java/com/android/tools/r8/ir/optimize/templates/CfUtilityMethodsForCodeOptimizations.java
+++ b/src/main/java/com/android/tools/r8/ir/optimize/templates/CfUtilityMethodsForCodeOptimizations.java
@@ -23,7 +23,6 @@
 import com.android.tools.r8.graph.DexMethod;
 import com.android.tools.r8.ir.code.If;
 import com.android.tools.r8.ir.code.ValueType;
-import com.android.tools.r8.utils.InternalOptions;
 import com.google.common.collect.ImmutableList;
 import it.unimi.dsi.fastutil.ints.Int2ObjectAVLTreeMap;
 
@@ -39,7 +38,7 @@
 
   public static CfCode
       CfUtilityMethodsForCodeOptimizationsTemplates_throwClassCastExceptionIfNotNull(
-          InternalOptions options, DexMethod method) {
+          DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -53,23 +52,21 @@
             new CfLoad(ValueType.OBJECT, 0),
             new CfIf(If.Type.EQ, ValueType.OBJECT, label2),
             label1,
-            new CfNew(options.itemFactory.createType("Ljava/lang/ClassCastException;")),
+            new CfNew(factory.createType("Ljava/lang/ClassCastException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/ClassCastException;"),
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/ClassCastException;"),
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label2,
             new CfFrame(
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0},
-                    new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
-                    })),
+                    new FrameType[] {FrameType.initializedNonNullReference(factory.objectType)})),
             new CfReturnVoid(),
             label3),
         ImmutableList.of(),
@@ -77,7 +74,7 @@
   }
 
   public static CfCode CfUtilityMethodsForCodeOptimizationsTemplates_throwIllegalAccessError(
-      InternalOptions options, DexMethod method) {
+      DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     return new CfCode(
         method.holder,
@@ -85,14 +82,14 @@
         0,
         ImmutableList.of(
             label0,
-            new CfNew(options.itemFactory.createType("Ljava/lang/IllegalAccessError;")),
+            new CfNew(factory.createType("Ljava/lang/IllegalAccessError;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/IllegalAccessError;"),
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/IllegalAccessError;"),
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow()),
         ImmutableList.of(),
@@ -101,7 +98,7 @@
 
   public static CfCode
       CfUtilityMethodsForCodeOptimizationsTemplates_throwIncompatibleClassChangeError(
-          InternalOptions options, DexMethod method) {
+          DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     return new CfCode(
         method.holder,
@@ -109,14 +106,14 @@
         0,
         ImmutableList.of(
             label0,
-            new CfNew(options.itemFactory.createType("Ljava/lang/IncompatibleClassChangeError;")),
+            new CfNew(factory.createType("Ljava/lang/IncompatibleClassChangeError;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/IncompatibleClassChangeError;"),
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/IncompatibleClassChangeError;"),
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow()),
         ImmutableList.of(),
@@ -124,7 +121,7 @@
   }
 
   public static CfCode CfUtilityMethodsForCodeOptimizationsTemplates_throwNoSuchMethodError(
-      InternalOptions options, DexMethod method) {
+      DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     return new CfCode(
         method.holder,
@@ -132,14 +129,14 @@
         0,
         ImmutableList.of(
             label0,
-            new CfNew(options.itemFactory.createType("Ljava/lang/NoSuchMethodError;")),
+            new CfNew(factory.createType("Ljava/lang/NoSuchMethodError;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/NoSuchMethodError;"),
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/NoSuchMethodError;"),
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow()),
         ImmutableList.of(),
@@ -148,7 +145,7 @@
 
   public static CfCode
       CfUtilityMethodsForCodeOptimizationsTemplates_throwRuntimeExceptionWithMessage(
-          InternalOptions options, DexMethod method) {
+          DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     return new CfCode(
@@ -157,16 +154,15 @@
         1,
         ImmutableList.of(
             label0,
-            new CfNew(options.itemFactory.createType("Ljava/lang/RuntimeException;")),
+            new CfNew(factory.createType("Ljava/lang/RuntimeException;")),
             new CfStackInstruction(CfStackInstruction.Opcode.Dup),
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/lang/RuntimeException;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.stringType),
-                    options.itemFactory.createString("<init>")),
+                factory.createMethod(
+                    factory.createType("Ljava/lang/RuntimeException;"),
+                    factory.createProto(factory.voidType, factory.stringType),
+                    factory.createString("<init>")),
                 false),
             new CfThrow(),
             label1),
@@ -175,7 +171,7 @@
   }
 
   public static CfCode CfUtilityMethodsForCodeOptimizationsTemplates_toStringIfNotNull(
-      InternalOptions options, DexMethod method) {
+      DexItemFactory factory, DexMethod method) {
     CfLabel label0 = new CfLabel();
     CfLabel label1 = new CfLabel();
     CfLabel label2 = new CfLabel();
@@ -192,19 +188,17 @@
             new CfLoad(ValueType.OBJECT, 0),
             new CfInvoke(
                 182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.objectType,
-                    options.itemFactory.createProto(options.itemFactory.stringType),
-                    options.itemFactory.createString("toString")),
+                factory.createMethod(
+                    factory.objectType,
+                    factory.createProto(factory.stringType),
+                    factory.createString("toString")),
                 false),
             new CfStackInstruction(CfStackInstruction.Opcode.Pop),
             label2,
             new CfFrame(
                 new Int2ObjectAVLTreeMap<>(
                     new int[] {0},
-                    new FrameType[] {
-                      FrameType.initializedNonNullReference(options.itemFactory.objectType)
-                    })),
+                    new FrameType[] {FrameType.initializedNonNullReference(factory.objectType)})),
             new CfReturnVoid(),
             label3),
         ImmutableList.of(),
diff --git a/src/main/java/com/android/tools/r8/references/Reference.java b/src/main/java/com/android/tools/r8/references/Reference.java
index 75dfb4c..d5071d2 100644
--- a/src/main/java/com/android/tools/r8/references/Reference.java
+++ b/src/main/java/com/android/tools/r8/references/Reference.java
@@ -8,6 +8,7 @@
 import com.android.tools.r8.utils.DescriptorUtils;
 import com.google.common.collect.ImmutableList;
 import java.lang.reflect.Constructor;
+import java.lang.reflect.Executable;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import java.util.Collections;
@@ -119,6 +120,16 @@
         holderClass, methodName, ImmutableList.copyOf(formalTypes), returnType);
   }
 
+  /** Get a method reference from a Java reflection executable. */
+  public static MethodReference methodFromMethod(Executable executable) {
+    if (executable instanceof Constructor<?>) {
+      return methodFromMethod((Constructor<?>) executable);
+    } else {
+      assert executable instanceof Method;
+      return methodFromMethod((Method) executable);
+    }
+  }
+
   /** Get a method reference from a Java reflection method. */
   public static MethodReference methodFromMethod(Method method) {
     String methodName = method.getName();
diff --git a/src/main/java/com/android/tools/r8/startup/InstrumentationServer.java b/src/main/java/com/android/tools/r8/startup/InstrumentationServer.java
deleted file mode 100644
index 5b839c2..0000000
--- a/src/main/java/com/android/tools/r8/startup/InstrumentationServer.java
+++ /dev/null
@@ -1,122 +0,0 @@
-// Copyright (c) 2022, the R8 project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// ***********************************************************************************
-// GENERATED FILE. DO NOT EDIT! See InstrumentationServerClassGenerator.java.
-// ***********************************************************************************
-
-package com.android.tools.r8.startup;
-
-import com.android.tools.r8.ProgramResource.Kind;
-import com.android.tools.r8.cf.code.CfInvoke;
-import com.android.tools.r8.cf.code.CfLabel;
-import com.android.tools.r8.cf.code.CfLoad;
-import com.android.tools.r8.cf.code.CfReturn;
-import com.android.tools.r8.cf.code.CfReturnVoid;
-import com.android.tools.r8.graph.CfCode;
-import com.android.tools.r8.graph.ClassAccessFlags;
-import com.android.tools.r8.graph.DexAnnotationSet;
-import com.android.tools.r8.graph.DexEncodedField;
-import com.android.tools.r8.graph.DexEncodedMethod;
-import com.android.tools.r8.graph.DexItemFactory;
-import com.android.tools.r8.graph.DexMethod;
-import com.android.tools.r8.graph.DexProgramClass;
-import com.android.tools.r8.graph.DexTypeList;
-import com.android.tools.r8.graph.EnclosingMethodAttribute;
-import com.android.tools.r8.graph.GenericSignature.ClassSignature;
-import com.android.tools.r8.graph.MethodCollection.MethodCollectionFactory;
-import com.android.tools.r8.graph.NestHostClassAttribute;
-import com.android.tools.r8.ir.code.ValueType;
-import com.android.tools.r8.origin.Origin;
-import com.android.tools.r8.utils.InternalOptions;
-import com.google.common.collect.ImmutableList;
-import java.util.Collections;
-
-public final class InstrumentationServer {
-  public static DexProgramClass createClass(DexItemFactory dexItemFactory) {
-    return new DexProgramClass(
-        dexItemFactory.createType("Lcom/android/tools/r8/startup/InstrumentationServer;"),
-        Kind.CF,
-        Origin.unknown(),
-        ClassAccessFlags.fromCfAccessFlags(1025),
-        null,
-        DexTypeList.empty(),
-        dexItemFactory.createString("InstrumentationServer"),
-        NestHostClassAttribute.none(),
-        Collections.emptyList(),
-        Collections.emptyList(),
-        EnclosingMethodAttribute.none(),
-        Collections.emptyList(),
-        ClassSignature.noSignature(),
-        DexAnnotationSet.empty(),
-        createStaticFields(dexItemFactory),
-        createInstanceFields(dexItemFactory),
-        MethodCollectionFactory.fromMethods(
-            createDirectMethods(dexItemFactory), createVirtualMethods(dexItemFactory)),
-        dexItemFactory.getSkipNameValidationForTesting(),
-        DexProgramClass::invalidChecksumRequest);
-  }
-
-  private static DexEncodedField[] createInstanceFields(DexItemFactory dexItemFactory) {
-    return new DexEncodedField[] {};
-  }
-
-  private static DexEncodedField[] createStaticFields(DexItemFactory dexItemFactory) {
-    return new DexEncodedField[] {};
-  }
-
-  private static DexEncodedMethod[] createDirectMethods(DexItemFactory dexItemFactory) {
-    return new DexEncodedMethod[0];
-  }
-
-  private static DexEncodedMethod[] createVirtualMethods(DexItemFactory dexItemFactory) {
-    return new DexEncodedMethod[0];
-  }
-
-  public static CfCode createInstanceInitializerCfCode0(InternalOptions options, DexMethod method) {
-    CfLabel label0 = new CfLabel();
-    CfLabel label1 = new CfLabel();
-    return new CfCode(
-        method.holder,
-        1,
-        1,
-        ImmutableList.of(
-            label0,
-            new CfLoad(ValueType.OBJECT, 0),
-            new CfInvoke(
-                183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.objectType,
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
-                false),
-            new CfReturnVoid(),
-            label1),
-        ImmutableList.of(),
-        ImmutableList.of());
-  }
-
-  public static CfCode createCfCode1_getInstance(InternalOptions options, DexMethod method) {
-    CfLabel label0 = new CfLabel();
-    return new CfCode(
-        method.holder,
-        1,
-        0,
-        ImmutableList.of(
-            label0,
-            new CfInvoke(
-                184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType(
-                        "Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType(
-                            "Lcom/android/tools/r8/startup/InstrumentationServerImpl;")),
-                    options.itemFactory.createString("getInstance")),
-                false),
-            new CfReturn(ValueType.OBJECT)),
-        ImmutableList.of(),
-        ImmutableList.of());
-  }
-}
diff --git a/src/main/java/com/android/tools/r8/startup/InstrumentationServerImpl.java b/src/main/java/com/android/tools/r8/startup/InstrumentationServerImpl.java
deleted file mode 100644
index cc0ab24..0000000
--- a/src/main/java/com/android/tools/r8/startup/InstrumentationServerImpl.java
+++ /dev/null
@@ -1,569 +0,0 @@
-// Copyright (c) 2022, the R8 project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// ***********************************************************************************
-// GENERATED FILE. DO NOT EDIT! See InstrumentationServerClassGenerator.java.
-// ***********************************************************************************
-
-package com.android.tools.r8.startup;
-
-import com.android.tools.r8.ProgramResource.Kind;
-import com.android.tools.r8.androidapi.ComputedApiLevel;
-import com.android.tools.r8.cf.code.CfConstNumber;
-import com.android.tools.r8.cf.code.CfConstString;
-import com.android.tools.r8.cf.code.CfFrame;
-import com.android.tools.r8.cf.code.CfGoto;
-import com.android.tools.r8.cf.code.CfInstanceFieldRead;
-import com.android.tools.r8.cf.code.CfInstanceFieldWrite;
-import com.android.tools.r8.cf.code.CfInvoke;
-import com.android.tools.r8.cf.code.CfLabel;
-import com.android.tools.r8.cf.code.CfLoad;
-import com.android.tools.r8.cf.code.CfNew;
-import com.android.tools.r8.cf.code.CfReturn;
-import com.android.tools.r8.cf.code.CfReturnVoid;
-import com.android.tools.r8.cf.code.CfStackInstruction;
-import com.android.tools.r8.cf.code.CfStaticFieldRead;
-import com.android.tools.r8.cf.code.CfStaticFieldWrite;
-import com.android.tools.r8.cf.code.CfStore;
-import com.android.tools.r8.cf.code.CfThrow;
-import com.android.tools.r8.cf.code.CfTryCatch;
-import com.android.tools.r8.cf.code.frame.FrameType;
-import com.android.tools.r8.graph.CfCode;
-import com.android.tools.r8.graph.ClassAccessFlags;
-import com.android.tools.r8.graph.DexAnnotationSet;
-import com.android.tools.r8.graph.DexEncodedField;
-import com.android.tools.r8.graph.DexEncodedMethod;
-import com.android.tools.r8.graph.DexItemFactory;
-import com.android.tools.r8.graph.DexMethod;
-import com.android.tools.r8.graph.DexProgramClass;
-import com.android.tools.r8.graph.DexTypeList;
-import com.android.tools.r8.graph.EnclosingMethodAttribute;
-import com.android.tools.r8.graph.FieldAccessFlags;
-import com.android.tools.r8.graph.GenericSignature.ClassSignature;
-import com.android.tools.r8.graph.MethodCollection.MethodCollectionFactory;
-import com.android.tools.r8.graph.NestHostClassAttribute;
-import com.android.tools.r8.ir.code.ValueType;
-import com.android.tools.r8.origin.Origin;
-import com.android.tools.r8.utils.InternalOptions;
-import com.google.common.collect.ImmutableList;
-import it.unimi.dsi.fastutil.ints.Int2ObjectAVLTreeMap;
-import java.util.ArrayDeque;
-import java.util.Arrays;
-import java.util.Collections;
-
-public final class InstrumentationServerImpl {
-  public static DexProgramClass createClass(DexItemFactory dexItemFactory) {
-    return new DexProgramClass(
-        dexItemFactory.createType("Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
-        Kind.CF,
-        Origin.unknown(),
-        ClassAccessFlags.fromCfAccessFlags(1),
-        null,
-        DexTypeList.empty(),
-        dexItemFactory.createString("InstrumentationServerImpl"),
-        NestHostClassAttribute.none(),
-        Collections.emptyList(),
-        Collections.emptyList(),
-        EnclosingMethodAttribute.none(),
-        Collections.emptyList(),
-        ClassSignature.noSignature(),
-        DexAnnotationSet.empty(),
-        createStaticFields(dexItemFactory),
-        createInstanceFields(dexItemFactory),
-        MethodCollectionFactory.fromMethods(
-            createDirectMethods(dexItemFactory), createVirtualMethods(dexItemFactory)),
-        dexItemFactory.getSkipNameValidationForTesting(),
-        DexProgramClass::invalidChecksumRequest);
-  }
-
-  private static DexEncodedField[] createInstanceFields(DexItemFactory dexItemFactory) {
-    return new DexEncodedField[] {
-      DexEncodedField.syntheticBuilder()
-          .setField(
-              dexItemFactory.createField(
-                  dexItemFactory.createType(
-                      "Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
-                  dexItemFactory.createType("Ljava/lang/StringBuilder;"),
-                  dexItemFactory.createString("builder")))
-          .setAccessFlags(FieldAccessFlags.fromCfAccessFlags(18))
-          .setApiLevel(ComputedApiLevel.unknown())
-          .build(),
-      DexEncodedField.syntheticBuilder()
-          .setField(
-              dexItemFactory.createField(
-                  dexItemFactory.createType(
-                      "Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
-                  dexItemFactory.createType("Z"),
-                  dexItemFactory.createString("writeToLogcat")))
-          .setAccessFlags(FieldAccessFlags.fromCfAccessFlags(18))
-          .setApiLevel(ComputedApiLevel.unknown())
-          .build(),
-      DexEncodedField.syntheticBuilder()
-          .setField(
-              dexItemFactory.createField(
-                  dexItemFactory.createType(
-                      "Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
-                  dexItemFactory.createType("Ljava/lang/String;"),
-                  dexItemFactory.createString("logcatTag")))
-          .setAccessFlags(FieldAccessFlags.fromCfAccessFlags(18))
-          .setApiLevel(ComputedApiLevel.unknown())
-          .build()
-    };
-  }
-
-  private static DexEncodedField[] createStaticFields(DexItemFactory dexItemFactory) {
-    return new DexEncodedField[] {
-      DexEncodedField.syntheticBuilder()
-          .setField(
-              dexItemFactory.createField(
-                  dexItemFactory.createType(
-                      "Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
-                  dexItemFactory.createType(
-                      "Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
-                  dexItemFactory.createString("INSTANCE")))
-          .setAccessFlags(FieldAccessFlags.fromCfAccessFlags(26))
-          .setApiLevel(ComputedApiLevel.unknown())
-          .build()
-    };
-  }
-
-  private static DexEncodedMethod[] createDirectMethods(DexItemFactory dexItemFactory) {
-    return new DexEncodedMethod[0];
-  }
-
-  private static DexEncodedMethod[] createVirtualMethods(DexItemFactory dexItemFactory) {
-    return new DexEncodedMethod[0];
-  }
-
-  public static CfCode createClassInitializerCfCode(InternalOptions options, DexMethod method) {
-    CfLabel label0 = new CfLabel();
-    return new CfCode(
-        method.holder,
-        2,
-        0,
-        ImmutableList.of(
-            label0,
-            new CfNew(
-                options.itemFactory.createType(
-                    "Lcom/android/tools/r8/startup/InstrumentationServerImpl;")),
-            new CfStackInstruction(CfStackInstruction.Opcode.Dup),
-            new CfInvoke(
-                183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType(
-                        "Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
-                false),
-            new CfStaticFieldWrite(
-                options.itemFactory.createField(
-                    options.itemFactory.createType(
-                        "Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
-                    options.itemFactory.createType(
-                        "Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
-                    options.itemFactory.createString("INSTANCE"))),
-            new CfReturnVoid()),
-        ImmutableList.of(),
-        ImmutableList.of());
-  }
-
-  public static CfCode createInstanceInitializerCfCode1(InternalOptions options, DexMethod method) {
-    CfLabel label0 = new CfLabel();
-    CfLabel label1 = new CfLabel();
-    CfLabel label2 = new CfLabel();
-    CfLabel label3 = new CfLabel();
-    CfLabel label4 = new CfLabel();
-    CfLabel label5 = new CfLabel();
-    return new CfCode(
-        method.holder,
-        3,
-        1,
-        ImmutableList.of(
-            label0,
-            new CfLoad(ValueType.OBJECT, 0),
-            new CfInvoke(
-                183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType(
-                        "Lcom/android/tools/r8/startup/InstrumentationServer;"),
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
-                false),
-            label1,
-            new CfLoad(ValueType.OBJECT, 0),
-            new CfNew(options.itemFactory.stringBuilderType),
-            new CfStackInstruction(CfStackInstruction.Opcode.Dup),
-            new CfInvoke(
-                183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
-                false),
-            new CfInstanceFieldWrite(
-                options.itemFactory.createField(
-                    options.itemFactory.createType(
-                        "Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createString("builder"))),
-            label2,
-            new CfLoad(ValueType.OBJECT, 0),
-            new CfConstNumber(0, ValueType.INT),
-            new CfInstanceFieldWrite(
-                options.itemFactory.createField(
-                    options.itemFactory.createType(
-                        "Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
-                    options.itemFactory.booleanType,
-                    options.itemFactory.createString("writeToLogcat"))),
-            label3,
-            new CfLoad(ValueType.OBJECT, 0),
-            new CfConstString(options.itemFactory.createString("r8")),
-            new CfInstanceFieldWrite(
-                options.itemFactory.createField(
-                    options.itemFactory.createType(
-                        "Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
-                    options.itemFactory.stringType,
-                    options.itemFactory.createString("logcatTag"))),
-            label4,
-            new CfReturnVoid(),
-            label5),
-        ImmutableList.of(),
-        ImmutableList.of());
-  }
-
-  public static CfCode createCfCode2_addLine(InternalOptions options, DexMethod method) {
-    CfLabel label0 = new CfLabel();
-    CfLabel label1 = new CfLabel();
-    CfLabel label2 = new CfLabel();
-    return new CfCode(
-        method.holder,
-        2,
-        2,
-        ImmutableList.of(
-            label0,
-            new CfLoad(ValueType.OBJECT, 0),
-            new CfInstanceFieldRead(
-                options.itemFactory.createField(
-                    options.itemFactory.createType(
-                        "Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createString("builder"))),
-            new CfLoad(ValueType.OBJECT, 1),
-            new CfInvoke(
-                182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.stringType),
-                    options.itemFactory.createString("append")),
-                false),
-            new CfConstNumber(10, ValueType.INT),
-            new CfInvoke(
-                182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.charType),
-                    options.itemFactory.createString("append")),
-                false),
-            new CfStackInstruction(CfStackInstruction.Opcode.Pop),
-            label1,
-            new CfReturnVoid(),
-            label2),
-        ImmutableList.of(),
-        ImmutableList.of());
-  }
-
-  public static CfCode createCfCode3_addNonSyntheticMethod(
-      InternalOptions options, DexMethod method) {
-    CfLabel label0 = new CfLabel();
-    CfLabel label1 = new CfLabel();
-    CfLabel label2 = new CfLabel();
-    return new CfCode(
-        method.holder,
-        2,
-        1,
-        ImmutableList.of(
-            label0,
-            new CfInvoke(
-                184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType(
-                        "Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType(
-                            "Lcom/android/tools/r8/startup/InstrumentationServerImpl;")),
-                    options.itemFactory.createString("getInstance")),
-                false),
-            new CfLoad(ValueType.OBJECT, 0),
-            new CfInvoke(
-                183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType(
-                        "Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.stringType),
-                    options.itemFactory.createString("addLine")),
-                false),
-            label1,
-            new CfReturnVoid(),
-            label2),
-        ImmutableList.of(),
-        ImmutableList.of());
-  }
-
-  public static CfCode createCfCode4_addSyntheticMethod(InternalOptions options, DexMethod method) {
-    CfLabel label0 = new CfLabel();
-    CfLabel label1 = new CfLabel();
-    CfLabel label2 = new CfLabel();
-    return new CfCode(
-        method.holder,
-        3,
-        1,
-        ImmutableList.of(
-            label0,
-            new CfInvoke(
-                184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType(
-                        "Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType(
-                            "Lcom/android/tools/r8/startup/InstrumentationServerImpl;")),
-                    options.itemFactory.createString("getInstance")),
-                false),
-            new CfNew(options.itemFactory.stringBuilderType),
-            new CfStackInstruction(CfStackInstruction.Opcode.Dup),
-            new CfInvoke(
-                183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("<init>")),
-                false),
-            new CfConstNumber(83, ValueType.INT),
-            new CfInvoke(
-                182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.charType),
-                    options.itemFactory.createString("append")),
-                false),
-            new CfLoad(ValueType.OBJECT, 0),
-            new CfInvoke(
-                182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.stringBuilderType, options.itemFactory.stringType),
-                    options.itemFactory.createString("append")),
-                false),
-            new CfInvoke(
-                182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(options.itemFactory.stringType),
-                    options.itemFactory.createString("toString")),
-                false),
-            new CfInvoke(
-                183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType(
-                        "Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.stringType),
-                    options.itemFactory.createString("addLine")),
-                false),
-            label1,
-            new CfReturnVoid(),
-            label2),
-        ImmutableList.of(),
-        ImmutableList.of());
-  }
-
-  public static CfCode createCfCode5_getInstance(InternalOptions options, DexMethod method) {
-    CfLabel label0 = new CfLabel();
-    return new CfCode(
-        method.holder,
-        1,
-        0,
-        ImmutableList.of(
-            label0,
-            new CfStaticFieldRead(
-                options.itemFactory.createField(
-                    options.itemFactory.createType(
-                        "Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
-                    options.itemFactory.createType(
-                        "Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
-                    options.itemFactory.createString("INSTANCE"))),
-            new CfReturn(ValueType.OBJECT)),
-        ImmutableList.of(),
-        ImmutableList.of());
-  }
-
-  public static CfCode createCfCode6_writeToFile(InternalOptions options, DexMethod method) {
-    CfLabel label0 = new CfLabel();
-    CfLabel label1 = new CfLabel();
-    CfLabel label2 = new CfLabel();
-    CfLabel label3 = new CfLabel();
-    CfLabel label4 = new CfLabel();
-    CfLabel label5 = new CfLabel();
-    CfLabel label6 = new CfLabel();
-    CfLabel label7 = new CfLabel();
-    return new CfCode(
-        method.holder,
-        3,
-        4,
-        ImmutableList.of(
-            label0,
-            new CfNew(options.itemFactory.createType("Ljava/io/FileOutputStream;")),
-            new CfStackInstruction(CfStackInstruction.Opcode.Dup),
-            new CfLoad(ValueType.OBJECT, 1),
-            new CfInvoke(
-                183,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/io/FileOutputStream;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType,
-                        options.itemFactory.createType("Ljava/io/File;")),
-                    options.itemFactory.createString("<init>")),
-                false),
-            new CfStore(ValueType.OBJECT, 2),
-            label1,
-            new CfLoad(ValueType.OBJECT, 2),
-            new CfLoad(ValueType.OBJECT, 0),
-            new CfInstanceFieldRead(
-                options.itemFactory.createField(
-                    options.itemFactory.createType(
-                        "Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createString("builder"))),
-            new CfInvoke(
-                182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringBuilderType,
-                    options.itemFactory.createProto(options.itemFactory.stringType),
-                    options.itemFactory.createString("toString")),
-                false),
-            new CfConstString(options.itemFactory.createString("UTF-8")),
-            new CfInvoke(
-                184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/nio/charset/Charset;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.createType("Ljava/nio/charset/Charset;"),
-                        options.itemFactory.stringType),
-                    options.itemFactory.createString("forName")),
-                false),
-            new CfInvoke(
-                182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.stringType,
-                    options.itemFactory.createProto(
-                        options.itemFactory.byteArrayType,
-                        options.itemFactory.createType("Ljava/nio/charset/Charset;")),
-                    options.itemFactory.createString("getBytes")),
-                false),
-            new CfInvoke(
-                182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/io/FileOutputStream;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.voidType, options.itemFactory.byteArrayType),
-                    options.itemFactory.createString("write")),
-                false),
-            label2,
-            new CfLoad(ValueType.OBJECT, 2),
-            new CfInvoke(
-                182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/io/FileOutputStream;"),
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("close")),
-                false),
-            label3,
-            new CfGoto(label6),
-            label4,
-            new CfFrame(
-                new Int2ObjectAVLTreeMap<>(
-                    new int[] {0, 1, 2},
-                    new FrameType[] {
-                      FrameType.initializedNonNullReference(
-                          options.itemFactory.createType(
-                              "Lcom/android/tools/r8/startup/InstrumentationServerImpl;")),
-                      FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/io/File;")),
-                      FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/io/FileOutputStream;"))
-                    }),
-                new ArrayDeque<>(
-                    Arrays.asList(
-                        FrameType.initializedNonNullReference(options.itemFactory.throwableType)))),
-            new CfStore(ValueType.OBJECT, 3),
-            new CfLoad(ValueType.OBJECT, 2),
-            new CfInvoke(
-                182,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Ljava/io/FileOutputStream;"),
-                    options.itemFactory.createProto(options.itemFactory.voidType),
-                    options.itemFactory.createString("close")),
-                false),
-            label5,
-            new CfLoad(ValueType.OBJECT, 3),
-            new CfThrow(),
-            label6,
-            new CfFrame(
-                new Int2ObjectAVLTreeMap<>(
-                    new int[] {0, 1, 2},
-                    new FrameType[] {
-                      FrameType.initializedNonNullReference(
-                          options.itemFactory.createType(
-                              "Lcom/android/tools/r8/startup/InstrumentationServerImpl;")),
-                      FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/io/File;")),
-                      FrameType.initializedNonNullReference(
-                          options.itemFactory.createType("Ljava/io/FileOutputStream;"))
-                    })),
-            new CfReturnVoid(),
-            label7),
-        ImmutableList.of(
-            new CfTryCatch(
-                label1,
-                label2,
-                ImmutableList.of(options.itemFactory.throwableType),
-                ImmutableList.of(label4))),
-        ImmutableList.of());
-  }
-
-  public static CfCode createCfCode7_writeToLogcat(InternalOptions options, DexMethod method) {
-    CfLabel label0 = new CfLabel();
-    CfLabel label1 = new CfLabel();
-    CfLabel label2 = new CfLabel();
-    return new CfCode(
-        method.holder,
-        2,
-        2,
-        ImmutableList.of(
-            label0,
-            new CfConstString(options.itemFactory.createString("r8")),
-            new CfLoad(ValueType.OBJECT, 1),
-            new CfInvoke(
-                184,
-                options.itemFactory.createMethod(
-                    options.itemFactory.createType("Landroid/util/Log;"),
-                    options.itemFactory.createProto(
-                        options.itemFactory.intType,
-                        options.itemFactory.stringType,
-                        options.itemFactory.stringType),
-                    options.itemFactory.createString("v")),
-                false),
-            new CfStackInstruction(CfStackInstruction.Opcode.Pop),
-            label1,
-            new CfReturnVoid(),
-            label2),
-        ImmutableList.of(),
-        ImmutableList.of());
-  }
-}
diff --git a/src/main/java/com/android/tools/r8/startup/generated/InstrumentationServerFactory.java b/src/main/java/com/android/tools/r8/startup/generated/InstrumentationServerFactory.java
new file mode 100644
index 0000000..cbbfc33
--- /dev/null
+++ b/src/main/java/com/android/tools/r8/startup/generated/InstrumentationServerFactory.java
@@ -0,0 +1,163 @@
+// Copyright (c) 2022, the R8 project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// ***********************************************************************************
+// GENERATED FILE. DO NOT EDIT! See InstrumentationServerClassGenerator.java.
+// ***********************************************************************************
+
+package com.android.tools.r8.startup.generated;
+
+import com.android.tools.r8.ProgramResource.Kind;
+import com.android.tools.r8.androidapi.ComputedApiLevel;
+import com.android.tools.r8.cf.CfVersion;
+import com.android.tools.r8.cf.code.CfInvoke;
+import com.android.tools.r8.cf.code.CfLabel;
+import com.android.tools.r8.cf.code.CfLoad;
+import com.android.tools.r8.cf.code.CfReturn;
+import com.android.tools.r8.cf.code.CfReturnVoid;
+import com.android.tools.r8.graph.CfCode;
+import com.android.tools.r8.graph.ClassAccessFlags;
+import com.android.tools.r8.graph.DexAnnotationSet;
+import com.android.tools.r8.graph.DexEncodedField;
+import com.android.tools.r8.graph.DexEncodedMethod;
+import com.android.tools.r8.graph.DexItemFactory;
+import com.android.tools.r8.graph.DexMethod;
+import com.android.tools.r8.graph.DexProgramClass;
+import com.android.tools.r8.graph.DexTypeList;
+import com.android.tools.r8.graph.EnclosingMethodAttribute;
+import com.android.tools.r8.graph.GenericSignature.ClassSignature;
+import com.android.tools.r8.graph.MethodAccessFlags;
+import com.android.tools.r8.graph.MethodCollection.MethodCollectionFactory;
+import com.android.tools.r8.graph.NestHostClassAttribute;
+import com.android.tools.r8.ir.code.ValueType;
+import com.android.tools.r8.origin.Origin;
+import com.google.common.collect.ImmutableList;
+import java.util.Collections;
+
+public final class InstrumentationServerFactory {
+  public static DexProgramClass createClass(DexItemFactory dexItemFactory) {
+    return new DexProgramClass(
+        dexItemFactory.createType(
+            "Lcom/android/tools/r8/startup/generated/InstrumentationServerFactory;"),
+        Kind.CF,
+        Origin.unknown(),
+        ClassAccessFlags.fromCfAccessFlags(1025),
+        null,
+        DexTypeList.empty(),
+        dexItemFactory.createString("InstrumentationServerFactory"),
+        NestHostClassAttribute.none(),
+        Collections.emptyList(),
+        Collections.emptyList(),
+        EnclosingMethodAttribute.none(),
+        Collections.emptyList(),
+        ClassSignature.noSignature(),
+        DexAnnotationSet.empty(),
+        createStaticFields(dexItemFactory),
+        createInstanceFields(dexItemFactory),
+        MethodCollectionFactory.fromMethods(
+            createDirectMethods(dexItemFactory), createVirtualMethods(dexItemFactory)),
+        dexItemFactory.getSkipNameValidationForTesting(),
+        DexProgramClass::invalidChecksumRequest);
+  }
+
+  private static DexEncodedField[] createInstanceFields(DexItemFactory dexItemFactory) {
+    return new DexEncodedField[] {};
+  }
+
+  private static DexEncodedField[] createStaticFields(DexItemFactory dexItemFactory) {
+    return new DexEncodedField[] {};
+  }
+
+  private static DexEncodedMethod[] createDirectMethods(DexItemFactory dexItemFactory) {
+    return new DexEncodedMethod[] {
+      DexEncodedMethod.syntheticBuilder()
+          .setAccessFlags(MethodAccessFlags.fromCfAccessFlags(9, false))
+          .setApiLevelForCode(ComputedApiLevel.unknown())
+          .setApiLevelForDefinition(ComputedApiLevel.unknown())
+          .setClassFileVersion(CfVersion.V1_8)
+          .setMethod(
+              dexItemFactory.createMethod(
+                  dexItemFactory.createType("Lcom/android/tools/r8/startup/InstrumentationServer;"),
+                  dexItemFactory.createProto(
+                      dexItemFactory.createType(
+                          "Lcom/android/tools/r8/startup/InstrumentationServer;")),
+                  dexItemFactory.createString("getInstance")))
+          .setCode(method -> createCfCode1_getInstance(dexItemFactory, method))
+          .build()
+    };
+  }
+
+  private static DexEncodedMethod[] createVirtualMethods(DexItemFactory dexItemFactory) {
+    return new DexEncodedMethod[] {
+      DexEncodedMethod.syntheticBuilder()
+          .setAccessFlags(MethodAccessFlags.fromCfAccessFlags(1, false))
+          .setApiLevelForCode(ComputedApiLevel.unknown())
+          .setApiLevelForDefinition(ComputedApiLevel.unknown())
+          .setClassFileVersion(CfVersion.V1_8)
+          .setMethod(
+              dexItemFactory.createInstanceInitializer(
+                  dexItemFactory.createType(
+                      "Lcom/android/tools/r8/startup/InstrumentationServer;")))
+          .setCode(method -> createInstanceInitializerCfCode0(dexItemFactory, method))
+          .build(),
+      DexEncodedMethod.syntheticBuilder()
+          .setAccessFlags(MethodAccessFlags.fromCfAccessFlags(1025, false))
+          .setApiLevelForCode(ComputedApiLevel.unknown())
+          .setApiLevelForDefinition(ComputedApiLevel.unknown())
+          .setClassFileVersion(CfVersion.V1_8)
+          .setMethod(
+              dexItemFactory.createMethod(
+                  dexItemFactory.createType("Lcom/android/tools/r8/startup/InstrumentationServer;"),
+                  dexItemFactory.createProto(
+                      dexItemFactory.createType("V"), dexItemFactory.createType("Ljava/io/File;")),
+                  dexItemFactory.createString("writeToFile")))
+          .build()
+    };
+  }
+
+  public static CfCode createInstanceInitializerCfCode0(DexItemFactory factory, DexMethod method) {
+    CfLabel label0 = new CfLabel();
+    CfLabel label1 = new CfLabel();
+    return new CfCode(
+        method.holder,
+        1,
+        1,
+        ImmutableList.of(
+            label0,
+            new CfLoad(ValueType.OBJECT, 0),
+            new CfInvoke(
+                183,
+                factory.createMethod(
+                    factory.objectType,
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
+                false),
+            new CfReturnVoid(),
+            label1),
+        ImmutableList.of(),
+        ImmutableList.of());
+  }
+
+  public static CfCode createCfCode1_getInstance(DexItemFactory factory, DexMethod method) {
+    CfLabel label0 = new CfLabel();
+    return new CfCode(
+        method.holder,
+        1,
+        0,
+        ImmutableList.of(
+            label0,
+            new CfInvoke(
+                184,
+                factory.createMethod(
+                    factory.createType("Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
+                    factory.createProto(
+                        factory.createType(
+                            "Lcom/android/tools/r8/startup/InstrumentationServerImpl;")),
+                    factory.createString("getInstance")),
+                false),
+            new CfReturn(ValueType.OBJECT)),
+        ImmutableList.of(),
+        ImmutableList.of());
+  }
+}
diff --git a/src/main/java/com/android/tools/r8/startup/generated/InstrumentationServerImplFactory.java b/src/main/java/com/android/tools/r8/startup/generated/InstrumentationServerImplFactory.java
new file mode 100644
index 0000000..f0c8f9b
--- /dev/null
+++ b/src/main/java/com/android/tools/r8/startup/generated/InstrumentationServerImplFactory.java
@@ -0,0 +1,637 @@
+// Copyright (c) 2022, the R8 project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// ***********************************************************************************
+// GENERATED FILE. DO NOT EDIT! See InstrumentationServerClassGenerator.java.
+// ***********************************************************************************
+
+package com.android.tools.r8.startup.generated;
+
+import com.android.tools.r8.ProgramResource.Kind;
+import com.android.tools.r8.androidapi.ComputedApiLevel;
+import com.android.tools.r8.cf.CfVersion;
+import com.android.tools.r8.cf.code.CfConstNumber;
+import com.android.tools.r8.cf.code.CfConstString;
+import com.android.tools.r8.cf.code.CfFrame;
+import com.android.tools.r8.cf.code.CfGoto;
+import com.android.tools.r8.cf.code.CfInstanceFieldRead;
+import com.android.tools.r8.cf.code.CfInstanceFieldWrite;
+import com.android.tools.r8.cf.code.CfInvoke;
+import com.android.tools.r8.cf.code.CfLabel;
+import com.android.tools.r8.cf.code.CfLoad;
+import com.android.tools.r8.cf.code.CfNew;
+import com.android.tools.r8.cf.code.CfReturn;
+import com.android.tools.r8.cf.code.CfReturnVoid;
+import com.android.tools.r8.cf.code.CfStackInstruction;
+import com.android.tools.r8.cf.code.CfStaticFieldRead;
+import com.android.tools.r8.cf.code.CfStaticFieldWrite;
+import com.android.tools.r8.cf.code.CfStore;
+import com.android.tools.r8.cf.code.CfThrow;
+import com.android.tools.r8.cf.code.CfTryCatch;
+import com.android.tools.r8.cf.code.frame.FrameType;
+import com.android.tools.r8.graph.CfCode;
+import com.android.tools.r8.graph.ClassAccessFlags;
+import com.android.tools.r8.graph.DexAnnotationSet;
+import com.android.tools.r8.graph.DexEncodedField;
+import com.android.tools.r8.graph.DexEncodedMethod;
+import com.android.tools.r8.graph.DexItemFactory;
+import com.android.tools.r8.graph.DexMethod;
+import com.android.tools.r8.graph.DexProgramClass;
+import com.android.tools.r8.graph.DexTypeList;
+import com.android.tools.r8.graph.EnclosingMethodAttribute;
+import com.android.tools.r8.graph.FieldAccessFlags;
+import com.android.tools.r8.graph.GenericSignature.ClassSignature;
+import com.android.tools.r8.graph.MethodAccessFlags;
+import com.android.tools.r8.graph.MethodCollection.MethodCollectionFactory;
+import com.android.tools.r8.graph.NestHostClassAttribute;
+import com.android.tools.r8.ir.code.ValueType;
+import com.android.tools.r8.origin.Origin;
+import com.google.common.collect.ImmutableList;
+import it.unimi.dsi.fastutil.ints.Int2ObjectAVLTreeMap;
+import java.util.ArrayDeque;
+import java.util.Arrays;
+import java.util.Collections;
+
+public final class InstrumentationServerImplFactory {
+  public static DexProgramClass createClass(DexItemFactory dexItemFactory) {
+    return new DexProgramClass(
+        dexItemFactory.createType(
+            "Lcom/android/tools/r8/startup/generated/InstrumentationServerImplFactory;"),
+        Kind.CF,
+        Origin.unknown(),
+        ClassAccessFlags.fromCfAccessFlags(1),
+        null,
+        DexTypeList.empty(),
+        dexItemFactory.createString("InstrumentationServerImplFactory"),
+        NestHostClassAttribute.none(),
+        Collections.emptyList(),
+        Collections.emptyList(),
+        EnclosingMethodAttribute.none(),
+        Collections.emptyList(),
+        ClassSignature.noSignature(),
+        DexAnnotationSet.empty(),
+        createStaticFields(dexItemFactory),
+        createInstanceFields(dexItemFactory),
+        MethodCollectionFactory.fromMethods(
+            createDirectMethods(dexItemFactory), createVirtualMethods(dexItemFactory)),
+        dexItemFactory.getSkipNameValidationForTesting(),
+        DexProgramClass::invalidChecksumRequest);
+  }
+
+  private static DexEncodedField[] createInstanceFields(DexItemFactory dexItemFactory) {
+    return new DexEncodedField[] {
+      DexEncodedField.syntheticBuilder()
+          .setField(
+              dexItemFactory.createField(
+                  dexItemFactory.createType(
+                      "Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
+                  dexItemFactory.createType("Ljava/lang/StringBuilder;"),
+                  dexItemFactory.createString("builder")))
+          .setAccessFlags(FieldAccessFlags.fromCfAccessFlags(18))
+          .setApiLevel(ComputedApiLevel.unknown())
+          .build(),
+      DexEncodedField.syntheticBuilder()
+          .setField(
+              dexItemFactory.createField(
+                  dexItemFactory.createType(
+                      "Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
+                  dexItemFactory.createType("Ljava/lang/String;"),
+                  dexItemFactory.createString("logcatTag")))
+          .setAccessFlags(FieldAccessFlags.fromCfAccessFlags(18))
+          .setApiLevel(ComputedApiLevel.unknown())
+          .build(),
+      DexEncodedField.syntheticBuilder()
+          .setField(
+              dexItemFactory.createField(
+                  dexItemFactory.createType(
+                      "Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
+                  dexItemFactory.createType("Z"),
+                  dexItemFactory.createString("writeToLogcat")))
+          .setAccessFlags(FieldAccessFlags.fromCfAccessFlags(18))
+          .setApiLevel(ComputedApiLevel.unknown())
+          .build()
+    };
+  }
+
+  private static DexEncodedField[] createStaticFields(DexItemFactory dexItemFactory) {
+    return new DexEncodedField[] {
+      DexEncodedField.syntheticBuilder()
+          .setField(
+              dexItemFactory.createField(
+                  dexItemFactory.createType(
+                      "Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
+                  dexItemFactory.createType(
+                      "Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
+                  dexItemFactory.createString("INSTANCE")))
+          .setAccessFlags(FieldAccessFlags.fromCfAccessFlags(26))
+          .setApiLevel(ComputedApiLevel.unknown())
+          .build()
+    };
+  }
+
+  private static DexEncodedMethod[] createDirectMethods(DexItemFactory dexItemFactory) {
+    return new DexEncodedMethod[] {
+      DexEncodedMethod.syntheticBuilder()
+          .setAccessFlags(MethodAccessFlags.fromCfAccessFlags(2, false))
+          .setApiLevelForCode(ComputedApiLevel.unknown())
+          .setApiLevelForDefinition(ComputedApiLevel.unknown())
+          .setClassFileVersion(CfVersion.V1_8)
+          .setMethod(
+              dexItemFactory.createInstanceInitializer(
+                  dexItemFactory.createType(
+                      "Lcom/android/tools/r8/startup/InstrumentationServerImpl;")))
+          .setCode(method -> createInstanceInitializerCfCode1(dexItemFactory, method))
+          .build(),
+      DexEncodedMethod.syntheticBuilder()
+          .setAccessFlags(MethodAccessFlags.fromCfAccessFlags(34, false))
+          .setApiLevelForCode(ComputedApiLevel.unknown())
+          .setApiLevelForDefinition(ComputedApiLevel.unknown())
+          .setClassFileVersion(CfVersion.V1_8)
+          .setMethod(
+              dexItemFactory.createMethod(
+                  dexItemFactory.createType(
+                      "Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
+                  dexItemFactory.createProto(
+                      dexItemFactory.createType("V"),
+                      dexItemFactory.createType("Ljava/lang/String;")),
+                  dexItemFactory.createString("addLine")))
+          .setCode(method -> createCfCode2_addLine(dexItemFactory, method))
+          .build(),
+      DexEncodedMethod.syntheticBuilder()
+          .setAccessFlags(MethodAccessFlags.fromCfAccessFlags(9, false))
+          .setApiLevelForCode(ComputedApiLevel.unknown())
+          .setApiLevelForDefinition(ComputedApiLevel.unknown())
+          .setClassFileVersion(CfVersion.V1_8)
+          .setMethod(
+              dexItemFactory.createMethod(
+                  dexItemFactory.createType(
+                      "Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
+                  dexItemFactory.createProto(
+                      dexItemFactory.createType("V"),
+                      dexItemFactory.createType("Ljava/lang/String;")),
+                  dexItemFactory.createString("addNonSyntheticMethod")))
+          .setCode(method -> createCfCode3_addNonSyntheticMethod(dexItemFactory, method))
+          .build(),
+      DexEncodedMethod.syntheticBuilder()
+          .setAccessFlags(MethodAccessFlags.fromCfAccessFlags(9, false))
+          .setApiLevelForCode(ComputedApiLevel.unknown())
+          .setApiLevelForDefinition(ComputedApiLevel.unknown())
+          .setClassFileVersion(CfVersion.V1_8)
+          .setMethod(
+              dexItemFactory.createMethod(
+                  dexItemFactory.createType(
+                      "Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
+                  dexItemFactory.createProto(
+                      dexItemFactory.createType("V"),
+                      dexItemFactory.createType("Ljava/lang/String;")),
+                  dexItemFactory.createString("addSyntheticMethod")))
+          .setCode(method -> createCfCode4_addSyntheticMethod(dexItemFactory, method))
+          .build(),
+      DexEncodedMethod.syntheticBuilder()
+          .setAccessFlags(MethodAccessFlags.fromCfAccessFlags(9, false))
+          .setApiLevelForCode(ComputedApiLevel.unknown())
+          .setApiLevelForDefinition(ComputedApiLevel.unknown())
+          .setClassFileVersion(CfVersion.V1_8)
+          .setMethod(
+              dexItemFactory.createMethod(
+                  dexItemFactory.createType(
+                      "Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
+                  dexItemFactory.createProto(
+                      dexItemFactory.createType(
+                          "Lcom/android/tools/r8/startup/InstrumentationServerImpl;")),
+                  dexItemFactory.createString("getInstance")))
+          .setCode(method -> createCfCode5_getInstance(dexItemFactory, method))
+          .build(),
+      DexEncodedMethod.syntheticBuilder()
+          .setAccessFlags(MethodAccessFlags.fromCfAccessFlags(2, false))
+          .setApiLevelForCode(ComputedApiLevel.unknown())
+          .setApiLevelForDefinition(ComputedApiLevel.unknown())
+          .setClassFileVersion(CfVersion.V1_8)
+          .setMethod(
+              dexItemFactory.createMethod(
+                  dexItemFactory.createType(
+                      "Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
+                  dexItemFactory.createProto(
+                      dexItemFactory.createType("V"),
+                      dexItemFactory.createType("Ljava/lang/String;")),
+                  dexItemFactory.createString("writeToLogcat")))
+          .setCode(method -> createCfCode7_writeToLogcat(dexItemFactory, method))
+          .build()
+    };
+  }
+
+  private static DexEncodedMethod[] createVirtualMethods(DexItemFactory dexItemFactory) {
+    return new DexEncodedMethod[] {
+      DexEncodedMethod.syntheticBuilder()
+          .setAccessFlags(MethodAccessFlags.fromCfAccessFlags(33, false))
+          .setApiLevelForCode(ComputedApiLevel.unknown())
+          .setApiLevelForDefinition(ComputedApiLevel.unknown())
+          .setClassFileVersion(CfVersion.V1_8)
+          .setMethod(
+              dexItemFactory.createMethod(
+                  dexItemFactory.createType(
+                      "Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
+                  dexItemFactory.createProto(
+                      dexItemFactory.createType("V"), dexItemFactory.createType("Ljava/io/File;")),
+                  dexItemFactory.createString("writeToFile")))
+          .setCode(method -> createCfCode6_writeToFile(dexItemFactory, method))
+          .build()
+    };
+  }
+
+  public static CfCode createClassInitializerCfCode(DexItemFactory factory, DexMethod method) {
+    CfLabel label0 = new CfLabel();
+    return new CfCode(
+        method.holder,
+        2,
+        0,
+        ImmutableList.of(
+            label0,
+            new CfNew(
+                factory.createType("Lcom/android/tools/r8/startup/InstrumentationServerImpl;")),
+            new CfStackInstruction(CfStackInstruction.Opcode.Dup),
+            new CfInvoke(
+                183,
+                factory.createMethod(
+                    factory.createType("Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
+                false),
+            new CfStaticFieldWrite(
+                factory.createField(
+                    factory.createType("Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
+                    factory.createType("Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
+                    factory.createString("INSTANCE"))),
+            new CfReturnVoid()),
+        ImmutableList.of(),
+        ImmutableList.of());
+  }
+
+  public static CfCode createInstanceInitializerCfCode1(DexItemFactory factory, DexMethod method) {
+    CfLabel label0 = new CfLabel();
+    CfLabel label1 = new CfLabel();
+    CfLabel label2 = new CfLabel();
+    CfLabel label3 = new CfLabel();
+    CfLabel label4 = new CfLabel();
+    CfLabel label5 = new CfLabel();
+    return new CfCode(
+        method.holder,
+        3,
+        1,
+        ImmutableList.of(
+            label0,
+            new CfLoad(ValueType.OBJECT, 0),
+            new CfInvoke(
+                183,
+                factory.createMethod(
+                    factory.createType("Lcom/android/tools/r8/startup/InstrumentationServer;"),
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
+                false),
+            label1,
+            new CfLoad(ValueType.OBJECT, 0),
+            new CfNew(factory.stringBuilderType),
+            new CfStackInstruction(CfStackInstruction.Opcode.Dup),
+            new CfInvoke(
+                183,
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
+                false),
+            new CfInstanceFieldWrite(
+                factory.createField(
+                    factory.createType("Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
+                    factory.stringBuilderType,
+                    factory.createString("builder"))),
+            label2,
+            new CfLoad(ValueType.OBJECT, 0),
+            new CfConstNumber(0, ValueType.INT),
+            new CfInstanceFieldWrite(
+                factory.createField(
+                    factory.createType("Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
+                    factory.booleanType,
+                    factory.createString("writeToLogcat"))),
+            label3,
+            new CfLoad(ValueType.OBJECT, 0),
+            new CfConstString(factory.createString("r8")),
+            new CfInstanceFieldWrite(
+                factory.createField(
+                    factory.createType("Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
+                    factory.stringType,
+                    factory.createString("logcatTag"))),
+            label4,
+            new CfReturnVoid(),
+            label5),
+        ImmutableList.of(),
+        ImmutableList.of());
+  }
+
+  public static CfCode createCfCode2_addLine(DexItemFactory factory, DexMethod method) {
+    CfLabel label0 = new CfLabel();
+    CfLabel label1 = new CfLabel();
+    CfLabel label2 = new CfLabel();
+    return new CfCode(
+        method.holder,
+        2,
+        2,
+        ImmutableList.of(
+            label0,
+            new CfLoad(ValueType.OBJECT, 0),
+            new CfInstanceFieldRead(
+                factory.createField(
+                    factory.createType("Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
+                    factory.stringBuilderType,
+                    factory.createString("builder"))),
+            new CfLoad(ValueType.OBJECT, 1),
+            new CfInvoke(
+                182,
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.stringType),
+                    factory.createString("append")),
+                false),
+            new CfConstNumber(10, ValueType.INT),
+            new CfInvoke(
+                182,
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.charType),
+                    factory.createString("append")),
+                false),
+            new CfStackInstruction(CfStackInstruction.Opcode.Pop),
+            label1,
+            new CfReturnVoid(),
+            label2),
+        ImmutableList.of(),
+        ImmutableList.of());
+  }
+
+  public static CfCode createCfCode3_addNonSyntheticMethod(
+      DexItemFactory factory, DexMethod method) {
+    CfLabel label0 = new CfLabel();
+    CfLabel label1 = new CfLabel();
+    CfLabel label2 = new CfLabel();
+    return new CfCode(
+        method.holder,
+        2,
+        1,
+        ImmutableList.of(
+            label0,
+            new CfInvoke(
+                184,
+                factory.createMethod(
+                    factory.createType("Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
+                    factory.createProto(
+                        factory.createType(
+                            "Lcom/android/tools/r8/startup/InstrumentationServerImpl;")),
+                    factory.createString("getInstance")),
+                false),
+            new CfLoad(ValueType.OBJECT, 0),
+            new CfInvoke(
+                183,
+                factory.createMethod(
+                    factory.createType("Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
+                    factory.createProto(factory.voidType, factory.stringType),
+                    factory.createString("addLine")),
+                false),
+            label1,
+            new CfReturnVoid(),
+            label2),
+        ImmutableList.of(),
+        ImmutableList.of());
+  }
+
+  public static CfCode createCfCode4_addSyntheticMethod(DexItemFactory factory, DexMethod method) {
+    CfLabel label0 = new CfLabel();
+    CfLabel label1 = new CfLabel();
+    CfLabel label2 = new CfLabel();
+    return new CfCode(
+        method.holder,
+        3,
+        1,
+        ImmutableList.of(
+            label0,
+            new CfInvoke(
+                184,
+                factory.createMethod(
+                    factory.createType("Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
+                    factory.createProto(
+                        factory.createType(
+                            "Lcom/android/tools/r8/startup/InstrumentationServerImpl;")),
+                    factory.createString("getInstance")),
+                false),
+            new CfNew(factory.stringBuilderType),
+            new CfStackInstruction(CfStackInstruction.Opcode.Dup),
+            new CfInvoke(
+                183,
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.voidType),
+                    factory.createString("<init>")),
+                false),
+            new CfConstNumber(83, ValueType.INT),
+            new CfInvoke(
+                182,
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.charType),
+                    factory.createString("append")),
+                false),
+            new CfLoad(ValueType.OBJECT, 0),
+            new CfInvoke(
+                182,
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringBuilderType, factory.stringType),
+                    factory.createString("append")),
+                false),
+            new CfInvoke(
+                182,
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringType),
+                    factory.createString("toString")),
+                false),
+            new CfInvoke(
+                183,
+                factory.createMethod(
+                    factory.createType("Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
+                    factory.createProto(factory.voidType, factory.stringType),
+                    factory.createString("addLine")),
+                false),
+            label1,
+            new CfReturnVoid(),
+            label2),
+        ImmutableList.of(),
+        ImmutableList.of());
+  }
+
+  public static CfCode createCfCode5_getInstance(DexItemFactory factory, DexMethod method) {
+    CfLabel label0 = new CfLabel();
+    return new CfCode(
+        method.holder,
+        1,
+        0,
+        ImmutableList.of(
+            label0,
+            new CfStaticFieldRead(
+                factory.createField(
+                    factory.createType("Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
+                    factory.createType("Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
+                    factory.createString("INSTANCE"))),
+            new CfReturn(ValueType.OBJECT)),
+        ImmutableList.of(),
+        ImmutableList.of());
+  }
+
+  public static CfCode createCfCode6_writeToFile(DexItemFactory factory, DexMethod method) {
+    CfLabel label0 = new CfLabel();
+    CfLabel label1 = new CfLabel();
+    CfLabel label2 = new CfLabel();
+    CfLabel label3 = new CfLabel();
+    CfLabel label4 = new CfLabel();
+    CfLabel label5 = new CfLabel();
+    CfLabel label6 = new CfLabel();
+    CfLabel label7 = new CfLabel();
+    return new CfCode(
+        method.holder,
+        3,
+        4,
+        ImmutableList.of(
+            label0,
+            new CfNew(factory.createType("Ljava/io/FileOutputStream;")),
+            new CfStackInstruction(CfStackInstruction.Opcode.Dup),
+            new CfLoad(ValueType.OBJECT, 1),
+            new CfInvoke(
+                183,
+                factory.createMethod(
+                    factory.createType("Ljava/io/FileOutputStream;"),
+                    factory.createProto(factory.voidType, factory.createType("Ljava/io/File;")),
+                    factory.createString("<init>")),
+                false),
+            new CfStore(ValueType.OBJECT, 2),
+            label1,
+            new CfLoad(ValueType.OBJECT, 2),
+            new CfLoad(ValueType.OBJECT, 0),
+            new CfInstanceFieldRead(
+                factory.createField(
+                    factory.createType("Lcom/android/tools/r8/startup/InstrumentationServerImpl;"),
+                    factory.stringBuilderType,
+                    factory.createString("builder"))),
+            new CfInvoke(
+                182,
+                factory.createMethod(
+                    factory.stringBuilderType,
+                    factory.createProto(factory.stringType),
+                    factory.createString("toString")),
+                false),
+            new CfConstString(factory.createString("UTF-8")),
+            new CfInvoke(
+                184,
+                factory.createMethod(
+                    factory.createType("Ljava/nio/charset/Charset;"),
+                    factory.createProto(
+                        factory.createType("Ljava/nio/charset/Charset;"), factory.stringType),
+                    factory.createString("forName")),
+                false),
+            new CfInvoke(
+                182,
+                factory.createMethod(
+                    factory.stringType,
+                    factory.createProto(
+                        factory.byteArrayType, factory.createType("Ljava/nio/charset/Charset;")),
+                    factory.createString("getBytes")),
+                false),
+            new CfInvoke(
+                182,
+                factory.createMethod(
+                    factory.createType("Ljava/io/FileOutputStream;"),
+                    factory.createProto(factory.voidType, factory.byteArrayType),
+                    factory.createString("write")),
+                false),
+            label2,
+            new CfLoad(ValueType.OBJECT, 2),
+            new CfInvoke(
+                182,
+                factory.createMethod(
+                    factory.createType("Ljava/io/FileOutputStream;"),
+                    factory.createProto(factory.voidType),
+                    factory.createString("close")),
+                false),
+            label3,
+            new CfGoto(label6),
+            label4,
+            new CfFrame(
+                new Int2ObjectAVLTreeMap<>(
+                    new int[] {0, 1, 2},
+                    new FrameType[] {
+                      FrameType.initializedNonNullReference(
+                          factory.createType(
+                              "Lcom/android/tools/r8/startup/InstrumentationServerImpl;")),
+                      FrameType.initializedNonNullReference(factory.createType("Ljava/io/File;")),
+                      FrameType.initializedNonNullReference(
+                          factory.createType("Ljava/io/FileOutputStream;"))
+                    }),
+                new ArrayDeque<>(
+                    Arrays.asList(FrameType.initializedNonNullReference(factory.throwableType)))),
+            new CfStore(ValueType.OBJECT, 3),
+            new CfLoad(ValueType.OBJECT, 2),
+            new CfInvoke(
+                182,
+                factory.createMethod(
+                    factory.createType("Ljava/io/FileOutputStream;"),
+                    factory.createProto(factory.voidType),
+                    factory.createString("close")),
+                false),
+            label5,
+            new CfLoad(ValueType.OBJECT, 3),
+            new CfThrow(),
+            label6,
+            new CfFrame(
+                new Int2ObjectAVLTreeMap<>(
+                    new int[] {0, 1, 2},
+                    new FrameType[] {
+                      FrameType.initializedNonNullReference(
+                          factory.createType(
+                              "Lcom/android/tools/r8/startup/InstrumentationServerImpl;")),
+                      FrameType.initializedNonNullReference(factory.createType("Ljava/io/File;")),
+                      FrameType.initializedNonNullReference(
+                          factory.createType("Ljava/io/FileOutputStream;"))
+                    })),
+            new CfReturnVoid(),
+            label7),
+        ImmutableList.of(
+            new CfTryCatch(
+                label1, label2, ImmutableList.of(factory.throwableType), ImmutableList.of(label4))),
+        ImmutableList.of());
+  }
+
+  public static CfCode createCfCode7_writeToLogcat(DexItemFactory factory, DexMethod method) {
+    CfLabel label0 = new CfLabel();
+    CfLabel label1 = new CfLabel();
+    CfLabel label2 = new CfLabel();
+    return new CfCode(
+        method.holder,
+        2,
+        2,
+        ImmutableList.of(
+            label0,
+            new CfConstString(factory.createString("r8")),
+            new CfLoad(ValueType.OBJECT, 1),
+            new CfInvoke(
+                184,
+                factory.createMethod(
+                    factory.createType("Landroid/util/Log;"),
+                    factory.createProto(factory.intType, factory.stringType, factory.stringType),
+                    factory.createString("v")),
+                false),
+            new CfStackInstruction(CfStackInstruction.Opcode.Pop),
+            label1,
+            new CfReturnVoid(),
+            label2),
+        ImmutableList.of(),
+        ImmutableList.of());
+  }
+}
diff --git a/src/test/java/com/android/tools/r8/cfmethodgeneration/CfClassGenerator.java b/src/test/java/com/android/tools/r8/cfmethodgeneration/CfClassGenerator.java
index d924288..5435248 100644
--- a/src/test/java/com/android/tools/r8/cfmethodgeneration/CfClassGenerator.java
+++ b/src/test/java/com/android/tools/r8/cfmethodgeneration/CfClassGenerator.java
@@ -11,19 +11,25 @@
 import com.android.tools.r8.graph.ClassKind;
 import com.android.tools.r8.graph.DexEncodedMethod;
 import com.android.tools.r8.graph.DexProgramClass;
-import com.android.tools.r8.graph.DexType;
 import com.android.tools.r8.graph.FieldAccessFlags;
 import com.android.tools.r8.graph.JarApplicationReader;
 import com.android.tools.r8.graph.JarClassFileReader;
 import com.android.tools.r8.graph.MethodAccessFlags;
 import com.android.tools.r8.origin.Origin;
 import com.android.tools.r8.references.MethodReference;
+import com.android.tools.r8.references.Reference;
+import com.android.tools.r8.utils.FieldReferenceUtils;
 import com.android.tools.r8.utils.FileUtils;
 import com.android.tools.r8.utils.InternalOptions;
+import com.android.tools.r8.utils.MethodReferenceUtils;
 import com.android.tools.r8.utils.Reporter;
 import com.android.tools.r8.utils.StringUtils;
+import com.google.common.collect.Streams;
 import java.io.IOException;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Executable;
 import java.lang.reflect.Field;
+import java.lang.reflect.Method;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -34,12 +40,7 @@
 
   private final CfCodeGeneratorImportCollection imports = new CfCodeGeneratorImportCollection();
 
-  public abstract Class<?> getGeneratedClass();
-
-  @Override
-  protected DexType getGeneratedType() {
-    return factory.createType(descriptor(getGeneratedClass()));
-  }
+  public abstract Class<?> getImplementation();
 
   public String generateClass() throws IOException {
     return formatRawOutput(generateRawOutput());
@@ -103,7 +104,7 @@
         .startLine()
         .append(imports.getClassAccessFlags())
         .append(".fromCfAccessFlags(")
-        .append(getGeneratedClass().getModifiers())
+        .append(getImplementation().getModifiers())
         .appendLine("),");
 
     builder.startLine().appendLine("null,");
@@ -170,9 +171,13 @@
         .appendOpeningArrayBrace();
 
     Iterator<Field> fieldIterator =
-        Arrays.stream(getGeneratedClass().getDeclaredFields())
+        Arrays.stream(getImplementation().getDeclaredFields())
             .filter(
                 field -> predicate.test(FieldAccessFlags.fromCfAccessFlags(field.getModifiers())))
+            .sorted(
+                (x, y) ->
+                    FieldReferenceUtils.compare(
+                        Reference.fieldFromField(x), Reference.fieldFromField(y)))
             .iterator();
     while (fieldIterator.hasNext()) {
       Field field = fieldIterator.next();
@@ -259,8 +264,146 @@
         .startLine()
         .append("return new ")
         .append(imports.getDexEncodedMethod())
-        .appendLine("[0];");
+        .append("[] ")
+        .appendOpeningArrayBrace();
 
+    getImplementation().getDeclaredConstructors();
+
+    Iterator<Executable> executableIterator =
+        Streams.concat(
+                Arrays.stream(getImplementation().getDeclaredConstructors()),
+                Arrays.stream(getImplementation().getDeclaredMethods()))
+            .filter(
+                executable ->
+                    predicate.test(
+                        MethodAccessFlags.fromCfAccessFlags(executable.getModifiers(), false)))
+            .sorted(
+                (x, y) ->
+                    MethodReferenceUtils.compare(
+                        Reference.methodFromMethod(x), Reference.methodFromMethod(y)))
+            .iterator();
+    while (executableIterator.hasNext()) {
+      Executable executable = executableIterator.next();
+      builder
+          .startLine()
+          .append(imports.getDexEncodedMethod())
+          .appendLine(".syntheticBuilder()")
+          .indent(4);
+
+      builder
+          .startLine()
+          .append(".setAccessFlags(")
+          .append(imports.getMethodAccessFlags())
+          .append(".fromCfAccessFlags(")
+          .append(executable.getModifiers())
+          .append(", false")
+          .appendLine("))");
+
+      builder
+          .startLine()
+          .append(".setApiLevelForCode(")
+          .append(imports.getComputedApiLevel())
+          .appendLine(".unknown())");
+
+      builder
+          .startLine()
+          .append(".setApiLevelForDefinition(")
+          .append(imports.getComputedApiLevel())
+          .appendLine(".unknown())");
+
+      builder
+          .startLine()
+          .append(".setClassFileVersion(")
+          .append(imports.getCfVersion())
+          .appendLine(".V1_8)");
+
+      builder.startLine().append(".setMethod").appendOpeningMultiLineParenthesis();
+
+      if (executable instanceof Constructor<?>) {
+        Constructor<?> constructor = (Constructor<?>) executable;
+        builder
+            .startLine()
+            .append("dexItemFactory.createInstanceInitializer")
+            .appendOpeningMultiLineParenthesis();
+
+        builder
+            .startLine()
+            .append("dexItemFactory.createType(\"")
+            .append(descriptor(constructor.getDeclaringClass()))
+            .append("\")");
+
+        for (Class<?> parameter : constructor.getParameterTypes()) {
+          builder
+              .appendLine(",")
+              .startLine()
+              .append("dexItemFactory.createType(\"")
+              .append(descriptor(parameter))
+              .append("\")");
+        }
+      } else {
+        assert executable instanceof Method;
+        Method method = (Method) executable;
+
+        builder
+            .startLine()
+            .append("dexItemFactory.createMethod")
+            .appendOpeningMultiLineParenthesis();
+
+        builder
+            .startLine()
+            .append("dexItemFactory.createType(\"")
+            .append(descriptor(method.getDeclaringClass()))
+            .appendLine("\"),");
+
+        builder
+            .startLine()
+            .append("dexItemFactory.createProto")
+            .appendOpeningMultiLineParenthesis();
+
+        builder
+            .startLine()
+            .append("dexItemFactory.createType(\"")
+            .append(descriptor(method.getReturnType()))
+            .append("\")");
+
+        for (Class<?> parameter : method.getParameterTypes()) {
+          builder
+              .appendLine(",")
+              .startLine()
+              .append("dexItemFactory.createType(\"")
+              .append(descriptor(parameter))
+              .append("\")");
+        }
+        builder.appendClosingMultiLineParenthesis().appendLine(',');
+
+        builder
+            .startLine()
+            .append("dexItemFactory.createString(\"")
+            .append(method.getName())
+            .append("\")");
+      }
+
+      builder.appendClosingMultiLineParenthesis().appendClosingMultiLineParenthesis().appendLine();
+
+      String createCfCodeMethodName =
+          createCfCodeMethodNames.get(Reference.methodFromMethod(executable));
+      if (createCfCodeMethodName != null) {
+        builder
+            .startLine()
+            .append(".setCode(method -> ")
+            .append(createCfCodeMethodName)
+            .appendLine("(dexItemFactory, method))");
+      }
+
+      builder.startLine().append(".build()").indent(-4);
+      if (executableIterator.hasNext()) {
+        builder.appendLine(',');
+      } else {
+        builder.appendLine();
+      }
+    }
+
+    builder.appendClosingArrayBrace();
     builder.appendClosingBrace();
   }
 
@@ -279,12 +422,14 @@
                   continue;
                 }
                 String generatedMethodName = getCreateCfCodeMethodName(method, index);
+                createCfCodeMethodNames.put(
+                    method.getReference().asMethodReference(), generatedMethodName);
                 codePrinter.visitMethod(generatedMethodName, method.getCode().asCfCode());
                 index++;
               }
             },
             ClassKind.PROGRAM);
-    reader.read(Origin.unknown(), ToolHelper.getClassAsBytes(getGeneratedClass()));
+    reader.read(Origin.unknown(), ToolHelper.getClassAsBytes(getImplementation()));
     codePrinter.getImports().forEach(imports::addImport);
     return createCfCodeMethodNames;
   }
diff --git a/src/test/java/com/android/tools/r8/cfmethodgeneration/CfCodeGeneratorImportCollection.java b/src/test/java/com/android/tools/r8/cfmethodgeneration/CfCodeGeneratorImportCollection.java
index 4072619..12be5f6 100644
--- a/src/test/java/com/android/tools/r8/cfmethodgeneration/CfCodeGeneratorImportCollection.java
+++ b/src/test/java/com/android/tools/r8/cfmethodgeneration/CfCodeGeneratorImportCollection.java
@@ -19,6 +19,10 @@
     return builder.toString();
   }
 
+  String getCfVersion() {
+    return getR8ClassName("cf", "CfVersion");
+  }
+
   String getClassAccessFlags() {
     return getR8ClassName("graph", "ClassAccessFlags");
   }
@@ -72,6 +76,10 @@
     return "Collections";
   }
 
+  String getMethodAccessFlags() {
+    return getR8ClassName("graph", "MethodAccessFlags");
+  }
+
   String getMethodCollectionFactory() {
     return getR8ClassName("graph.MethodCollection", "MethodCollectionFactory");
   }
diff --git a/src/test/java/com/android/tools/r8/ir/conversion/CallGraphTestBase.java b/src/test/java/com/android/tools/r8/ir/conversion/CallGraphTestBase.java
index 9d13687..d5f5e91 100644
--- a/src/test/java/com/android/tools/r8/ir/conversion/CallGraphTestBase.java
+++ b/src/test/java/com/android/tools/r8/ir/conversion/CallGraphTestBase.java
@@ -55,7 +55,6 @@
             DexEncodedMethod.builder()
                 .setMethod(signature)
                 .setAccessFlags(MethodAccessFlags.fromDexAccessFlags(0))
-                .setCode(null)
                 .disableAndroidApiLevelCheck()
                 .build());
     return new Node(method);
diff --git a/src/test/java/com/android/tools/r8/startup/GenerateInstrumentationServerClassesTest.java b/src/test/java/com/android/tools/r8/startup/GenerateInstrumentationServerClassesTest.java
index 23f3436..5e7c7c5 100644
--- a/src/test/java/com/android/tools/r8/startup/GenerateInstrumentationServerClassesTest.java
+++ b/src/test/java/com/android/tools/r8/startup/GenerateInstrumentationServerClassesTest.java
@@ -11,6 +11,7 @@
 import com.android.tools.r8.TestParametersCollection;
 import com.android.tools.r8.TestRuntime.CfVm;
 import com.android.tools.r8.cfmethodgeneration.CfClassGenerator;
+import com.android.tools.r8.graph.DexType;
 import com.android.tools.r8.utils.FileUtils;
 import com.google.common.collect.ImmutableList;
 import java.io.IOException;
@@ -63,7 +64,13 @@
     }
 
     @Override
-    public Class<?> getGeneratedClass() {
+    protected DexType getGeneratedType() {
+      return factory.createType(
+          "Lcom/android/tools/r8/startup/generated/" + clazz.getSimpleName() + "Factory;");
+    }
+
+    @Override
+    public Class<?> getImplementation() {
       return clazz;
     }