From 2a056b205d851beff39e02189f7b0264cde8f864 Mon Sep 17 00:00:00 2001
From: Jeffrey Phillips Freeman <jeffrey.freeman@syncleus.com>
Date: Sat, 3 Dec 2016 20:03:52 -0500
Subject: [PATCH] Reverted some previous changes, as they caused some issues in
 the last release. This reapplied any relevant bugs fixed however.

---
 pom.xml                                       |   4 +-
 src/main/java/com/aparapi/Config.java         |  12 +-
 src/main/java/com/aparapi/Kernel.java         |  39 +-
 src/main/java/com/aparapi/Range.java          |   8 +-
 src/main/java/com/aparapi/device/Device.java  |   3 +-
 .../java/com/aparapi/device/OpenCLDevice.java |  46 ++-
 .../java/com/aparapi/device/package-info.java |  11 +-
 .../internal/exception/AparapiException.java  |   4 +-
 .../exception/ClassParseException.java        |   2 +-
 .../internal/instruction/BranchSet.java       |  35 +-
 .../internal/instruction/ExpressionList.java  |  99 ++---
 .../internal/instruction/Instruction.java     |  52 +--
 .../instruction/InstructionPattern.java       | 120 +++---
 .../internal/instruction/InstructionSet.java  |  55 +--
 .../aparapi/internal/jni/KernelArgJNI.java    |   5 +-
 .../aparapi/internal/jni/KernelRunnerJNI.java |  56 +--
 .../com/aparapi/internal/jni/OpenCLJNI.java   |   2 +-
 .../aparapi/internal/kernel/KernelArg.java    |  11 +-
 .../internal/kernel/KernelDeviceProfile.java  |   4 +-
 .../internal/kernel/KernelManager.java        |   8 +-
 .../internal/kernel/KernelManagers.java       |   2 +-
 .../internal/kernel/KernelPreferences.java    |   3 +-
 .../internal/kernel/KernelProfile.java        |   4 +-
 .../aparapi/internal/kernel/KernelRunner.java |  69 ++--
 .../aparapi/internal/model/ClassModel.java    |  31 +-
 .../aparapi/internal/model/Entrypoint.java    | 145 ++++----
 .../aparapi/internal/model/MethodModel.java   | 349 +++++++++---------
 .../aparapi/internal/opencl/OpenCLLoader.java |   4 +-
 .../internal/opencl/OpenCLPlatform.java       |   6 +-
 .../internal/opencl/OpenCLProgram.java        |   7 +-
 .../aparapi/internal/reader/ByteBuffer.java   |   2 +-
 .../aparapi/internal/reader/ByteReader.java   |   2 +-
 .../internal/tool/InstructionViewer.java      |  10 +-
 .../aparapi/internal/writer/BlockWriter.java  | 272 +++++++-------
 .../aparapi/internal/writer/KernelWriter.java |  77 ++--
 35 files changed, 780 insertions(+), 779 deletions(-)

diff --git a/pom.xml b/pom.xml
index 2c8d44a3..db80863b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -11,7 +11,7 @@
 
     <groupId>com.aparapi</groupId>
     <artifactId>aparapi</artifactId>
-    <version>1.1.1-SNAPSHOT</version>
+    <version>1.1.2-SNAPSHOT</version>
     <packaging>jar</packaging>
 
     <properties>
@@ -34,7 +34,7 @@
 
     <organization>
         <name>Syncleus</name>
-        <url>http://syncleus.com</url>
+        <url>http://aparapi.com</url>
     </organization>
 
     <scm>
diff --git a/src/main/java/com/aparapi/Config.java b/src/main/java/com/aparapi/Config.java
index 4d7af85c..6d04663d 100644
--- a/src/main/java/com/aparapi/Config.java
+++ b/src/main/java/com/aparapi/Config.java
@@ -52,9 +52,9 @@ under those regulations, please refer to the U.S. Bureau of Industry and Securit
  */
 package com.aparapi;
 
-import com.aparapi.internal.instruction.Instruction;
-import com.aparapi.internal.jni.ConfigJNI;
-import com.aparapi.internal.tool.InstructionViewer;
+import com.aparapi.internal.instruction.*;
+import com.aparapi.internal.jni.*;
+import com.aparapi.internal.tool.*;
 
 import java.util.logging.*;
 
@@ -67,7 +67,7 @@ import java.util.logging.*;
  * @author gfrost
  * 
  */
-public class Config extends ConfigJNI {
+public class Config extends ConfigJNI{
 
    // Logging setup
    private static final String logPropName = propPkgName + ".logLevel";
@@ -93,7 +93,7 @@ public class Config extends ConfigJNI {
     *
     *  Usage -Dcom.aparapi.executionMode={SEQ|JTP|CPU|GPU|ACC}
     *  
-    *  @see Kernel.EXECUTION_MODE
+    *  @see com.aparapi.Kernel.EXECUTION_MODE
     */
    public static final String executionMode = System.getProperty(propPkgName + ".executionMode");
 
@@ -228,7 +228,7 @@ public class Config extends ConfigJNI {
          System.out.println(propPkgName + ".enableExecutionModeReporting{true|false}=" + enableExecutionModeReporting);
          System.out.println(propPkgName + ".enableInstructionDecodeViewer{true|false}=" + enableInstructionDecodeViewer);
          System.out.println(propPkgName
-               + ".instructionListenerClassName{<class name which extends Config.InstructionListener>}="
+               + ".instructionListenerClassName{<class name which extends com.aparapi.Config.InstructionListener>}="
                + instructionListenerClassName);
       }
    }
diff --git a/src/main/java/com/aparapi/Kernel.java b/src/main/java/com/aparapi/Kernel.java
index 6deaa7aa..38a00284 100644
--- a/src/main/java/com/aparapi/Kernel.java
+++ b/src/main/java/com/aparapi/Kernel.java
@@ -52,23 +52,18 @@ under those regulations, please refer to the U.S. Bureau of Industry and Securit
 */
 package com.aparapi;
 
-import com.aparapi.device.Device;
-import com.aparapi.device.JavaDevice;
-import com.aparapi.device.OpenCLDevice;
-import com.aparapi.exception.DeprecatedException;
-import com.aparapi.internal.kernel.KernelArg;
-import com.aparapi.internal.kernel.KernelManager;
-import com.aparapi.internal.kernel.KernelProfile;
-import com.aparapi.internal.kernel.KernelRunner;
-import com.aparapi.internal.model.ClassModel;
 import com.aparapi.annotation.Experimental;
-import com.aparapi.internal.util.Reflection;
-import com.aparapi.internal.util.UnsafeWrapper;
+import com.aparapi.device.*;
+import com.aparapi.exception.DeprecatedException;
+import com.aparapi.internal.kernel.*;
 import com.aparapi.internal.model.CacheEnabler;
+import com.aparapi.internal.model.ClassModel.ConstantPool.MethodReferenceEntry;
+import com.aparapi.internal.model.ClassModel.ConstantPool.NameAndTypeEntry;
 import com.aparapi.internal.model.ValueCache;
 import com.aparapi.internal.model.ValueCache.ThrowingValueComputer;
 import com.aparapi.internal.model.ValueCache.ValueComputer;
 import com.aparapi.internal.opencl.OpenCLLoader;
+import com.aparapi.internal.util.*;
 
 import java.lang.annotation.Annotation;
 import java.lang.annotation.ElementType;
@@ -328,8 +323,8 @@ public abstract class Kernel implements Cloneable {
    }
 
    /**
-    * @deprecated It is no longer recommended that {@code EXECUTION_MODE}s are used, as a more sophisticated {@link Device}
-    * preference mechanism is in place, see {@link KernelManager}. Though {@link #setExecutionMode(EXECUTION_MODE)}
+    * @deprecated It is no longer recommended that {@code EXECUTION_MODE}s are used, as a more sophisticated {@link com.aparapi.device.Device}
+    * preference mechanism is in place, see {@link com.aparapi.internal.kernel.KernelManager}. Though {@link #setExecutionMode(EXECUTION_MODE)}
     * is still honored, the default EXECUTION_MODE is now {@link EXECUTION_MODE#AUTO}, which indicates that the KernelManager
     * will determine execution behaviours.
     *
@@ -2269,7 +2264,7 @@ public abstract class Kernel implements Cloneable {
       return mapping;
    }
 
-   public static String getMappedMethodName(ClassModel.ConstantPool.MethodReferenceEntry _methodReferenceEntry) {
+   public static String getMappedMethodName(MethodReferenceEntry _methodReferenceEntry) {
       if (CacheEnabler.areCachesEnabled())
          return getProperty(mappedMethodNamesCache, _methodReferenceEntry, null);
       String mappedName = null;
@@ -2309,7 +2304,7 @@ public abstract class Kernel implements Cloneable {
       return (mappedName);
    }
 
-   public static boolean isMappedMethod(ClassModel.ConstantPool.MethodReferenceEntry methodReferenceEntry) {
+   public static boolean isMappedMethod(MethodReferenceEntry methodReferenceEntry) {
       if (CacheEnabler.areCachesEnabled())
          return getBoolean(mappedMethodFlags, methodReferenceEntry);
       boolean isMapped = false;
@@ -2325,7 +2320,7 @@ public abstract class Kernel implements Cloneable {
       return (isMapped);
    }
 
-   public static boolean isOpenCLDelegateMethod(ClassModel.ConstantPool.MethodReferenceEntry methodReferenceEntry) {
+   public static boolean isOpenCLDelegateMethod(MethodReferenceEntry methodReferenceEntry) {
       if (CacheEnabler.areCachesEnabled())
          return getBoolean(openCLDelegateMethodFlags, methodReferenceEntry);
       boolean isMapped = false;
@@ -2341,7 +2336,7 @@ public abstract class Kernel implements Cloneable {
       return (isMapped);
    }
 
-   public static boolean usesAtomic32(ClassModel.ConstantPool.MethodReferenceEntry methodReferenceEntry) {
+   public static boolean usesAtomic32(MethodReferenceEntry methodReferenceEntry) {
       if (CacheEnabler.areCachesEnabled())
          return getProperty(atomic32Cache, methodReferenceEntry, false);
       for (final Method kernelMethod : Kernel.class.getDeclaredMethods()) {
@@ -2356,7 +2351,7 @@ public abstract class Kernel implements Cloneable {
    }
 
    // For alpha release atomic64 is not supported
-   public static boolean usesAtomic64(ClassModel.ConstantPool.MethodReferenceEntry methodReferenceEntry) {
+   public static boolean usesAtomic64(MethodReferenceEntry methodReferenceEntry) {
       //      if (CacheEnabler.areCachesEnabled())
       //      return getProperty(atomic64Cache, methodReferenceEntry, false);
       //for (java.lang.reflect.Method kernelMethod : Kernel.class.getDeclaredMethods()) {
@@ -2899,7 +2894,7 @@ public abstract class Kernel implements Cloneable {
    });
 
    private static boolean getBoolean(ValueCache<Class<?>, Map<String, Boolean>, RuntimeException> methodNamesCache,
-         ClassModel.ConstantPool.MethodReferenceEntry methodReferenceEntry) {
+         MethodReferenceEntry methodReferenceEntry) {
       return getProperty(methodNamesCache, methodReferenceEntry, false);
    }
 
@@ -2935,7 +2930,7 @@ public abstract class Kernel implements Cloneable {
    }
 
    private static <V, T extends Throwable> V getProperty(ValueCache<Class<?>, Map<String, V>, T> cache,
-                                                         ClassModel.ConstantPool.MethodReferenceEntry methodReferenceEntry, V defaultValue) throws T {
+         MethodReferenceEntry methodReferenceEntry, V defaultValue) throws T {
       Map<String, V> map = cache.computeIfAbsent(methodReferenceEntry.getOwnerClassModel().getClassWeAreModelling());
       String key = toSignature(methodReferenceEntry);
       if (map.containsKey(key))
@@ -2943,8 +2938,8 @@ public abstract class Kernel implements Cloneable {
       return defaultValue;
    }
 
-   private static String toSignature(ClassModel.ConstantPool.MethodReferenceEntry methodReferenceEntry) {
-      ClassModel.ConstantPool.NameAndTypeEntry nameAndTypeEntry = methodReferenceEntry.getNameAndTypeEntry();
+   private static String toSignature(MethodReferenceEntry methodReferenceEntry) {
+      NameAndTypeEntry nameAndTypeEntry = methodReferenceEntry.getNameAndTypeEntry();
       return nameAndTypeEntry.getNameUTF8Entry().getUTF8() + nameAndTypeEntry.getDescriptorUTF8Entry().getUTF8();
    }
 
diff --git a/src/main/java/com/aparapi/Range.java b/src/main/java/com/aparapi/Range.java
index 21aab03b..5ee22725 100644
--- a/src/main/java/com/aparapi/Range.java
+++ b/src/main/java/com/aparapi/Range.java
@@ -15,10 +15,8 @@
  */
 package com.aparapi;
 
-import com.aparapi.device.Device;
-import com.aparapi.device.JavaDevice;
-import com.aparapi.device.OpenCLDevice;
-import com.aparapi.internal.jni.RangeJNI;
+import com.aparapi.device.*;
+import com.aparapi.internal.jni.*;
 
 import java.util.*;
 
@@ -64,7 +62,7 @@ import java.util.*;
  *  Range.create3D(width, height, depth, groupWidth, groupHeight, groupDepth);
  * </pre></blockquote>
  */
-public class Range extends RangeJNI {
+public class Range extends RangeJNI{
 
    public static final int THREADS_PER_CORE = 16;
 
diff --git a/src/main/java/com/aparapi/device/Device.java b/src/main/java/com/aparapi/device/Device.java
index 658e9ccd..93672448 100644
--- a/src/main/java/com/aparapi/device/Device.java
+++ b/src/main/java/com/aparapi/device/Device.java
@@ -15,9 +15,8 @@
  */
 package com.aparapi.device;
 
-import com.aparapi.Range;
-import com.aparapi.internal.kernel.KernelManager;
 import com.aparapi.*;
+import com.aparapi.internal.kernel.*;
 
 public abstract class Device{
 
diff --git a/src/main/java/com/aparapi/device/OpenCLDevice.java b/src/main/java/com/aparapi/device/OpenCLDevice.java
index f031b5df..d3983a85 100644
--- a/src/main/java/com/aparapi/device/OpenCLDevice.java
+++ b/src/main/java/com/aparapi/device/OpenCLDevice.java
@@ -15,13 +15,11 @@
  */
 package com.aparapi.device;
 
-import com.aparapi.Range;
-import com.aparapi.internal.opencl.OpenCLArgDescriptor;
-import com.aparapi.internal.opencl.OpenCLKernel;
-import com.aparapi.internal.opencl.OpenCLPlatform;
-import com.aparapi.internal.opencl.OpenCLProgram;
-import com.aparapi.opencl.OpenCL;
 import com.aparapi.*;
+import com.aparapi.internal.opencl.*;
+import com.aparapi.opencl.*;
+import com.aparapi.opencl.OpenCL.*;
+import com.aparapi.opencl.OpenCL.Kernel;
 
 import java.io.*;
 import java.lang.annotation.*;
@@ -214,23 +212,23 @@ public class OpenCLDevice extends Device{
             long bits = 0L;
             String name = null;
             for (final Annotation pa : parameterAnnotations[arg]) {
-               if (pa instanceof OpenCL.GlobalReadOnly) {
-                  name = ((OpenCL.GlobalReadOnly) pa).value();
+               if (pa instanceof GlobalReadOnly) {
+                  name = ((GlobalReadOnly) pa).value();
                   bits |= OpenCLArgDescriptor.ARG_GLOBAL_BIT | OpenCLArgDescriptor.ARG_READONLY_BIT;
-               } else if (pa instanceof OpenCL.GlobalWriteOnly) {
-                  name = ((OpenCL.GlobalWriteOnly) pa).value();
+               } else if (pa instanceof GlobalWriteOnly) {
+                  name = ((GlobalWriteOnly) pa).value();
                   bits |= OpenCLArgDescriptor.ARG_GLOBAL_BIT | OpenCLArgDescriptor.ARG_WRITEONLY_BIT;
-               } else if (pa instanceof OpenCL.GlobalReadWrite) {
-                  name = ((OpenCL.GlobalReadWrite) pa).value();
+               } else if (pa instanceof GlobalReadWrite) {
+                  name = ((GlobalReadWrite) pa).value();
                   bits |= OpenCLArgDescriptor.ARG_GLOBAL_BIT | OpenCLArgDescriptor.ARG_READWRITE_BIT;
-               } else if (pa instanceof OpenCL.Local) {
-                  name = ((OpenCL.Local) pa).value();
+               } else if (pa instanceof Local) {
+                  name = ((Local) pa).value();
                   bits |= OpenCLArgDescriptor.ARG_LOCAL_BIT;
-               } else if (pa instanceof OpenCL.Constant) {
-                  name = ((OpenCL.Constant) pa).value();
+               } else if (pa instanceof Constant) {
+                  name = ((Constant) pa).value();
                   bits |= OpenCLArgDescriptor.ARG_CONST_BIT | OpenCLArgDescriptor.ARG_READONLY_BIT;
-               } else if (pa instanceof OpenCL.Arg) {
-                  name = ((OpenCL.Arg) pa).value();
+               } else if (pa instanceof Arg) {
+                  name = ((Arg) pa).value();
                   bits |= OpenCLArgDescriptor.ARG_ISARG_BIT;
                }
 
@@ -330,12 +328,12 @@ public class OpenCLDevice extends Device{
          final StringBuilder sourceBuilder = new StringBuilder();
          boolean interfaceIsAnnotated = false;
          for (final Annotation a : _interface.getAnnotations()) {
-            if (a instanceof OpenCL.Source) {
-               final OpenCL.Source source = (OpenCL.Source) a;
+            if (a instanceof Source) {
+               final Source source = (Source) a;
                sourceBuilder.append(source.value()).append("\n");
                interfaceIsAnnotated = true;
-            } else if (a instanceof OpenCL.Resource) {
-               final OpenCL.Resource sourceResource = (OpenCL.Resource) a;
+            } else if (a instanceof Resource) {
+               final Resource sourceResource = (Resource) a;
                final InputStream stream = _interface.getClassLoader().getResourceAsStream(sourceResource.value());
                sourceBuilder.append(streamToString(stream));
                interfaceIsAnnotated = true;
@@ -357,7 +355,7 @@ public class OpenCLDevice extends Device{
                   for (final Annotation a : m.getAnnotations()) {
                      //  System.out.println("   annotation "+a);
                      // System.out.println("   annotation type " + a.annotationType());
-                     if (a instanceof OpenCL.Kernel) {
+                     if (a instanceof Kernel) {
                         sourceBuilder.append("__kernel void " + m.getName() + "(");
                         final List<OpenCLArgDescriptor> args = getArgs(m);
 
@@ -372,7 +370,7 @@ public class OpenCLDevice extends Device{
                         }
 
                         sourceBuilder.append(")");
-                        final OpenCL.Kernel kernel = (OpenCL.Kernel) a;
+                        final Kernel kernel = (Kernel) a;
                         sourceBuilder.append(kernel.value());
                         kernelNameToArgsMap.put(m.getName(), args);
 
diff --git a/src/main/java/com/aparapi/device/package-info.java b/src/main/java/com/aparapi/device/package-info.java
index 2785230f..fd8989ab 100644
--- a/src/main/java/com/aparapi/device/package-info.java
+++ b/src/main/java/com/aparapi/device/package-info.java
@@ -20,10 +20,10 @@
  * as now the preferred mechanism for device selection is to rely on the {@link com.aparapi.internal.kernel.KernelManager} to
  * select an appropriate device. Where a particular device is required to be used for a certain kernel, for such purposes as
  * debugging or unit testing, this can be achieved by using
- * {@link com.aparapi.internal.kernel.KernelManager#setKernelManager(KernelManager)} prior to
- * invoking any Kernel executions, by overriding {@link com.aparapi.Kernel#isAllowDevice(Device)}
+ * {@link com.aparapi.internal.kernel.KernelManager#setKernelManager(com.aparapi.internal.kernel.KernelManager)} prior to
+ * invoking any Kernel executions, by overriding {@link com.aparapi.Kernel#isAllowDevice(com.aparapi.device.Device)}
   * to veto/approve devices from the available devices for a given Kernel class, or (not recommended) by using
- * {@link com.aparapi.internal.kernel.KernelManager#setPreferredDevices(Kernel, java.util.LinkedHashSet)} to specify
+ * {@link com.aparapi.internal.kernel.KernelManager#setPreferredDevices(com.aparapi.Kernel, java.util.LinkedHashSet)} to specify
  * a particular device list for a given Kernel class.
  *
  * <p>In order to determine the Device which will be used to execute a particular Kernel, use {@link com.aparapi.Kernel#getTargetDevice()}.
@@ -31,7 +31,4 @@
  * and fell back to another device).
  *
  */
-package com.aparapi.device;
-
-import com.aparapi.Kernel;
-import com.aparapi.internal.kernel.KernelManager;
\ No newline at end of file
+package com.aparapi.device;
\ No newline at end of file
diff --git a/src/main/java/com/aparapi/internal/exception/AparapiException.java b/src/main/java/com/aparapi/internal/exception/AparapiException.java
index f0cafb0b..05fd8151 100644
--- a/src/main/java/com/aparapi/internal/exception/AparapiException.java
+++ b/src/main/java/com/aparapi/internal/exception/AparapiException.java
@@ -59,8 +59,8 @@ package com.aparapi.internal.exception;
  * The class parser for example will throw a specific <code>ClassParseException</code> if any Aparapi unfriendly 
  * constructs are found.  This allows us to <strong>fail fast</strong> during classfile parsing.
  * 
- * @see ClassParseException
- * @see CodeGenException
+ * @see com.aparapi.internal.exception.ClassParseException
+ * @see com.aparapi.internal.exception.CodeGenException
  *
  * @author gfrost
  *
diff --git a/src/main/java/com/aparapi/internal/exception/ClassParseException.java b/src/main/java/com/aparapi/internal/exception/ClassParseException.java
index 25d0e48f..4114d7c5 100644
--- a/src/main/java/com/aparapi/internal/exception/ClassParseException.java
+++ b/src/main/java/com/aparapi/internal/exception/ClassParseException.java
@@ -58,7 +58,7 @@ import com.aparapi.internal.instruction.Instruction;
  * We throw <code>ClassParseException</code>s (derived from <code>AparapiException</code>) if we encounter any Aparapi unfriendly 
  * constructs.  This allows us to <strong>fail fast</strong>.
  * 
- * @see AparapiException
+ * @see com.aparapi.internal.exception.AparapiException
  *
  * @author gfrost
  *
diff --git a/src/main/java/com/aparapi/internal/instruction/BranchSet.java b/src/main/java/com/aparapi/internal/instruction/BranchSet.java
index a88649d9..bdce4bfc 100644
--- a/src/main/java/com/aparapi/internal/instruction/BranchSet.java
+++ b/src/main/java/com/aparapi/internal/instruction/BranchSet.java
@@ -57,6 +57,9 @@ import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Set;
 
+import com.aparapi.internal.instruction.InstructionSet.Branch;
+import com.aparapi.internal.instruction.InstructionSet.ConditionalBranch;
+
 /**
  * Deals with the issue of recognizing that a sequence of bytecode branch instructions actually represent a single if/while with a logical expression.
  * 
@@ -169,15 +172,15 @@ public class BranchSet {
     *
     */
    public static class SimpleLogicalExpressionNode extends LogicalExpressionNode {
-      private final InstructionSet.ConditionalBranch branch;
+      private final ConditionalBranch branch;
 
       private boolean invert;
 
-      public SimpleLogicalExpressionNode(InstructionSet.ConditionalBranch _branch) {
+      public SimpleLogicalExpressionNode(ConditionalBranch _branch) {
          this(_branch, false);
       }
 
-      private SimpleLogicalExpressionNode(InstructionSet.ConditionalBranch _branch, boolean _invert) {
+      private SimpleLogicalExpressionNode(ConditionalBranch _branch, boolean _invert) {
          branch = _branch;
          invert = _invert;
       }
@@ -206,7 +209,7 @@ public class BranchSet {
          return (invert);
       }
 
-      public InstructionSet.ConditionalBranch getBranch() {
+      public ConditionalBranch getBranch() {
          return branch;
       }
 
@@ -297,15 +300,15 @@ public class BranchSet {
 
    }
 
-   private final List<InstructionSet.ConditionalBranch> set = new ArrayList<InstructionSet.ConditionalBranch>();
+   private final List<ConditionalBranch> set = new ArrayList<ConditionalBranch>();
 
    private final Instruction fallThrough;
 
    private final Instruction target;
 
-   private final InstructionSet.Branch last;
+   private final Branch last;
 
-   private InstructionSet.Branch first;
+   private Branch first;
 
    private LogicalExpressionNode logicalExpressionNode = null;
 
@@ -316,11 +319,11 @@ public class BranchSet {
     * 
     * @param _branch
     */
-   public BranchSet(InstructionSet.Branch _branch) {
+   public BranchSet(Branch _branch) {
       target = _branch.getTarget();
       last = _branch;
 
-      final Set<InstructionSet.Branch> expandedSet = new LinkedHashSet<InstructionSet.Branch>();
+      final Set<Branch> expandedSet = new LinkedHashSet<Branch>();
       final Instruction fallThroughRoot = last.getNextExpr();
       fallThrough = fallThroughRoot == null ? last.getNextPC() : fallThroughRoot.getStartInstruction();
       first = last;
@@ -335,14 +338,14 @@ public class BranchSet {
          }
       }
       for (Instruction i = first; i != fallThroughRoot; i = i.getNextExpr()) {
-         set.add((InstructionSet.ConditionalBranch) i.asBranch());
-         ((InstructionSet.ConditionalBranch) i.asBranch()).setBranchSet(this);
+         set.add((ConditionalBranch) i.asBranch());
+         ((ConditionalBranch) i.asBranch()).setBranchSet(this);
       }
 
       //   ConditionalBranch16 branches[] = set.toArray(new ConditionalBranch16[0]);
 
       LogicalExpressionNode end = null;
-      for (final InstructionSet.ConditionalBranch cb : set) {
+      for (final ConditionalBranch cb : set) {
          final SimpleLogicalExpressionNode sn = new SimpleLogicalExpressionNode(cb);
          if (logicalExpressionNode == null) {
             logicalExpressionNode = sn;
@@ -388,21 +391,21 @@ public class BranchSet {
       }
    }
 
-   public List<InstructionSet.ConditionalBranch> getBranches() {
+   public List<ConditionalBranch> getBranches() {
       return (set);
    }
 
-   public InstructionSet.Branch getFirst() {
+   public Branch getFirst() {
       return (first);
    }
 
-   public InstructionSet.Branch getLast() {
+   public Branch getLast() {
 
       return (last);
    }
 
    public void unhook() {
-      for (final InstructionSet.Branch b : set) {
+      for (final Branch b : set) {
          b.unhook();
       }
    }
diff --git a/src/main/java/com/aparapi/internal/instruction/ExpressionList.java b/src/main/java/com/aparapi/internal/instruction/ExpressionList.java
index d22c4380..c5c8413c 100644
--- a/src/main/java/com/aparapi/internal/instruction/ExpressionList.java
+++ b/src/main/java/com/aparapi/internal/instruction/ExpressionList.java
@@ -58,10 +58,19 @@ import java.util.List;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-import com.aparapi.internal.model.ClassModel;
 import com.aparapi.Config;
 import com.aparapi.internal.exception.ClassParseException;
+import com.aparapi.internal.instruction.InstructionSet.AssignToLocalVariable;
+import com.aparapi.internal.instruction.InstructionSet.Branch;
+import com.aparapi.internal.instruction.InstructionSet.ByteCode;
+import com.aparapi.internal.instruction.InstructionSet.CompositeArbitraryScopeInstruction;
+import com.aparapi.internal.instruction.InstructionSet.CompositeInstruction;
+import com.aparapi.internal.instruction.InstructionSet.ConditionalBranch;
+import com.aparapi.internal.instruction.InstructionSet.FakeGoto;
+import com.aparapi.internal.instruction.InstructionSet.Return;
+import com.aparapi.internal.instruction.InstructionSet.UnconditionalBranch;
 import com.aparapi.internal.model.MethodModel;
+import com.aparapi.internal.model.ClassModel.LocalVariableTableEntry;
 import com.aparapi.internal.model.ClassModel.LocalVariableInfo;
 
 /**
@@ -143,7 +152,7 @@ public class ExpressionList{
    public boolean doesNotContainCompositeOrBranch(Instruction _start, Instruction _exclusiveEnd) {
       boolean ok = true;
       for (Instruction i = _start; (i != null) && (i != _exclusiveEnd); i = i.getNextExpr()) {
-         if (!(i instanceof InstructionSet.CompositeInstruction) && (i.isBranch())) {
+         if (!(i instanceof CompositeInstruction) && (i.isBranch())) {
             ok = false;
             break;
          }
@@ -462,7 +471,7 @@ public class ExpressionList{
                    *       <----------
                    * </pre>
                    **/
-                  final BranchSet branchSet = ((InstructionSet.ConditionalBranch) tail.asBranch()).getOrCreateBranchSet();
+                  final BranchSet branchSet = ((ConditionalBranch) tail.asBranch()).getOrCreateBranchSet();
                   Instruction loopTop = branchSet.getTarget().getRootExpr();
                   final Instruction beginingOfBranch = branchSet.getFirst();
 
@@ -471,14 +480,14 @@ public class ExpressionList{
                   if (startOfBeginningOfBranch == loopTop) {
 
                      loopTop = loopTop.getPrevExpr();
-                     if (loopTop instanceof InstructionSet.AssignToLocalVariable) {
-                        final ClassModel.LocalVariableInfo localVariableInfo = ((InstructionSet.AssignToLocalVariable) loopTop).getLocalVariableInfo();
+                     if (loopTop instanceof AssignToLocalVariable) {
+                        final LocalVariableInfo localVariableInfo = ((AssignToLocalVariable) loopTop).getLocalVariableInfo();
                         if ((localVariableInfo.getStart() == loopTop.getNextExpr().getStartPC())
                               && (localVariableInfo.getEnd() == _instruction.getThisPC())) {
                            loopTop = loopTop.getPrevExpr(); // back up over the initialization
                         }
                      }
-                     addAsComposites(InstructionSet.ByteCode.COMPOSITE_EMPTY_LOOP, loopTop, branchSet);
+                     addAsComposites(ByteCode.COMPOSITE_EMPTY_LOOP, loopTop, branchSet);
                      handled = true;
                   } else {
 
@@ -490,14 +499,14 @@ public class ExpressionList{
                            loopTop = loopTop.getPrevExpr();
                            // looptop == the unconditional?
                            loopTop = loopTop.getPrevExpr();
-                           if (loopTop instanceof InstructionSet.AssignToLocalVariable) {
-                              final ClassModel.LocalVariableInfo localVariableInfo = ((InstructionSet.AssignToLocalVariable) loopTop).getLocalVariableInfo();
+                           if (loopTop instanceof AssignToLocalVariable) {
+                              final LocalVariableInfo localVariableInfo = ((AssignToLocalVariable) loopTop).getLocalVariableInfo();
                               if ((localVariableInfo.getStart() == loopTop.getNextExpr().getStartPC())
                                     && (localVariableInfo.getEnd() == _instruction.getThisPC())) {
                                  loopTop = loopTop.getPrevExpr(); // back up over the initialization
                               }
                            }
-                           addAsComposites(InstructionSet.ByteCode.COMPOSITE_FOR_ECLIPSE, loopTop, branchSet);
+                           addAsComposites(ByteCode.COMPOSITE_FOR_ECLIPSE, loopTop, branchSet);
                            handled = true;
                         }
                      }
@@ -511,7 +520,7 @@ public class ExpressionList{
                                  .getPrevExpr())) {
                               loopTop = loopTop.getPrevExpr();
                               branchSet.unhook();
-                              addAsComposites(InstructionSet.ByteCode.COMPOSITE_DO_WHILE, loopTop, branchSet);
+                              addAsComposites(ByteCode.COMPOSITE_DO_WHILE, loopTop, branchSet);
                               handled = true;
                            }
                         } else {
@@ -546,9 +555,9 @@ public class ExpressionList{
                    *               
                    *</pre>
                    */
-                  final InstructionSet.ConditionalBranch lastForwardConditional = _instruction.getForwardConditionalBranches().getLast();
+                  final ConditionalBranch lastForwardConditional = _instruction.getForwardConditionalBranches().getLast();
                   final BranchSet branchSet = lastForwardConditional.getOrCreateBranchSet();
-                  final InstructionSet.Branch reverseGoto = tail.asBranch();
+                  final Branch reverseGoto = tail.asBranch();
                   final Instruction loopBackTarget = reverseGoto.getTarget();
                   if (loopBackTarget.getReverseUnconditionalBranches().size() > 1) {
                      throw new ClassParseException(ClassParseException.TYPE.CONFUSINGBRANCHESPOSSIBLYCONTINUE);
@@ -565,7 +574,7 @@ public class ExpressionList{
                       *               
                       *</pre>
                       */
-                     final InstructionSet.Branch lastForwardUnconditional = _instruction.getForwardUnconditionalBranches().getLast();
+                     final Branch lastForwardUnconditional = _instruction.getForwardUnconditionalBranches().getLast();
                      if ((lastForwardUnconditional != null) && lastForwardUnconditional.isAfter(lastForwardConditional)) {
                         throw new ClassParseException(ClassParseException.TYPE.CONFUSINGBRANCHESPOSSIBLYBREAK);
                      }
@@ -598,7 +607,7 @@ public class ExpressionList{
 
                      final Instruction loopbackTargetRoot = loopBackTarget.getRootExpr();
                      if (loopbackTargetRoot.isBranch() && loopbackTargetRoot.asBranch().isConditional()) {
-                        final InstructionSet.ConditionalBranch topOfRealLoop = (InstructionSet.ConditionalBranch) loopbackTargetRoot.asBranch();
+                        final ConditionalBranch topOfRealLoop = (ConditionalBranch) loopbackTargetRoot.asBranch();
                         BranchSet extentBranchSet = topOfRealLoop.getBranchSet();
                         if (topOfRealLoop.getBranchSet() == null) {
                            extentBranchSet = topOfRealLoop.findEndOfConditionalBranchSet(_instruction.getNextPC())
@@ -608,8 +617,8 @@ public class ExpressionList{
                         if (doesNotContainCompositeOrBranch(extentBranchSet.getLast().getNextExpr(), reverseGoto)) {
 
                            Instruction loopTop = topOfRealLoop.getPrevExpr();
-                           if (loopTop instanceof InstructionSet.AssignToLocalVariable) {
-                              final ClassModel.LocalVariableInfo localVariableInfo = ((InstructionSet.AssignToLocalVariable) loopTop).getLocalVariableInfo();
+                           if (loopTop instanceof AssignToLocalVariable) {
+                              final LocalVariableInfo localVariableInfo = ((AssignToLocalVariable) loopTop).getLocalVariableInfo();
                               if ((localVariableInfo.getStart() == loopTop.getNextExpr().getStartPC())
                                     && (localVariableInfo.getEnd() == _instruction.getThisPC())) {
                                  loopTop = loopTop.getPrevExpr(); // back up over the initialization
@@ -617,8 +626,8 @@ public class ExpressionList{
                            }
                            extentBranchSet.unhook();
 
-                           addAsComposites(InstructionSet.ByteCode.COMPOSITE_FOR_SUN, loopTop, extentBranchSet);
-                           final InstructionSet.UnconditionalBranch fakeGoto = new InstructionSet.FakeGoto(methodModel, extentBranchSet.getLast().getTarget());
+                           addAsComposites(ByteCode.COMPOSITE_FOR_SUN, loopTop, extentBranchSet);
+                           final UnconditionalBranch fakeGoto = new FakeGoto(methodModel, extentBranchSet.getLast().getTarget());
 
                            add(fakeGoto);
                            extentBranchSet.getLast().getTarget().addBranchTarget(fakeGoto);
@@ -642,8 +651,8 @@ public class ExpressionList{
                            }
                         }
 
-                        if (loopTop instanceof InstructionSet.AssignToLocalVariable) {
-                           final ClassModel.LocalVariableInfo localVariableInfo = ((InstructionSet.AssignToLocalVariable) loopTop).getLocalVariableInfo();
+                        if (loopTop instanceof AssignToLocalVariable) {
+                           final LocalVariableInfo localVariableInfo = ((AssignToLocalVariable) loopTop).getLocalVariableInfo();
                            if ((localVariableInfo.getStart() == loopTop.getNextExpr().getStartPC())
                                  && (localVariableInfo.getEnd() == _instruction.getThisPC())) {
                               loopTop = loopTop.getPrevExpr(); // back up over the initialization
@@ -654,10 +663,10 @@ public class ExpressionList{
 
                         // If there is an inner scope, it is likely that the loop counter var
                         // is modified using an inner scope variable so use while rather than for
-                        if (reverseGoto.getPrevExpr() instanceof InstructionSet.CompositeArbitraryScopeInstruction) {
-                           addAsComposites(InstructionSet.ByteCode.COMPOSITE_WHILE, loopTop, branchSet);
+                        if (reverseGoto.getPrevExpr() instanceof CompositeArbitraryScopeInstruction) {
+                           addAsComposites(ByteCode.COMPOSITE_WHILE, loopTop, branchSet);
                         } else {
-                           addAsComposites(InstructionSet.ByteCode.COMPOSITE_FOR_SUN, loopTop, branchSet);
+                           addAsComposites(ByteCode.COMPOSITE_FOR_SUN, loopTop, branchSet);
                         }
                         handled = true;
                      }
@@ -674,31 +683,31 @@ public class ExpressionList{
                    *
                    *</pre>
                    */
-                  final InstructionSet.ConditionalBranch lastForwardConditional = _instruction.getForwardConditionalBranches().getLast();
+                  final ConditionalBranch lastForwardConditional = _instruction.getForwardConditionalBranches().getLast();
                   final BranchSet branchSet = lastForwardConditional.getOrCreateBranchSet();
                   if (doesNotContainContinueOrBreak(branchSet.getLast().getNextExpr(), _instruction)) {
                      branchSet.unhook();
-                     addAsComposites(InstructionSet.ByteCode.COMPOSITE_IF, branchSet.getFirst().getPrevExpr(), branchSet);
+                     addAsComposites(ByteCode.COMPOSITE_IF, branchSet.getFirst().getPrevExpr(), branchSet);
                      handled = true;
                   }
                }
                if (!handled && !tail.isForwardBranch() && _instruction.isForwardUnconditionalBranchTarget()) {
 
-                  final LinkedList<InstructionSet.Branch> forwardUnconditionalBranches = _instruction.getForwardUnconditionalBranches();
+                  final LinkedList<Branch> forwardUnconditionalBranches = _instruction.getForwardUnconditionalBranches();
 
-                  final InstructionSet.Branch lastForwardUnconditional = forwardUnconditionalBranches.getLast();
+                  final Branch lastForwardUnconditional = forwardUnconditionalBranches.getLast();
                   final Instruction afterGoto = lastForwardUnconditional.getNextExpr();
                   if (afterGoto.getStartInstruction().isForwardConditionalBranchTarget()) {
-                     final LinkedList<InstructionSet.ConditionalBranch> forwardConditionalBranches = afterGoto.getStartInstruction()
+                     final LinkedList<ConditionalBranch> forwardConditionalBranches = afterGoto.getStartInstruction()
                            .getForwardConditionalBranches();
-                     final InstructionSet.ConditionalBranch lastForwardConditional = forwardConditionalBranches.getLast();
+                     final ConditionalBranch lastForwardConditional = forwardConditionalBranches.getLast();
                      final BranchSet branchSet = lastForwardConditional.getOrCreateBranchSet();
 
                      if (doesNotContainCompositeOrBranch(branchSet.getLast().getNextExpr(), lastForwardUnconditional)) {
                         if (doesNotContainContinueOrBreak(afterGoto.getNextExpr(), _instruction)) {
                            branchSet.unhook();
                            lastForwardUnconditional.unhook();
-                           addAsComposites(InstructionSet.ByteCode.COMPOSITE_IF_ELSE, branchSet.getFirst().getPrevExpr(), branchSet);
+                           addAsComposites(ByteCode.COMPOSITE_IF_ELSE, branchSet.getFirst().getPrevExpr(), branchSet);
                            handled = true;
                         }
                      } else {
@@ -721,8 +730,8 @@ public class ExpressionList{
                            // as a possible end
 
                            for (int i = forwardUnconditionalBranches.size(); i > 1; i--) {
-                              final InstructionSet.Branch thisGoto = forwardUnconditionalBranches.get(i - 1);
-                              final InstructionSet.Branch elseGoto = forwardUnconditionalBranches.get(i - 2);
+                              final Branch thisGoto = forwardUnconditionalBranches.get(i - 1);
+                              final Branch elseGoto = forwardUnconditionalBranches.get(i - 2);
                               final Instruction afterElseGoto = elseGoto.getNextExpr();
                               if (afterElseGoto.getStartInstruction().isConditionalBranchTarget()) {
                                  final BranchSet elseBranchSet = afterElseGoto.getStartInstruction()
@@ -739,8 +748,8 @@ public class ExpressionList{
 
                                        }
 
-                                       final InstructionSet.CompositeInstruction composite = InstructionSet.CompositeInstruction.create(
-                                             InstructionSet.ByteCode.COMPOSITE_IF_ELSE, methodModel, elseBranchSet.getFirst(), thisGoto,
+                                       final CompositeInstruction composite = CompositeInstruction.create(
+                                             ByteCode.COMPOSITE_IF_ELSE, methodModel, elseBranchSet.getFirst(), thisGoto,
                                              elseBranchSet);
                                        replaceInclusive(elseBranchSet.getFirst(), thisGoto.getPrevExpr(), composite);
 
@@ -763,8 +772,8 @@ public class ExpressionList{
                      && _instruction.isForwardUnconditionalBranchTarget()) {
                   // here we have multiple composites ending at the same point
 
-                  final InstructionSet.Branch lastForwardUnconditional = _instruction.getForwardUnconditionalBranches().getLast();
-                  final InstructionSet.ConditionalBranch lastForwardConditional = _instruction.getStartInstruction()
+                  final Branch lastForwardUnconditional = _instruction.getForwardUnconditionalBranches().getLast();
+                  final ConditionalBranch lastForwardConditional = _instruction.getStartInstruction()
                         .getForwardConditionalBranches().getLast();
                   // we will clip the tail and see if recursing helps
 
@@ -787,11 +796,11 @@ public class ExpressionList{
          } else {
 
             // might be end of arbitrary scope
-            final ClassModel.LocalVariableTableEntry<LocalVariableInfo> localVariableTable = methodModel.getMethod()
+            final LocalVariableTableEntry<LocalVariableInfo> localVariableTable = methodModel.getMethod()
                   .getLocalVariableTableEntry();
             int startPc = Short.MAX_VALUE;
 
-            for (final ClassModel.LocalVariableInfo localVariableInfo : localVariableTable) {
+            for (final LocalVariableInfo localVariableInfo : localVariableTable) {
                if (localVariableInfo.getEnd() == _instruction.getThisPC()) {
                   logger.fine(localVariableInfo.getVariableName() + "  scope  " + localVariableInfo.getStart() + " ,"
                         + localVariableInfo.getEnd());
@@ -807,7 +816,7 @@ public class ExpressionList{
                      final Instruction startInstruction = i.getRootExpr().getPrevExpr();
                      logger.fine("Start = " + startInstruction);
 
-                     addAsComposites(InstructionSet.ByteCode.COMPOSITE_ARBITRARY_SCOPE, startInstruction.getPrevExpr(), null);
+                     addAsComposites(ByteCode.COMPOSITE_ARBITRARY_SCOPE, startInstruction.getPrevExpr(), null);
                      handled = true;
                      break;
                   }
@@ -830,10 +839,10 @@ public class ExpressionList{
       return (handled);
    }
 
-   private void addAsComposites(InstructionSet.ByteCode _byteCode, Instruction _start, BranchSet _branchSet) {
+   private void addAsComposites(ByteCode _byteCode, Instruction _start, BranchSet _branchSet) {
       final Instruction childTail = tail;
       final Instruction childHead = createList(_start);
-      final InstructionSet.CompositeInstruction composite = InstructionSet.CompositeInstruction.create(_byteCode, methodModel, childHead, childTail, _branchSet);
+      final CompositeInstruction composite = CompositeInstruction.create(_byteCode, methodModel, childHead, childTail, _branchSet);
       add(composite);
    }
 
@@ -865,7 +874,7 @@ public class ExpressionList{
       final Instruction[] array = list.toArray(new Instruction[0]);
       boolean lastWasCursor = false;
 
-      final List<InstructionSet.Branch> branches = new ArrayList<InstructionSet.Branch>();
+      final List<Branch> branches = new ArrayList<Branch>();
       for (final Instruction i : list) {
          sb.append(String.format(" %3d", i.getStartPC()));
       }
@@ -905,9 +914,9 @@ public class ExpressionList{
             } else {
                sb.append("<<");
             }
-         } else if (i instanceof InstructionSet.CompositeInstruction) {
+         } else if (i instanceof CompositeInstruction) {
             sb.append(" C");
-         } else if (i instanceof InstructionSet.Return) {
+         } else if (i instanceof Return) {
 
             sb.append(" R");
             // } else if (i instanceof AssignToLocalVariable) {
@@ -923,7 +932,7 @@ public class ExpressionList{
          sb.append("  ");
       }
 
-      for (final InstructionSet.Branch b : branches) {
+      for (final Branch b : branches) {
          sb.append("\n   ");
          if (b.isForward()) {
             for (int i = 0; i < array.length; i++) {
diff --git a/src/main/java/com/aparapi/internal/instruction/Instruction.java b/src/main/java/com/aparapi/internal/instruction/Instruction.java
index c786a28f..9d3b2352 100644
--- a/src/main/java/com/aparapi/internal/instruction/Instruction.java
+++ b/src/main/java/com/aparapi/internal/instruction/Instruction.java
@@ -54,6 +54,10 @@ package com.aparapi.internal.instruction;
 
 import java.util.LinkedList;
 
+import com.aparapi.internal.instruction.InstructionSet.Branch;
+import com.aparapi.internal.instruction.InstructionSet.ByteCode;
+import com.aparapi.internal.instruction.InstructionSet.CompositeInstruction;
+import com.aparapi.internal.instruction.InstructionSet.ConditionalBranch;
 import com.aparapi.internal.model.MethodModel;
 import com.aparapi.internal.reader.ByteReader;
 
@@ -72,7 +76,7 @@ public abstract class Instruction{
 
    protected MethodModel method;
 
-   private final InstructionSet.ByteCode byteCode;
+   private final ByteCode byteCode;
 
    private int length;
 
@@ -90,13 +94,13 @@ public abstract class Instruction{
 
    private Instruction parentExpr = null;
 
-   private LinkedList<InstructionSet.ConditionalBranch> forwardConditionalBranchTargets;
+   private LinkedList<ConditionalBranch> forwardConditionalBranchTargets;
 
-   private LinkedList<InstructionSet.ConditionalBranch> reverseConditionalBranchTargets;
+   private LinkedList<ConditionalBranch> reverseConditionalBranchTargets;
 
-   private LinkedList<InstructionSet.Branch> forwardUnconditionalBranchTargets;
+   private LinkedList<Branch> forwardUnconditionalBranchTargets;
 
-   private LinkedList<InstructionSet.Branch> reverseUnconditionalBranchTargets;
+   private LinkedList<Branch> reverseUnconditionalBranchTargets;
 
    private Instruction firstChild = null;
 
@@ -156,7 +160,7 @@ public abstract class Instruction{
       length = _length;
    }
 
-   public final InstructionSet.ByteCode getByteCode() {
+   public final ByteCode getByteCode() {
       return (byteCode);
    }
 
@@ -168,13 +172,13 @@ public abstract class Instruction{
       return (getFirstChild() == null ? pc : getFirstChild().getStartPC());
    }
 
-   protected Instruction(MethodModel _method, InstructionSet.ByteCode _byteCode, int _pc) {
+   protected Instruction(MethodModel _method, ByteCode _byteCode, int _pc) {
       method = _method;
       pc = _pc;
       byteCode = _byteCode;
    }
 
-   protected Instruction(MethodModel _method, InstructionSet.ByteCode _byteCode, ByteReader _byteReader, boolean _wide) {
+   protected Instruction(MethodModel _method, ByteCode _byteCode, ByteReader _byteReader, boolean _wide) {
       this(_method, _byteCode, _wide ? _byteReader.getOffset() - 2 : _byteReader.getOffset() - 1);
    }
 
@@ -196,7 +200,7 @@ public abstract class Instruction{
    }
 
    public boolean isBranch() {
-      return (this instanceof InstructionSet.Branch);
+      return (this instanceof Branch);
    }
 
    public int compareTo(Instruction _other) {
@@ -292,51 +296,51 @@ public abstract class Instruction{
    }
 
    public boolean producesStack() {
-      return ((this instanceof InstructionSet.CompositeInstruction) || (getStackProduceCount() > 0));
+      return ((this instanceof CompositeInstruction) || (getStackProduceCount() > 0));
    }
 
    public Instruction getReal() {
       return (this);
    }
 
-   public InstructionSet.Branch asBranch() {
-      return ((InstructionSet.Branch) this);
+   public Branch asBranch() {
+      return ((Branch) this);
    }
 
    public boolean consumesStack() {
       return (getStackConsumeCount() > 0);
    }
 
-   public void addBranchTarget(InstructionSet.Branch _branch) {
+   public void addBranchTarget(Branch _branch) {
 
       if (_branch.isReverse()) {
          if (_branch.isConditional()) {
             if (reverseConditionalBranchTargets == null) {
-               reverseConditionalBranchTargets = new LinkedList<InstructionSet.ConditionalBranch>();
+               reverseConditionalBranchTargets = new LinkedList<ConditionalBranch>();
             }
-            reverseConditionalBranchTargets.add((InstructionSet.ConditionalBranch) _branch);
+            reverseConditionalBranchTargets.add((ConditionalBranch) _branch);
          } else {
             if (reverseUnconditionalBranchTargets == null) {
-               reverseUnconditionalBranchTargets = new LinkedList<InstructionSet.Branch>();
+               reverseUnconditionalBranchTargets = new LinkedList<Branch>();
             }
             reverseUnconditionalBranchTargets.add(_branch);
          }
       } else {
          if (_branch.isConditional()) {
             if (forwardConditionalBranchTargets == null) {
-               forwardConditionalBranchTargets = new LinkedList<InstructionSet.ConditionalBranch>();
+               forwardConditionalBranchTargets = new LinkedList<ConditionalBranch>();
             }
-            forwardConditionalBranchTargets.add((InstructionSet.ConditionalBranch) _branch);
+            forwardConditionalBranchTargets.add((ConditionalBranch) _branch);
          } else {
             if (forwardUnconditionalBranchTargets == null) {
-               forwardUnconditionalBranchTargets = new LinkedList<InstructionSet.Branch>();
+               forwardUnconditionalBranchTargets = new LinkedList<Branch>();
             }
             forwardUnconditionalBranchTargets.add(_branch);
          }
       }
    }
 
-   public void removeBranchTarget(InstructionSet.Branch _branch) {
+   public void removeBranchTarget(Branch _branch) {
       if (_branch.isReverse()) {
          if (_branch.isConditional()) {
             if (reverseConditionalBranchTargets != null) {
@@ -372,19 +376,19 @@ public abstract class Instruction{
       }
    }
 
-   public LinkedList<InstructionSet.Branch> getForwardUnconditionalBranches() {
+   public LinkedList<Branch> getForwardUnconditionalBranches() {
       return (forwardUnconditionalBranchTargets);
    }
 
-   public LinkedList<InstructionSet.ConditionalBranch> getForwardConditionalBranches() {
+   public LinkedList<ConditionalBranch> getForwardConditionalBranches() {
       return (forwardConditionalBranchTargets);
    }
 
-   public LinkedList<InstructionSet.Branch> getReverseUnconditionalBranches() {
+   public LinkedList<Branch> getReverseUnconditionalBranches() {
       return (reverseUnconditionalBranchTargets);
    }
 
-   public LinkedList<InstructionSet.ConditionalBranch> getReverseConditionalBranches() {
+   public LinkedList<ConditionalBranch> getReverseConditionalBranches() {
       return (reverseConditionalBranchTargets);
    }
 
diff --git a/src/main/java/com/aparapi/internal/instruction/InstructionPattern.java b/src/main/java/com/aparapi/internal/instruction/InstructionPattern.java
index 517d1a12..019f9686 100644
--- a/src/main/java/com/aparapi/internal/instruction/InstructionPattern.java
+++ b/src/main/java/com/aparapi/internal/instruction/InstructionPattern.java
@@ -52,6 +52,20 @@ under those regulations, please refer to the U.S. Bureau of Industry and Securit
 */
 package com.aparapi.internal.instruction;
 
+import com.aparapi.internal.instruction.InstructionSet.AccessArrayElement;
+import com.aparapi.internal.instruction.InstructionSet.AccessInstanceField;
+import com.aparapi.internal.instruction.InstructionSet.AccessLocalVariable;
+import com.aparapi.internal.instruction.InstructionSet.AssignToArrayElement;
+import com.aparapi.internal.instruction.InstructionSet.AssignToInstanceField;
+import com.aparapi.internal.instruction.InstructionSet.AssignToLocalVariable;
+import com.aparapi.internal.instruction.InstructionSet.CastOperator;
+import com.aparapi.internal.instruction.InstructionSet.Constant;
+import com.aparapi.internal.instruction.InstructionSet.I_IADD;
+import com.aparapi.internal.instruction.InstructionSet.I_ICONST_1;
+import com.aparapi.internal.instruction.InstructionSet.I_IINC;
+import com.aparapi.internal.instruction.InstructionSet.I_ISUB;
+import com.aparapi.internal.instruction.InstructionSet.MethodCall;
+
 public class InstructionPattern{
 
    @SuppressWarnings("unused") private boolean compareSubTrees(Instruction _lhs, Instruction _rhs) {
@@ -137,25 +151,25 @@ public class InstructionPattern{
 
    public static final InstructionMatcher assignToLocalVariable = new InstructionMatcher("Assign to local variable"){
       @Override public InstructionMatch matches(Instruction _instruction) {
-         return (InstructionMatch.test(_instruction instanceof InstructionSet.AssignToLocalVariable));
+         return (InstructionMatch.test(_instruction instanceof AssignToLocalVariable));
       }
    };
 
    public static final InstructionMatcher constant = new InstructionMatcher("Constant "){
       @Override public InstructionMatch matches(Instruction _instruction) {
-         return (InstructionMatch.test(_instruction instanceof InstructionSet.Constant<?>));
+         return (InstructionMatch.test(_instruction instanceof Constant<?>));
       }
    };
 
    public static final InstructionMatcher assignToArrayElement = new InstructionMatcher("Assign to array element"){
       @Override public InstructionMatch matches(Instruction _instruction) {
-         return (InstructionMatch.test(_instruction instanceof InstructionSet.AssignToArrayElement));
+         return (InstructionMatch.test(_instruction instanceof AssignToArrayElement));
       }
    };
 
    public static final InstructionMatcher methodCall = new InstructionMatcher("Method Call"){
       @Override public InstructionMatch matches(Instruction _instruction) {
-         return (InstructionMatch.test(_instruction instanceof InstructionSet.MethodCall));
+         return (InstructionMatch.test(_instruction instanceof MethodCall));
       }
    };
 
@@ -174,22 +188,22 @@ public class InstructionPattern{
        * </pre>
        */
       @Override public InstructionMatch matches(Instruction _instruction) {
-         if (_instruction instanceof InstructionSet.AssignToLocalVariable) {
-            final InstructionSet.AssignToLocalVariable assign = (InstructionSet.AssignToLocalVariable) _instruction;
+         if (_instruction instanceof AssignToLocalVariable) {
+            final AssignToLocalVariable assign = (AssignToLocalVariable) _instruction;
             Instruction child = ((Instruction) assign).getFirstChild();
 
-            if (child instanceof InstructionSet.CastOperator) {
+            if (child instanceof CastOperator) {
                child = child.getFirstChild();
             }
 
-            if (child instanceof InstructionSet.I_IADD) {
-               final InstructionSet.I_IADD add = (InstructionSet.I_IADD) child;
+            if (child instanceof I_IADD) {
+               final I_IADD add = (I_IADD) child;
                final Instruction lhs = add.getLhs();
                final Instruction rhs = add.getRhs();
-               if (lhs instanceof InstructionSet.AccessLocalVariable) {
-                  final InstructionSet.AccessLocalVariable access = (InstructionSet.AccessLocalVariable) lhs;
+               if (lhs instanceof AccessLocalVariable) {
+                  final AccessLocalVariable access = (AccessLocalVariable) lhs;
                   if (access.getLocalVariableTableIndex() == assign.getLocalVariableTableIndex()) {
-                     if (rhs instanceof InstructionSet.I_ICONST_1) {
+                     if (rhs instanceof I_ICONST_1) {
                         return (InstructionMatch.TRUE);
                      }
                   }
@@ -216,22 +230,22 @@ public class InstructionPattern{
        * </pre>
        */
       @Override public InstructionMatch matches(Instruction _instruction) {
-         if (_instruction instanceof InstructionSet.AssignToLocalVariable) {
-            final InstructionSet.AssignToLocalVariable assign = (InstructionSet.AssignToLocalVariable) _instruction;
+         if (_instruction instanceof AssignToLocalVariable) {
+            final AssignToLocalVariable assign = (AssignToLocalVariable) _instruction;
             Instruction child = ((Instruction) assign).getFirstChild();
 
-            if (child instanceof InstructionSet.CastOperator) {
+            if (child instanceof CastOperator) {
                child = child.getFirstChild();
             }
 
-            if (child instanceof InstructionSet.I_ISUB) {
-               final InstructionSet.I_ISUB add = (InstructionSet.I_ISUB) child;
+            if (child instanceof I_ISUB) {
+               final I_ISUB add = (I_ISUB) child;
                final Instruction lhs = add.getLhs();
                final Instruction rhs = add.getRhs();
-               if (lhs instanceof InstructionSet.AccessLocalVariable) {
-                  final InstructionSet.AccessLocalVariable access = (InstructionSet.AccessLocalVariable) lhs;
+               if (lhs instanceof AccessLocalVariable) {
+                  final AccessLocalVariable access = (AccessLocalVariable) lhs;
                   if (access.getLocalVariableTableIndex() == assign.getLocalVariableTableIndex()) {
-                     if (rhs instanceof InstructionSet.I_ICONST_1) {
+                     if (rhs instanceof I_ICONST_1) {
                         return (InstructionMatch.TRUE);
                      }
                   }
@@ -257,17 +271,17 @@ public class InstructionPattern{
        */
       @Override public InstructionMatch matches(Instruction _instruction) {
 
-         if (_instruction instanceof InstructionSet.CastOperator) {
-            final InstructionSet.CastOperator topCastOperator = (InstructionSet.CastOperator) _instruction;
+         if (_instruction instanceof CastOperator) {
+            final CastOperator topCastOperator = (CastOperator) _instruction;
             _instruction = topCastOperator.getFirstChild().getReal();
          }
 
-         if (_instruction instanceof InstructionSet.I_IADD) {
-            final InstructionSet.I_IADD add = (InstructionSet.I_IADD) _instruction;
+         if (_instruction instanceof I_IADD) {
+            final I_IADD add = (I_IADD) _instruction;
             final Instruction addLhs = add.getLhs().getReal();
             final Instruction addRhs = add.getRhs().getReal();
-            if (addLhs instanceof InstructionSet.AccessInstanceField) {
-               if (addRhs instanceof InstructionSet.I_ICONST_1) {
+            if (addLhs instanceof AccessInstanceField) {
+               if (addRhs instanceof I_ICONST_1) {
                   return (InstructionMatch.TRUE);
                }
             }
@@ -291,17 +305,17 @@ public class InstructionPattern{
        */
       @Override public InstructionMatch matches(Instruction _instruction) {
 
-         if (_instruction instanceof InstructionSet.CastOperator) {
-            final InstructionSet.CastOperator topCastOperator = (InstructionSet.CastOperator) _instruction;
+         if (_instruction instanceof CastOperator) {
+            final CastOperator topCastOperator = (CastOperator) _instruction;
             _instruction = topCastOperator.getFirstChild().getReal();
          }
 
-         if (_instruction instanceof InstructionSet.I_ISUB) {
-            final InstructionSet.I_ISUB add = (InstructionSet.I_ISUB) _instruction;
+         if (_instruction instanceof I_ISUB) {
+            final I_ISUB add = (I_ISUB) _instruction;
             final Instruction addLhs = add.getLhs().getReal();
             final Instruction addRhs = add.getRhs().getReal();
-            if (addLhs instanceof InstructionSet.AccessInstanceField) {
-               if (addRhs instanceof InstructionSet.I_ICONST_1) {
+            if (addLhs instanceof AccessInstanceField) {
+               if (addRhs instanceof I_ICONST_1) {
                   return (InstructionMatch.TRUE);
                }
             }
@@ -322,11 +336,11 @@ public class InstructionPattern{
        * </pre>
        */
       @Override public InstructionMatch matches(Instruction _instruction) {
-         if (_instruction instanceof InstructionSet.AccessArrayElement) {
-            final InstructionSet.AccessArrayElement accessArrayElement = (InstructionSet.AccessArrayElement) _instruction;
+         if (_instruction instanceof AccessArrayElement) {
+            final AccessArrayElement accessArrayElement = (AccessArrayElement) _instruction;
             final Instruction addLhs = accessArrayElement.getArrayRef().getReal();
             // Instruction addRhs = accessArrayElement.getArrayIndex().getReal();
-            if (addLhs instanceof InstructionSet.AccessInstanceField) {
+            if (addLhs instanceof AccessInstanceField) {
 
                return (InstructionMatch.TRUE);
 
@@ -347,13 +361,13 @@ public class InstructionPattern{
        * </pre>
        */
       @Override public InstructionMatch matches(Instruction _instruction) {
-         if (_instruction instanceof InstructionSet.I_IADD) {
-            final InstructionSet.I_IADD accessArrayElement = (InstructionSet.I_IADD) _instruction;
+         if (_instruction instanceof I_IADD) {
+            final I_IADD accessArrayElement = (I_IADD) _instruction;
             if (accessArrayElement.getLhs() != null) {
                final Instruction addLhs = accessArrayElement.getLhs().getReal();
                if (fieldArrayElementAccess.matches(addLhs).ok) {
                   final Instruction addRhs = accessArrayElement.getRhs().getReal();
-                  if (addRhs instanceof InstructionSet.I_ICONST_1) {
+                  if (addRhs instanceof I_ICONST_1) {
                      return (InstructionMatch.TRUE);
                   }
                }
@@ -374,12 +388,12 @@ public class InstructionPattern{
        * </pre>
        */
       @Override public InstructionMatch matches(Instruction _instruction) {
-         if (_instruction instanceof InstructionSet.I_ISUB) {
-            final InstructionSet.I_ISUB accessArrayElement = (InstructionSet.I_ISUB) _instruction;
+         if (_instruction instanceof I_ISUB) {
+            final I_ISUB accessArrayElement = (I_ISUB) _instruction;
             final Instruction addLhs = accessArrayElement.getLhs().getReal();
             if (fieldArrayElementAccess.matches(addLhs).ok) {
                final Instruction addRhs = accessArrayElement.getRhs().getReal();
-               if (addRhs instanceof InstructionSet.I_ICONST_1) {
+               if (addRhs instanceof I_ICONST_1) {
                   return (InstructionMatch.TRUE);
                }
             }
@@ -401,14 +415,14 @@ public class InstructionPattern{
        * </pre>
        */
       @Override public InstructionMatch matches(Instruction _instruction) {
-         if (_instruction instanceof InstructionSet.AssignToArrayElement) {
-            final InstructionSet.AssignToArrayElement accessArrayElement = (InstructionSet.AssignToArrayElement) _instruction;
+         if (_instruction instanceof AssignToArrayElement) {
+            final AssignToArrayElement accessArrayElement = (AssignToArrayElement) _instruction;
             final Instruction arrayRef = accessArrayElement.getArrayRef().getReal();
             //  Instruction arrayIndex = accessArrayElement.getArrayIndex().getReal();
             final Instruction value = accessArrayElement.getValue().getReal();
 
             // Instruction addRhs = accessArrayElement.getArrayIndex().getReal();
-            if (arrayRef instanceof InstructionSet.AccessInstanceField) {
+            if (arrayRef instanceof AccessInstanceField) {
                if (fieldArrayElementPlusOne.matches(value).ok) {
                   return (InstructionMatch.TRUE);
                }
@@ -431,13 +445,13 @@ public class InstructionPattern{
        * </pre>
        */
       @Override public InstructionMatch matches(Instruction _instruction) {
-         if (_instruction instanceof InstructionSet.AssignToArrayElement) {
-            final InstructionSet.AssignToArrayElement accessArrayElement = (InstructionSet.AssignToArrayElement) _instruction;
+         if (_instruction instanceof AssignToArrayElement) {
+            final AssignToArrayElement accessArrayElement = (AssignToArrayElement) _instruction;
             final Instruction arrayRef = accessArrayElement.getArrayRef().getReal();
             //  Instruction arrayIndex = accessArrayElement.getArrayIndex().getReal();
             final Instruction value = accessArrayElement.getValue().getReal();
             // Instruction addRhs = accessArrayElement.getArrayIndex().getReal();
-            if (arrayRef instanceof InstructionSet.AccessInstanceField) {
+            if (arrayRef instanceof AccessInstanceField) {
                if (fieldArrayElementMinusOne.matches(value).ok) {
                   return (InstructionMatch.TRUE);
                }
@@ -450,37 +464,37 @@ public class InstructionPattern{
 
    public static final InstructionMatcher accessLocalVariable = new InstructionMatcher("access to local variable"){
       @Override InstructionMatch matches(Instruction _instruction) {
-         return (InstructionMatch.test(_instruction instanceof InstructionSet.AccessLocalVariable));
+         return (InstructionMatch.test(_instruction instanceof AccessLocalVariable));
       }
    };
 
    public static final InstructionMatcher inc = new InstructionMatcher("inc"){
       @Override InstructionMatch matches(Instruction _instruction) {
-         return (InstructionMatch.test(_instruction instanceof InstructionSet.I_IINC));
+         return (InstructionMatch.test(_instruction instanceof I_IINC));
       }
    };
 
    public static final InstructionMatcher cast = new InstructionMatcher("cast"){
       @Override InstructionMatch matches(Instruction _instruction) {
-         return (InstructionMatch.test(_instruction instanceof InstructionSet.CastOperator));
+         return (InstructionMatch.test(_instruction instanceof CastOperator));
       }
    };
 
    public static final InstructionMatcher accessInstanceField = new InstructionMatcher("access instance field"){
       @Override InstructionMatch matches(Instruction _instruction) {
-         return (InstructionMatch.test(_instruction instanceof InstructionSet.AccessInstanceField));
+         return (InstructionMatch.test(_instruction instanceof AccessInstanceField));
       }
    };
 
    public static final InstructionMatcher assignToInstanceField = new InstructionMatcher("assign to instance field"){
       @Override InstructionMatch matches(Instruction _instruction) {
-         return (InstructionMatch.test(_instruction instanceof InstructionSet.AssignToInstanceField));
+         return (InstructionMatch.test(_instruction instanceof AssignToInstanceField));
       }
    };
 
    public static final InstructionMatcher iadd = new InstructionMatcher("iadd"){
       @Override InstructionMatch matches(Instruction _instruction) {
-         return (InstructionMatch.test(_instruction instanceof InstructionSet.I_IADD));
+         return (InstructionMatch.test(_instruction instanceof I_IADD));
       }
    };
 }
diff --git a/src/main/java/com/aparapi/internal/instruction/InstructionSet.java b/src/main/java/com/aparapi/internal/instruction/InstructionSet.java
index cee82112..61510ec2 100644
--- a/src/main/java/com/aparapi/internal/instruction/InstructionSet.java
+++ b/src/main/java/com/aparapi/internal/instruction/InstructionSet.java
@@ -55,8 +55,13 @@ package com.aparapi.internal.instruction;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
 
-import com.aparapi.internal.model.ClassModel;
 import com.aparapi.internal.model.MethodModel;
+import com.aparapi.internal.model.ClassModel.ConstantPool;
+import com.aparapi.internal.model.ClassModel.ConstantPool.Entry;
+import com.aparapi.internal.model.ClassModel.ConstantPool.FieldEntry;
+import com.aparapi.internal.model.ClassModel.ConstantPool.MethodEntry;
+import com.aparapi.internal.model.ClassModel.LocalVariableTableEntry;
+import com.aparapi.internal.model.ClassModel.LocalVariableInfo;
 import com.aparapi.internal.reader.ByteReader;
 
 public class InstructionSet{
@@ -1245,7 +1250,7 @@ public class InstructionSet{
          return (index);
       }
 
-      @Override public ClassModel.LocalVariableInfo getLocalVariableInfo() {
+      @Override public LocalVariableInfo getLocalVariableInfo() {
          return (method.getLocalVariableTableEntry().getVariable(getThisPC() + getLength(), getLocalVariableTableIndex()));
       }
    }
@@ -1269,7 +1274,7 @@ public class InstructionSet{
       }
 
       @Override public boolean isDeclaration() {
-         ClassModel.LocalVariableInfo lvi = method.getLocalVariableTableEntry().getVariable(getThisPC() + getLength(),
+         LocalVariableInfo lvi = method.getLocalVariableTableEntry().getVariable(getThisPC() + getLength(),
                getLocalVariableTableIndex());
          return (lvi.getStart() == getThisPC() + getLength());
       }
@@ -1288,7 +1293,7 @@ public class InstructionSet{
          return (index);
       }
 
-      @Override public ClassModel.LocalVariableInfo getLocalVariableInfo() {
+      @Override public LocalVariableInfo getLocalVariableInfo() {
          return (method.getLocalVariableTableEntry().getVariable(getThisPC() + getLength(), getLocalVariableTableIndex()));
       }
    }
@@ -1309,8 +1314,8 @@ public class InstructionSet{
       }
 
       @Override public boolean isDeclaration() {
-         final ClassModel.LocalVariableTableEntry localVariableTableEntry = method.getLocalVariableTableEntry();
-         final ClassModel.LocalVariableInfo localVarInfo = localVariableTableEntry.getVariable(getThisPC() + getLength(),
+         final LocalVariableTableEntry localVariableTableEntry = method.getLocalVariableTableEntry();
+         final LocalVariableInfo localVarInfo = localVariableTableEntry.getVariable(getThisPC() + getLength(),
                getLocalVariableTableIndex());
          return ((localVarInfo != null) && (localVarInfo.getStart() == (getThisPC() + getLength())));
       }
@@ -2045,7 +2050,7 @@ public class InstructionSet{
          return (index);
       }
 
-      @Override public ClassModel.ConstantPool.FieldEntry getConstantPoolFieldEntry() {
+      @Override public FieldEntry getConstantPoolFieldEntry() {
          return (method.getConstantPool().getFieldEntry(getConstantPoolFieldIndex()));
       }
 
@@ -2075,7 +2080,7 @@ public class InstructionSet{
          return (index);
       }
 
-      @Override public ClassModel.ConstantPool.FieldEntry getConstantPoolFieldEntry() {
+      @Override public FieldEntry getConstantPoolFieldEntry() {
          return (method.getConstantPool().getFieldEntry(getConstantPoolFieldIndex()));
       }
 
@@ -2468,7 +2473,7 @@ public class InstructionSet{
          return ("inc var index 08 bit by byte");
       }
 
-      public ClassModel.LocalVariableInfo getLocalVariableInfo() {
+      public LocalVariableInfo getLocalVariableInfo() {
          return (method.getLocalVariableTableEntry().getVariable(getThisPC(), getLocalVariableTableIndex()));
       }
 
@@ -2581,7 +2586,7 @@ public class InstructionSet{
          return (index);
       }
 
-      @Override public ClassModel.ConstantPool.InterfaceMethodEntry getConstantPoolInterfaceMethodEntry() {
+      @Override public ConstantPool.InterfaceMethodEntry getConstantPoolInterfaceMethodEntry() {
          return (method.getConstantPool().getInterfaceMethodEntry(getConstantPoolInterfaceMethodIndex()));
       }
 
@@ -2632,7 +2637,7 @@ public class InstructionSet{
          return (index);
       }
 
-      @Override public ClassModel.ConstantPool.InterfaceMethodEntry getConstantPoolInterfaceMethodEntry() {
+      @Override public ConstantPool.InterfaceMethodEntry getConstantPoolInterfaceMethodEntry() {
          return (method.getConstantPool().getInterfaceMethodEntry(getConstantPoolInterfaceMethodIndex()));
       }
 
@@ -2674,7 +2679,7 @@ public class InstructionSet{
          return (index);
       }
 
-      @Override public ClassModel.ConstantPool.MethodEntry getConstantPoolMethodEntry() {
+      @Override public ConstantPool.MethodEntry getConstantPoolMethodEntry() {
          return (method.getConstantPool().getMethodEntry(getConstantPoolMethodIndex()));
       }
 
@@ -2716,7 +2721,7 @@ public class InstructionSet{
          return (index);
       }
 
-      @Override public ClassModel.ConstantPool.MethodEntry getConstantPoolMethodEntry() {
+      @Override public ConstantPool.MethodEntry getConstantPoolMethodEntry() {
          return (method.getConstantPool().getMethodEntry(getConstantPoolMethodIndex()));
       }
 
@@ -2754,7 +2759,7 @@ public class InstructionSet{
          return (index);
       }
 
-      @Override public ClassModel.ConstantPool.MethodEntry getConstantPoolMethodEntry() {
+      @Override public ConstantPool.MethodEntry getConstantPoolMethodEntry() {
          return (method.getConstantPool().getMethodEntry(getConstantPoolMethodIndex()));
       }
 
@@ -3030,7 +3035,7 @@ public class InstructionSet{
          return (index);
       }
 
-      @Override public ClassModel.ConstantPool.Entry getConstantPoolEntry() {
+      @Override public Entry getConstantPoolEntry() {
          return (method.getConstantPool().get(getConstantPoolIndex()));
       }
    }
@@ -3053,7 +3058,7 @@ public class InstructionSet{
 
       }
 
-      @Override public ClassModel.ConstantPool.Entry getConstantPoolEntry() {
+      @Override public Entry getConstantPoolEntry() {
          return (method.getConstantPool().get(getConstantPoolIndex()));
       }
    }
@@ -3071,7 +3076,7 @@ public class InstructionSet{
          return (index);
       }
 
-      @Override public ClassModel.ConstantPool.Entry getConstantPoolEntry() {
+      @Override public Entry getConstantPoolEntry() {
          return (method.getConstantPool().get(getConstantPoolIndex()));
       }
 
@@ -3391,7 +3396,7 @@ public class InstructionSet{
          return (index);
       }
 
-      @Override public ClassModel.ConstantPool.FieldEntry getConstantPoolFieldEntry() {
+      @Override public FieldEntry getConstantPoolFieldEntry() {
          return (method.getConstantPool().getFieldEntry(getConstantPoolFieldIndex()));
       }
 
@@ -3425,7 +3430,7 @@ public class InstructionSet{
          return (index);
       }
 
-      @Override public ClassModel.ConstantPool.FieldEntry getConstantPoolFieldEntry() {
+      @Override public FieldEntry getConstantPoolFieldEntry() {
          return (method.getConstantPool().getFieldEntry(getConstantPoolFieldIndex()));
       }
 
@@ -3451,7 +3456,7 @@ public class InstructionSet{
          return ("return to pc in local var index 08 bit");
       }
 
-      @Override public ClassModel.LocalVariableInfo getLocalVariableInfo() {
+      @Override public LocalVariableInfo getLocalVariableInfo() {
          return (method.getLocalVariableTableEntry().getVariable(getThisPC() + getLength(), getLocalVariableTableIndex()));
       }
 
@@ -3680,7 +3685,7 @@ public class InstructionSet{
    public interface MethodCall{
       int getConstantPoolMethodIndex();
 
-      ClassModel.ConstantPool.MethodEntry getConstantPoolMethodEntry();
+      MethodEntry getConstantPoolMethodEntry();
 
       Instruction getArg(int _arg);
    }
@@ -3692,7 +3697,7 @@ public class InstructionSet{
    public interface InterfaceConstantPoolMethodIndexAccessor{
       public int getConstantPoolInterfaceMethodIndex();
 
-      public ClassModel.ConstantPool.InterfaceMethodEntry getConstantPoolInterfaceMethodEntry();
+      public ConstantPool.InterfaceMethodEntry getConstantPoolInterfaceMethodEntry();
 
       public Instruction getInstanceReference();
 
@@ -3707,7 +3712,7 @@ public class InstructionSet{
    public interface FieldReference{
       public int getConstantPoolFieldIndex();
 
-      public ClassModel.ConstantPool.FieldEntry getConstantPoolFieldEntry();
+      public FieldEntry getConstantPoolFieldEntry();
    }
 
    public interface AccessField extends FieldReference{
@@ -3729,7 +3734,7 @@ public class InstructionSet{
    public interface LocalVariableTableIndexAccessor{
       int getLocalVariableTableIndex();
 
-      ClassModel.LocalVariableInfo getLocalVariableInfo();
+      LocalVariableInfo getLocalVariableInfo();
    }
 
    public interface AccessLocalVariable extends LocalVariableTableIndexAccessor{
@@ -3747,7 +3752,7 @@ public class InstructionSet{
    @SuppressWarnings("unchecked") public interface ConstantPoolEntryConstant extends Constant{
       int getConstantPoolIndex();
 
-      ClassModel.ConstantPool.Entry getConstantPoolEntry();
+      ConstantPool.Entry getConstantPoolEntry();
    };
 
    public interface HasOperator{
diff --git a/src/main/java/com/aparapi/internal/jni/KernelArgJNI.java b/src/main/java/com/aparapi/internal/jni/KernelArgJNI.java
index a8a2c045..863e89be 100644
--- a/src/main/java/com/aparapi/internal/jni/KernelArgJNI.java
+++ b/src/main/java/com/aparapi/internal/jni/KernelArgJNI.java
@@ -15,7 +15,7 @@
  */
 package com.aparapi.internal.jni;
 
-import com.aparapi.internal.annotation.UsedByJNICode;
+import com.aparapi.internal.annotation.*;
 
 import java.lang.reflect.*;
 
@@ -47,8 +47,7 @@ public abstract class KernelArgJNI{
     * @see KernelRunnerJNI#ARG_EXPLICIT_WRITE
     * @see KernelRunnerJNI#ARG_OBJ_ARRAY_STRUCT
     */
-   @UsedByJNICode
-   protected int type;
+   @UsedByJNICode protected int type;
 
    /**
     * Name of the field
diff --git a/src/main/java/com/aparapi/internal/jni/KernelRunnerJNI.java b/src/main/java/com/aparapi/internal/jni/KernelRunnerJNI.java
index d2542311..2ef6a54f 100644
--- a/src/main/java/com/aparapi/internal/jni/KernelRunnerJNI.java
+++ b/src/main/java/com/aparapi/internal/jni/KernelRunnerJNI.java
@@ -16,10 +16,10 @@
 package com.aparapi.internal.jni;
 
 import com.aparapi.Kernel;
-import com.aparapi.Range;
-import com.aparapi.device.OpenCLDevice;
 import com.aparapi.ProfileInfo;
+import com.aparapi.Range;
 import com.aparapi.annotation.Experimental;
+import com.aparapi.device.OpenCLDevice;
 import com.aparapi.internal.annotation.DocMe;
 import com.aparapi.internal.annotation.UsedByJNICode;
 
@@ -35,7 +35,7 @@ public abstract class KernelRunnerJNI{
     * This 'bit' indicates that a particular <code>KernelArg</code> represents a <code>boolean</code> type (array or primitive).
     * 
     * 
-    * @see UsedByJNICode
+    * @see com.aparapi.internal.annotation.UsedByJNICode
     * 
     * @author gfrost
     */
@@ -45,7 +45,7 @@ public abstract class KernelRunnerJNI{
     * This 'bit' indicates that a particular <code>KernelArg</code> represents a <code>byte</code> type (array or primitive).
     * 
     * 
-    * @see UsedByJNICode
+    * @see com.aparapi.internal.annotation.UsedByJNICode
     * 
     * @author gfrost
     */
@@ -55,7 +55,7 @@ public abstract class KernelRunnerJNI{
     * This 'bit' indicates that a particular <code>KernelArg</code> represents a <code>float</code> type (array or primitive).
     * 
     * 
-    * @see UsedByJNICode
+    * @see com.aparapi.internal.annotation.UsedByJNICode
     * 
     * @author gfrost
     */
@@ -65,7 +65,7 @@ public abstract class KernelRunnerJNI{
     * This 'bit' indicates that a particular <code>KernelArg</code> represents a <code>int</code> type (array or primitive).
     * 
     * 
-    * @see UsedByJNICode
+    * @see com.aparapi.internal.annotation.UsedByJNICode
     * 
     * @author gfrost
     */
@@ -75,7 +75,7 @@ public abstract class KernelRunnerJNI{
     * This 'bit' indicates that a particular <code>KernelArg</code> represents a <code>double</code> type (array or primitive).
     * 
     * 
-    * @see UsedByJNICode
+    * @see com.aparapi.internal.annotation.UsedByJNICode
     * 
     * @author gfrost
     */
@@ -85,7 +85,7 @@ public abstract class KernelRunnerJNI{
     * This 'bit' indicates that a particular <code>KernelArg</code> represents a <code>long</code> type (array or primitive).
     * 
     * 
-    * @see UsedByJNICode
+    * @see com.aparapi.internal.annotation.UsedByJNICode
     * 
     * @author gfrost
     */
@@ -94,7 +94,7 @@ public abstract class KernelRunnerJNI{
    /**
     * TODO:
     * 
-    * @see UsedByJNICode
+    * @see com.aparapi.internal.annotation.UsedByJNICode
     * 
     * @author gfrost
     */
@@ -105,7 +105,7 @@ public abstract class KernelRunnerJNI{
     * So <code>ARG_ARRAY|ARG_INT</code> tells us this arg is an array of <code>int</code>.
     * 
     * 
-    * @see UsedByJNICode
+    * @see com.aparapi.internal.annotation.UsedByJNICode
     * 
     * @author gfrost
     */
@@ -116,7 +116,7 @@ public abstract class KernelRunnerJNI{
     * So <code>ARG_PRIMITIVE|ARG_INT</code> tells us this arg is a primitive <code>int</code>.
     * 
     * 
-    * @see UsedByJNICode
+    * @see com.aparapi.internal.annotation.UsedByJNICode
     * 
     * @author gfrost
     */
@@ -127,7 +127,7 @@ public abstract class KernelRunnerJNI{
     * So <code>ARG_ARRAY|ARG_INT|ARG_READ</code> tells us this arg is an array of int's that are read by the kernel.
     * 
     * 
-    * @see UsedByJNICode
+    * @see com.aparapi.internal.annotation.UsedByJNICode
     * 
     * @author gfrost
     */
@@ -138,7 +138,7 @@ public abstract class KernelRunnerJNI{
     * So <code>ARG_ARRAY|ARG_INT|ARG_WRITE</code> tells us this arg is an array of int's that we expect the kernel to mutate.
     * 
     * 
-    * @see UsedByJNICode
+    * @see com.aparapi.internal.annotation.UsedByJNICode
     * 
     * @author gfrost
     */
@@ -148,8 +148,8 @@ public abstract class KernelRunnerJNI{
     * This 'bit' indicates that a particular <code>KernelArg</code> resides in local memory in the generated OpenCL code.<br/>
     * 
     * 
-    * @see UsedByJNICode
-    * @see Experimental
+    * @see com.aparapi.internal.annotation.UsedByJNICode
+    * @see com.aparapi.annotation.Experimental
     * 
     * @author gfrost
     */
@@ -159,8 +159,8 @@ public abstract class KernelRunnerJNI{
     * This 'bit' indicates that a particular <code>KernelArg</code> resides in global memory in the generated OpenCL code.<br/>
     * 
     * 
-    * @see UsedByJNICode
-    * @see Experimental
+    * @see com.aparapi.internal.annotation.UsedByJNICode
+    * @see com.aparapi.annotation.Experimental
     * 
     * @author gfrost
     */
@@ -170,8 +170,8 @@ public abstract class KernelRunnerJNI{
     * This 'bit' indicates that a particular <code>KernelArg</code> resides in constant memory in the generated OpenCL code.<br/>
     * 
     * 
-    * @see UsedByJNICode
-    * @see Experimental
+    * @see com.aparapi.internal.annotation.UsedByJNICode
+    * @see com.aparapi.annotation.Experimental
     * 
     * @author gfrost
     */
@@ -181,7 +181,7 @@ public abstract class KernelRunnerJNI{
     * This 'bit' indicates that a particular <code>KernelArg</code> has it's length reference, in which case a synthetic arg is passed (name mangled) to the OpenCL kernel.<br/>
     * 
     * 
-    * @see UsedByJNICode
+    * @see com.aparapi.internal.annotation.UsedByJNICode
     * 
     * @author gfrost
     */
@@ -190,7 +190,7 @@ public abstract class KernelRunnerJNI{
    /**
     * TODO:
     * 
-    * @see UsedByJNICode
+    * @see com.aparapi.internal.annotation.UsedByJNICode
     * 
     * @author gfrost
     */
@@ -199,7 +199,7 @@ public abstract class KernelRunnerJNI{
    /**
     * This 'bit' indicates that the arg has been explicitly marked for reading
     * 
-    * @see UsedByJNICode
+    * @see com.aparapi.internal.annotation.UsedByJNICode
     * 
     * @author gfrost
     */
@@ -208,7 +208,7 @@ public abstract class KernelRunnerJNI{
    /**
     * This 'bit' indicates that the arg has been explicitly marked for writing
     * 
-    * @see UsedByJNICode
+    * @see com.aparapi.internal.annotation.UsedByJNICode
     * 
     * @author gfrost
     */
@@ -217,7 +217,7 @@ public abstract class KernelRunnerJNI{
    /**
     * TODO:
     * 
-    * @see UsedByJNICode
+    * @see com.aparapi.internal.annotation.UsedByJNICode
     * 
     * @author gfrost
     */
@@ -228,7 +228,7 @@ public abstract class KernelRunnerJNI{
     * This 'bit' indicates that a particular <code>KernelArg</code> represents a <code>char</code> type (array or primitive).
     * 
     * 
-    * @see UsedByJNICode
+    * @see com.aparapi.internal.annotation.UsedByJNICode
     * 
     * @author rlamothe
     */
@@ -238,7 +238,7 @@ public abstract class KernelRunnerJNI{
     * This 'bit' indicates that a particular <code>KernelArg</code> represents a <code>static</code> field (array or primitive).
     * 
     * 
-    * @see UsedByJNICode
+    * @see com.aparapi.internal.annotation.UsedByJNICode
     * 
     * @author gfrost
     */
@@ -267,7 +267,7 @@ public abstract class KernelRunnerJNI{
     * 
     * Be careful changing final constants starting with JNI.<br/>
     * 
-    * @see UsedByJNICode
+    * @see com.aparapi.internal.annotation.UsedByJNICode
     * 
     * @author gfrost
     */
@@ -297,7 +297,7 @@ public abstract class KernelRunnerJNI{
     * 
     * Be careful changing final constants starting with JNI.<br/>
     * 
-    * @see UsedByJNICode
+    * @see com.aparapi.internal.annotation.UsedByJNICode
     * 
     * @author ekasit
     */
diff --git a/src/main/java/com/aparapi/internal/jni/OpenCLJNI.java b/src/main/java/com/aparapi/internal/jni/OpenCLJNI.java
index 3e8d48ec..b31187e3 100644
--- a/src/main/java/com/aparapi/internal/jni/OpenCLJNI.java
+++ b/src/main/java/com/aparapi/internal/jni/OpenCLJNI.java
@@ -15,12 +15,12 @@
  */
 package com.aparapi.internal.jni;
 
-import com.aparapi.internal.opencl.OpenCLKernel;
 import com.aparapi.ProfileInfo;
 import java.util.List;
 
 import com.aparapi.device.OpenCLDevice;
 import com.aparapi.internal.opencl.OpenCLArgDescriptor;
+import com.aparapi.internal.opencl.OpenCLKernel;
 import com.aparapi.internal.opencl.OpenCLMem;
 import com.aparapi.internal.opencl.OpenCLPlatform;
 import com.aparapi.internal.opencl.OpenCLProgram;
diff --git a/src/main/java/com/aparapi/internal/kernel/KernelArg.java b/src/main/java/com/aparapi/internal/kernel/KernelArg.java
index 86b389e3..d8c92ab7 100644
--- a/src/main/java/com/aparapi/internal/kernel/KernelArg.java
+++ b/src/main/java/com/aparapi/internal/kernel/KernelArg.java
@@ -15,10 +15,9 @@
  */
 package com.aparapi.internal.kernel;
 
-import com.aparapi.Kernel;
-import com.aparapi.internal.jni.KernelArgJNI;
-import com.aparapi.internal.model.ClassModel;
-import com.aparapi.internal.util.Reflection;
+import com.aparapi.internal.jni.*;
+import com.aparapi.internal.model.*;
+import com.aparapi.internal.util.*;
 
 import java.lang.reflect.*;
 import java.nio.*;
@@ -27,12 +26,12 @@ import java.nio.*;
  * Each field (or captured field in the case of an anonymous inner class) referenced by any bytecode reachable from the users Kernel.run(), will
  * need to be represented as a <code>KernelArg</code>.
  * 
- * @see Kernel#execute(int _globalSize)
+ * @see com.aparapi.Kernel#execute(int _globalSize)
  * 
  * @author gfrost
  * 
  */
-public class KernelArg extends KernelArgJNI {
+public class KernelArg extends KernelArgJNI{
 
    /**
     * The byte array for obj conversion passed to opencl
diff --git a/src/main/java/com/aparapi/internal/kernel/KernelDeviceProfile.java b/src/main/java/com/aparapi/internal/kernel/KernelDeviceProfile.java
index 072b38ba..b58dd6d2 100644
--- a/src/main/java/com/aparapi/internal/kernel/KernelDeviceProfile.java
+++ b/src/main/java/com/aparapi/internal/kernel/KernelDeviceProfile.java
@@ -15,10 +15,8 @@
  */
 package com.aparapi.internal.kernel;
 
-import com.aparapi.Config;
-import com.aparapi.Kernel;
-import com.aparapi.device.Device;
 import com.aparapi.*;
+import com.aparapi.device.*;
 
 import java.text.*;
 import java.util.*;
diff --git a/src/main/java/com/aparapi/internal/kernel/KernelManager.java b/src/main/java/com/aparapi/internal/kernel/KernelManager.java
index 34ce6209..e8359b93 100644
--- a/src/main/java/com/aparapi/internal/kernel/KernelManager.java
+++ b/src/main/java/com/aparapi/internal/kernel/KernelManager.java
@@ -15,13 +15,9 @@
  */
 package com.aparapi.internal.kernel;
 
-import com.aparapi.Config;
-import com.aparapi.Kernel;
-import com.aparapi.device.Device;
-import com.aparapi.device.JavaDevice;
-import com.aparapi.device.OpenCLDevice;
-import com.aparapi.internal.util.Reflection;
 import com.aparapi.*;
+import com.aparapi.device.*;
+import com.aparapi.internal.util.*;
 
 import java.lang.reflect.*;
 import java.util.*;
diff --git a/src/main/java/com/aparapi/internal/kernel/KernelManagers.java b/src/main/java/com/aparapi/internal/kernel/KernelManagers.java
index d5154e8a..d9767812 100644
--- a/src/main/java/com/aparapi/internal/kernel/KernelManagers.java
+++ b/src/main/java/com/aparapi/internal/kernel/KernelManagers.java
@@ -15,7 +15,7 @@
  */
 package com.aparapi.internal.kernel;
 
-import com.aparapi.device.Device;
+import com.aparapi.device.*;
 
 import java.util.*;
 
diff --git a/src/main/java/com/aparapi/internal/kernel/KernelPreferences.java b/src/main/java/com/aparapi/internal/kernel/KernelPreferences.java
index 66d22b9d..20d2954e 100644
--- a/src/main/java/com/aparapi/internal/kernel/KernelPreferences.java
+++ b/src/main/java/com/aparapi/internal/kernel/KernelPreferences.java
@@ -15,9 +15,8 @@
  */
 package com.aparapi.internal.kernel;
 
-import com.aparapi.Kernel;
-import com.aparapi.device.Device;
 import com.aparapi.*;
+import com.aparapi.device.*;
 
 import java.util.*;
 
diff --git a/src/main/java/com/aparapi/internal/kernel/KernelProfile.java b/src/main/java/com/aparapi/internal/kernel/KernelProfile.java
index 97f3fa27..b4d70681 100644
--- a/src/main/java/com/aparapi/internal/kernel/KernelProfile.java
+++ b/src/main/java/com/aparapi/internal/kernel/KernelProfile.java
@@ -15,10 +15,8 @@
  */
 package com.aparapi.internal.kernel;
 
-import com.aparapi.Config;
-import com.aparapi.Kernel;
-import com.aparapi.device.Device;
 import com.aparapi.*;
+import com.aparapi.device.*;
 
 import java.util.*;
 import java.util.logging.*;
diff --git a/src/main/java/com/aparapi/internal/kernel/KernelRunner.java b/src/main/java/com/aparapi/internal/kernel/KernelRunner.java
index 231acdb2..66d34cf6 100644
--- a/src/main/java/com/aparapi/internal/kernel/KernelRunner.java
+++ b/src/main/java/com/aparapi/internal/kernel/KernelRunner.java
@@ -52,24 +52,18 @@ under those regulations, please refer to the U.S. Bureau of Industry and Securit
 */
 package com.aparapi.internal.kernel;
 
-import com.aparapi.Config;
-import com.aparapi.Kernel;
-import com.aparapi.ProfileInfo;
-import com.aparapi.Range;
-import com.aparapi.device.Device;
-import com.aparapi.device.JavaDevice;
-import com.aparapi.device.OpenCLDevice;
-import com.aparapi.internal.annotation.UsedByJNICode;
-import com.aparapi.internal.exception.AparapiException;
-import com.aparapi.internal.exception.CodeGenException;
-import com.aparapi.internal.instruction.InstructionSet;
-import com.aparapi.internal.jni.KernelRunnerJNI;
-import com.aparapi.internal.model.ClassModel;
-import com.aparapi.internal.model.Entrypoint;
-import com.aparapi.internal.util.UnsafeWrapper;
-import com.aparapi.internal.writer.KernelWriter;
-import com.aparapi.opencl.OpenCL;
 import com.aparapi.*;
+import com.aparapi.Kernel.Constant;
+import com.aparapi.Kernel.*;
+import com.aparapi.device.*;
+import com.aparapi.internal.annotation.*;
+import com.aparapi.internal.exception.*;
+import com.aparapi.internal.instruction.InstructionSet.*;
+import com.aparapi.internal.jni.*;
+import com.aparapi.internal.model.*;
+import com.aparapi.internal.util.*;
+import com.aparapi.internal.writer.*;
+import com.aparapi.opencl.*;
 
 import java.lang.reflect.*;
 import java.nio.*;
@@ -89,20 +83,19 @@ import java.util.logging.*;
  * time the <code>ExecutionMode</code> is consulted to determine the default requested mode.  This will dictate how 
  * the <code>KernelRunner</code> will attempt to execute the <code>Kernel</code>
  *   
- * @see Kernel#execute(int _globalSize)
+ * @see com.aparapi.Kernel#execute(int _globalSize)
  * 
  * @author gfrost
  *
  */
-public class KernelRunner extends KernelRunnerJNI {
+public class KernelRunner extends KernelRunnerJNI{
 
    public static boolean BINARY_CACHING_DISABLED = false;
 
    private static final int MINIMUM_ARRAY_SIZE = 1;
 
    /** @see #getCurrentPass() */
-   @UsedByJNICode
-   public static final int PASS_ID_PREPARING_EXECUTION = -2;
+   @UsedByJNICode public static final int PASS_ID_PREPARING_EXECUTION = -2;
    /** @see #getCurrentPass() */
    @UsedByJNICode public static final int PASS_ID_COMPLETED_EXECUTION = -1;
    @UsedByJNICode public static final int CANCEL_STATUS_FALSE = 0;
@@ -345,7 +338,7 @@ public class KernelRunner extends KernelRunnerJNI {
 
    //   @FunctionalInterface
    private interface ThreadIdSetter{
-      void set(Kernel.KernelState kernelState, int globalGroupId, int threadId);
+      void set(KernelState kernelState, int globalGroupId, int threadId);
    }
 
    /**
@@ -390,7 +383,7 @@ public class KernelRunner extends KernelRunnerJNI {
                }
 
                final Kernel kernelClone = kernel.clone();
-               final Kernel.KernelState kernelState = kernelClone.getKernelState();
+               final KernelState kernelState = kernelClone.getKernelState();
 
                kernelState.setRange(_settings.range);
                kernelState.setGroupId(0, 0);
@@ -474,7 +467,7 @@ public class KernelRunner extends KernelRunnerJNI {
                if (_settings.range.getDims() == 1) {
                   threadIdSetter = new ThreadIdSetter() {
                      @Override
-                     public void set(Kernel.KernelState kernelState, int globalGroupId, int threadId) {
+                     public void set(KernelState kernelState, int globalGroupId, int threadId) {
                         //                   (kernelState, globalGroupId, threadId) ->{
                         kernelState.setLocalId(0, (threadId % localSize0));
                         kernelState.setGlobalId(0, (threadId + (globalGroupId * threads)));
@@ -553,7 +546,7 @@ public class KernelRunner extends KernelRunnerJNI {
                    */
                   threadIdSetter = new ThreadIdSetter() {
                      @Override
-                     public void set(Kernel.KernelState kernelState, int globalGroupId, int threadId) {
+                     public void set(KernelState kernelState, int globalGroupId, int threadId) {
                         //                   (kernelState, globalGroupId, threadId) ->{
                         kernelState.setLocalId(0, (threadId % localSize0)); // threadId % localWidth =  (for 33 = 1 % 4 = 1)
                         kernelState.setLocalId(1, (threadId / localSize0)); // threadId / localWidth = (for 33 = 1 / 4 == 0)
@@ -572,7 +565,7 @@ public class KernelRunner extends KernelRunnerJNI {
                   //Same as 2D actually turns out that localId[0] is identical for all three dims so could be hoisted out of conditional code
                   threadIdSetter = new ThreadIdSetter() {
                      @Override
-                     public void set(Kernel.KernelState kernelState, int globalGroupId, int threadId) {
+                     public void set(KernelState kernelState, int globalGroupId, int threadId) {
                         //                   (kernelState, globalGroupId, threadId) ->{
                         kernelState.setLocalId(0, (threadId % localSize0));
 
@@ -641,7 +634,7 @@ public class KernelRunner extends KernelRunnerJNI {
                       *  about other threads.
                       */
                      final Kernel kernelClone = kernel.clone();
-                     final Kernel.KernelState kernelState = kernelClone.getKernelState();
+                     final KernelState kernelState = kernelClone.getKernelState();
                      kernelState.setRange(_settings.range);
                      kernelState.setPassId(passId);
 
@@ -772,7 +765,7 @@ public class KernelRunner extends KernelRunnerJNI {
 
          final Object object = UnsafeWrapper.getObject(newRef, arrayBaseOffset + (arrayScale * j));
          for (int i = 0; i < c.getStructMemberTypes().size(); i++) {
-            final InstructionSet.TypeSpec t = c.getStructMemberTypes().get(i);
+            final TypeSpec t = c.getStructMemberTypes().get(i);
             final long offset = c.getStructMemberOffsets().get(i);
 
             if (logger.isLoggable(Level.FINEST)) {
@@ -803,7 +796,7 @@ public class KernelRunner extends KernelRunnerJNI {
                   final boolean x = UnsafeWrapper.getBoolean(object, offset);
                   arg.getObjArrayByteBuffer().put(x == true ? (byte) 1 : (byte) 0);
                   // Booleans converted to 1 byte C chars for opencl
-                  sizeWritten += InstructionSet.TypeSpec.B.getSize();
+                  sizeWritten += TypeSpec.B.getSize();
                   break;
                }
                case B: {
@@ -873,7 +866,7 @@ public class KernelRunner extends KernelRunnerJNI {
          int sizeWritten = 0;
          final Object object = UnsafeWrapper.getObject(arg.getArray(), arrayBaseOffset + (arrayScale * j));
          for (int i = 0; i < c.getStructMemberTypes().size(); i++) {
-            final InstructionSet.TypeSpec t = c.getStructMemberTypes().get(i);
+            final TypeSpec t = c.getStructMemberTypes().get(i);
             final long offset = c.getStructMemberOffsets().get(i);
             switch (t) {
                case I: {
@@ -911,7 +904,7 @@ public class KernelRunner extends KernelRunnerJNI {
                   }
                   UnsafeWrapper.putBoolean(object, offset, (x == 1 ? true : false));
                   // Booleans converted to 1 byte C chars for open cl
-                  sizeWritten += InstructionSet.TypeSpec.B.getSize();
+                  sizeWritten += TypeSpec.B.getSize();
                   break;
                }
                case B: {
@@ -1199,7 +1192,7 @@ public class KernelRunner extends KernelRunnerJNI {
          throw new IllegalStateException("range can't be null");
       }
 
-      Kernel.EXECUTION_MODE requestedExecutionMode = kernel.getExecutionMode();
+      EXECUTION_MODE requestedExecutionMode = kernel.getExecutionMode();
 
       if (requestedExecutionMode.isOpenCL() && _settings.range.getDevice() != null && !(_settings.range.getDevice() instanceof OpenCLDevice)) {
          fallBackToNextDevice(_settings, "OpenCL EXECUTION_MODE was requested but Device supplied was not an OpenCLDevice");
@@ -1216,9 +1209,9 @@ public class KernelRunner extends KernelRunnerJNI {
                device = JavaDevice.THREAD_POOL;
             }
          } else {
-            if (requestedExecutionMode == Kernel.EXECUTION_MODE.JTP) {
+            if (requestedExecutionMode == EXECUTION_MODE.JTP) {
                device = JavaDevice.THREAD_POOL;
-            } else if (requestedExecutionMode == Kernel.EXECUTION_MODE.SEQ) {
+            } else if (requestedExecutionMode == EXECUTION_MODE.SEQ) {
                device = JavaDevice.SEQUENTIAL;
             }
          }
@@ -1236,14 +1229,14 @@ public class KernelRunner extends KernelRunnerJNI {
          int jniFlags = 0;
          // for legacy reasons use old logic where Kernel.EXECUTION_MODE is not AUTO
          if (_settings.legacyExecutionMode && !userSpecifiedDevice && requestedExecutionMode.isOpenCL()) {
-            if (requestedExecutionMode.equals(Kernel.EXECUTION_MODE.GPU)) {
+            if (requestedExecutionMode.equals(EXECUTION_MODE.GPU)) {
                // Get the best GPU
                openCLDevice = (OpenCLDevice) KernelManager.DeprecatedMethods.bestGPU();
                jniFlags |= JNI_FLAG_USE_GPU; // this flag might be redundant now.
                if (openCLDevice == null) {
                   return fallBackToNextDevice(_settings, "GPU request can't be honored, no GPU device");
                }
-            } else if (requestedExecutionMode.equals(Kernel.EXECUTION_MODE.ACC)) {
+            } else if (requestedExecutionMode.equals(EXECUTION_MODE.ACC)) {
                // Get the best ACC
                openCLDevice = (OpenCLDevice) KernelManager.DeprecatedMethods.bestACC();
                jniFlags |= JNI_FLAG_USE_ACC; // this flag might be redundant now.
@@ -1402,9 +1395,9 @@ public class KernelRunner extends KernelRunnerJNI {
                         final Class<?> type = field.getType();
                         if (type.isArray()) {
 
-                           if (field.getAnnotation(Kernel.Local.class) != null || args[i].getName().endsWith(Kernel.LOCAL_SUFFIX)) {
+                           if (field.getAnnotation(Local.class) != null || args[i].getName().endsWith(Kernel.LOCAL_SUFFIX)) {
                               args[i].setType(args[i].getType() | ARG_LOCAL);
-                           } else if ((field.getAnnotation(Kernel.Constant.class) != null)
+                           } else if ((field.getAnnotation(Constant.class) != null)
                                  || args[i].getName().endsWith(Kernel.CONSTANT_SUFFIX)) {
                               args[i].setType(args[i].getType() | ARG_CONSTANT);
                            } else {
diff --git a/src/main/java/com/aparapi/internal/model/ClassModel.java b/src/main/java/com/aparapi/internal/model/ClassModel.java
index 1ea548ac..e0ce45d0 100644
--- a/src/main/java/com/aparapi/internal/model/ClassModel.java
+++ b/src/main/java/com/aparapi/internal/model/ClassModel.java
@@ -52,16 +52,15 @@ under those regulations, please refer to the U.S. Bureau of Industry and Securit
 */
 package com.aparapi.internal.model;
 
-import com.aparapi.Config;
-import com.aparapi.Kernel;
-import com.aparapi.internal.annotation.DocMe;
-import com.aparapi.internal.exception.AparapiException;
-import com.aparapi.internal.exception.ClassParseException;
-import com.aparapi.internal.instruction.InstructionSet;
-import com.aparapi.internal.reader.ByteReader;
-import com.aparapi.internal.util.Reflection;
 import com.aparapi.*;
+import com.aparapi.internal.annotation.*;
+import com.aparapi.internal.exception.*;
+import com.aparapi.internal.instruction.InstructionSet.*;
 import com.aparapi.internal.model.ValueCache.ThrowingValueComputer;
+import com.aparapi.internal.model.ClassModel.AttributePool.*;
+import com.aparapi.internal.model.ClassModel.ConstantPool.*;
+import com.aparapi.internal.reader.*;
+import com.aparapi.internal.util.*;
 
 import java.io.*;
 import java.lang.reflect.*;
@@ -2301,7 +2300,7 @@ public class ClassModel {
          for (int i = 0; i < attributeCount; i++) {
             final int attributeNameIndex = _byteReader.u2();
             final int length = _byteReader.u4();
-            ConstantPool.UTF8Entry utf8Entry = constantPool.getUTF8Entry(attributeNameIndex);
+            UTF8Entry utf8Entry = constantPool.getUTF8Entry(attributeNameIndex);
             if (utf8Entry == null) {
                throw new IllegalStateException("corrupted state reading attributes for " + name);
             }
@@ -2485,7 +2484,7 @@ public class ClassModel {
 
       private final int nameIndex;
 
-      private final AttributePool.CodeEntry codeEntry;
+      private final CodeEntry codeEntry;
 
       public ClassModelMethod(ByteReader _byteReader, int _index) {
          index = _index;
@@ -2738,7 +2737,7 @@ public class ClassModel {
     * 
     * @return The Method or null if we fail to locate a given method.
     */
-   public ClassModelMethod getMethod(ConstantPool.MethodEntry _methodEntry, boolean _isSpecial) {
+   public ClassModelMethod getMethod(MethodEntry _methodEntry, boolean _isSpecial) {
       final String entryClassNameInDotForm = _methodEntry.getClassEntry().getNameUTF8Entry().getUTF8().replace('/', '.');
 
       // Shortcut direct calls to supers to allow "foo() { super.foo() }" type stuff to work
@@ -2750,7 +2749,7 @@ public class ClassModel {
          return superClazz.getMethod(_methodEntry, false);
       }
 
-      ConstantPool.NameAndTypeEntry nameAndTypeEntry = _methodEntry.getNameAndTypeEntry();
+      NameAndTypeEntry nameAndTypeEntry = _methodEntry.getNameAndTypeEntry();
       ClassModelMethod methodOrNull = getMethodOrNull(nameAndTypeEntry.getNameUTF8Entry().getUTF8(), nameAndTypeEntry
             .getDescriptorUTF8Entry().getUTF8());
       if (methodOrNull == null)
@@ -2789,15 +2788,15 @@ public class ClassModel {
    }
 
    // These fields use for accessor conversion
-   private final ArrayList<ConstantPool.FieldEntry> structMembers = new ArrayList<ConstantPool.FieldEntry>();
+   private final ArrayList<FieldEntry> structMembers = new ArrayList<FieldEntry>();
 
    private final ArrayList<Long> structMemberOffsets = new ArrayList<Long>();
 
-   private final ArrayList<InstructionSet.TypeSpec> structMemberTypes = new ArrayList<InstructionSet.TypeSpec>();
+   private final ArrayList<TypeSpec> structMemberTypes = new ArrayList<TypeSpec>();
 
    private int totalStructSize = 0;
 
-   public ArrayList<ConstantPool.FieldEntry> getStructMembers() {
+   public ArrayList<FieldEntry> getStructMembers() {
       return structMembers;
    }
 
@@ -2805,7 +2804,7 @@ public class ClassModel {
       return structMemberOffsets;
    }
 
-   public ArrayList<InstructionSet.TypeSpec> getStructMemberTypes() {
+   public ArrayList<TypeSpec> getStructMemberTypes() {
       return structMemberTypes;
    }
 
diff --git a/src/main/java/com/aparapi/internal/model/Entrypoint.java b/src/main/java/com/aparapi/internal/model/Entrypoint.java
index 95bf7526..287b406d 100644
--- a/src/main/java/com/aparapi/internal/model/Entrypoint.java
+++ b/src/main/java/com/aparapi/internal/model/Entrypoint.java
@@ -52,14 +52,14 @@ under those regulations, please refer to the U.S. Bureau of Industry and Securit
 */
 package com.aparapi.internal.model;
 
-import com.aparapi.Config;
-import com.aparapi.Kernel;
-import com.aparapi.internal.exception.AparapiException;
-import com.aparapi.internal.exception.ClassParseException;
-import com.aparapi.internal.instruction.Instruction;
-import com.aparapi.internal.instruction.InstructionSet;
-import com.aparapi.internal.util.UnsafeWrapper;
 import com.aparapi.*;
+import com.aparapi.internal.exception.*;
+import com.aparapi.internal.instruction.*;
+import com.aparapi.internal.instruction.InstructionSet.*;
+import com.aparapi.internal.model.ClassModel.*;
+import com.aparapi.internal.model.ClassModel.ConstantPool.*;
+import com.aparapi.internal.model.ClassModel.ConstantPool.MethodReferenceEntry.*;
+import com.aparapi.internal.util.*;
 
 import java.lang.reflect.*;
 import java.util.*;
@@ -275,13 +275,13 @@ public class Entrypoint implements Cloneable {
       return memberClassModel;
    }
 
-   public ClassModel.ClassModelMethod resolveAccessorCandidate(InstructionSet.MethodCall _methodCall, ClassModel.ConstantPool.MethodEntry _methodEntry) throws AparapiException {
+   public ClassModelMethod resolveAccessorCandidate(MethodCall _methodCall, MethodEntry _methodEntry) throws AparapiException {
       final String methodsActualClassName = (_methodEntry.getClassEntry().getNameUTF8Entry().getUTF8()).replace('/', '.');
 
-      if (_methodCall instanceof InstructionSet.VirtualMethodCall) {
-         final Instruction callInstance = ((InstructionSet.VirtualMethodCall) _methodCall).getInstanceReference();
-         if (callInstance instanceof InstructionSet.AccessArrayElement) {
-            final InstructionSet.AccessArrayElement arrayAccess = (InstructionSet.AccessArrayElement) callInstance;
+      if (_methodCall instanceof VirtualMethodCall) {
+         final Instruction callInstance = ((VirtualMethodCall) _methodCall).getInstanceReference();
+         if (callInstance instanceof AccessArrayElement) {
+            final AccessArrayElement arrayAccess = (AccessArrayElement) callInstance;
             final Instruction refAccess = arrayAccess.getArrayRef();
             //if (refAccess instanceof I_GETFIELD) {
 
@@ -303,7 +303,7 @@ public class Entrypoint implements Cloneable {
     * Update accessor structures when there is a direct access to an 
     * obect array element's data members
     */
-   public void updateObjectMemberFieldAccesses(String className, ClassModel.ConstantPool.FieldEntry field) throws AparapiException {
+   public void updateObjectMemberFieldAccesses(String className, FieldEntry field) throws AparapiException {
       final String accessedFieldName = field.getNameAndTypeEntry().getNameUTF8Entry().getUTF8();
 
       // Quickly bail if it is a ref
@@ -343,8 +343,8 @@ public class Entrypoint implements Cloneable {
 
       // Look at super's fields for a match
       if (superCandidate != null) {
-         final ArrayList<ClassModel.ConstantPool.FieldEntry> structMemberSet = superCandidate.getStructMembers();
-         for (final ClassModel.ConstantPool.FieldEntry f : structMemberSet) {
+         final ArrayList<FieldEntry> structMemberSet = superCandidate.getStructMembers();
+         for (final FieldEntry f : structMemberSet) {
             if (f.getNameAndTypeEntry().getNameUTF8Entry().getUTF8().equals(accessedFieldName)
                   && f.getNameAndTypeEntry().getDescriptorUTF8Entry().getUTF8()
                         .equals(field.getNameAndTypeEntry().getDescriptorUTF8Entry().getUTF8())) {
@@ -375,8 +375,8 @@ public class Entrypoint implements Cloneable {
       // if not already there
       if (add) {
          boolean found = false;
-         final ArrayList<ClassModel.ConstantPool.FieldEntry> structMemberSet = memberClassModel.getStructMembers();
-         for (final ClassModel.ConstantPool.FieldEntry f : structMemberSet) {
+         final ArrayList<FieldEntry> structMemberSet = memberClassModel.getStructMembers();
+         for (final FieldEntry f : structMemberSet) {
             if (f.getNameAndTypeEntry().getNameUTF8Entry().getUTF8().equals(accessedFieldName)
                   && f.getNameAndTypeEntry().getDescriptorUTF8Entry().getUTF8()
                         .equals(field.getNameAndTypeEntry().getDescriptorUTF8Entry().getUTF8())) {
@@ -397,12 +397,12 @@ public class Entrypoint implements Cloneable {
    /*
     * Find a suitable call target in the kernel class, supers, object members or static calls
     */
-   ClassModel.ClassModelMethod resolveCalledMethod(InstructionSet.MethodCall methodCall, ClassModel classModel) throws AparapiException {
-      ClassModel.ConstantPool.MethodEntry methodEntry = methodCall.getConstantPoolMethodEntry();
+   ClassModelMethod resolveCalledMethod(MethodCall methodCall, ClassModel classModel) throws AparapiException {
+      MethodEntry methodEntry = methodCall.getConstantPoolMethodEntry();
       int thisClassIndex = classModel.getThisClassConstantPoolIndex();//arf
       boolean isMapped = (thisClassIndex != methodEntry.getClassIndex()) && Kernel.isMappedMethod(methodEntry);
       if (logger.isLoggable(Level.FINE)) {
-         if (methodCall instanceof InstructionSet.I_INVOKESPECIAL) {
+         if (methodCall instanceof I_INVOKESPECIAL) {
             logger.fine("Method call to super: " + methodEntry);
          } else if (thisClassIndex != methodEntry.getClassIndex()) {
             logger.fine("Method call to ??: " + methodEntry + ", isMappedMethod=" + isMapped);
@@ -411,7 +411,7 @@ public class Entrypoint implements Cloneable {
          }
       }
 
-      ClassModel.ClassModelMethod m = classModel.getMethod(methodEntry, (methodCall instanceof InstructionSet.I_INVOKESPECIAL) ? true : false);
+      ClassModelMethod m = classModel.getMethod(methodEntry, (methodCall instanceof I_INVOKESPECIAL) ? true : false);
 
       // Did not find method in this class or supers. Look for data member object arrays
       if (m == null && !isMapped) {
@@ -423,7 +423,7 @@ public class Entrypoint implements Cloneable {
          for (ClassModel c : allFieldsClasses.values()) {
             if (c.getClassWeAreModelling().getName()
                   .equals(methodEntry.getClassEntry().getNameUTF8Entry().getUTF8().replace('/', '.'))) {
-               m = c.getMethod(methodEntry, (methodCall instanceof InstructionSet.I_INVOKESPECIAL) ? true : false);
+               m = c.getMethod(methodEntry, (methodCall instanceof I_INVOKESPECIAL) ? true : false);
                assert m != null;
                break;
             }
@@ -431,7 +431,7 @@ public class Entrypoint implements Cloneable {
       }
 
       // Look for static call to some other class
-      if ((m == null) && !isMapped && (methodCall instanceof InstructionSet.I_INVOKESTATIC)) {
+      if ((m == null) && !isMapped && (methodCall instanceof I_INVOKESTATIC)) {
          String otherClassName = methodEntry.getClassEntry().getNameUTF8Entry().getUTF8().replace('/', '.');
          ClassModel otherClassModel = getOrUpdateAllClassAccesses(otherClassName);
 
@@ -454,7 +454,7 @@ public class Entrypoint implements Cloneable {
       methodModel = _methodModel;
       kernelInstance = _k;
 
-      final Map<ClassModel.ClassModelMethod, MethodModel> methodMap = new LinkedHashMap<ClassModel.ClassModelMethod, MethodModel>();
+      final Map<ClassModelMethod, MethodModel> methodMap = new LinkedHashMap<ClassModelMethod, MethodModel>();
 
       boolean discovered = true;
 
@@ -474,9 +474,9 @@ public class Entrypoint implements Cloneable {
       }
 
       // Collect all methods called directly from kernel's run method
-      for (final InstructionSet.MethodCall methodCall : methodModel.getMethodCalls()) {
+      for (final MethodCall methodCall : methodModel.getMethodCalls()) {
 
-         ClassModel.ClassModelMethod m = resolveCalledMethod(methodCall, classModel);
+         ClassModelMethod m = resolveCalledMethod(methodCall, classModel);
          if ((m != null) && !methodMap.keySet().contains(m) && !noCL(m)) {
             final MethodModel target = new MethodModel(m, this);
             methodMap.put(m, target);
@@ -490,9 +490,9 @@ public class Entrypoint implements Cloneable {
       while (discovered) {
          discovered = false;
          for (final MethodModel mm : new ArrayList<MethodModel>(methodMap.values())) {
-            for (final InstructionSet.MethodCall methodCall : mm.getMethodCalls()) {
+            for (final MethodCall methodCall : mm.getMethodCalls()) {
 
-               ClassModel.ClassModelMethod m = resolveCalledMethod(methodCall, classModel);
+               ClassModelMethod m = resolveCalledMethod(methodCall, classModel);
                if (m != null && !noCL(m)) {
                   MethodModel target = null;
                   if (methodMap.keySet().contains(m)) {
@@ -517,12 +517,11 @@ public class Entrypoint implements Cloneable {
          }
       }
 
-      Set<MethodModel> deepestLast = methodModel.deepestLast(new HashSet<MethodModel>(), new LinkedHashSet<MethodModel>());
-      ArrayList<MethodModel> deepestFirst = new ArrayList<MethodModel>(deepestLast);
-      Collections.reverse(deepestFirst);
-      calledMethods.addAll(deepestFirst);
+      methodModel.checkForRecursion(new HashSet<MethodModel>());
 
-      final List<MethodModel> methods=calledMethods;
+      calledMethods.addAll(methodMap.values());
+      Collections.reverse(calledMethods);
+      final List<MethodModel> methods = new ArrayList<MethodModel>(calledMethods);
 
       // add method to the calledMethods so we can include in this list
       methods.add(methodModel);
@@ -549,49 +548,49 @@ public class Entrypoint implements Cloneable {
 
          for (Instruction instruction = methodModel.getPCHead(); instruction != null; instruction = instruction.getNextPC()) {
 
-            if (instruction instanceof InstructionSet.AssignToArrayElement) {
-               final InstructionSet.AssignToArrayElement assignment = (InstructionSet.AssignToArrayElement) instruction;
+            if (instruction instanceof AssignToArrayElement) {
+               final AssignToArrayElement assignment = (AssignToArrayElement) instruction;
 
                final Instruction arrayRef = assignment.getArrayRef();
                // AccessField here allows instance and static array refs
-               if (arrayRef instanceof InstructionSet.I_GETFIELD) {
-                  final InstructionSet.I_GETFIELD getField = (InstructionSet.I_GETFIELD) arrayRef;
-                  final ClassModel.ConstantPool.FieldEntry field = getField.getConstantPoolFieldEntry();
+               if (arrayRef instanceof I_GETFIELD) {
+                  final I_GETFIELD getField = (I_GETFIELD) arrayRef;
+                  final FieldEntry field = getField.getConstantPoolFieldEntry();
                   final String assignedArrayFieldName = field.getNameAndTypeEntry().getNameUTF8Entry().getUTF8();
                   arrayFieldAssignments.add(assignedArrayFieldName);
                   referencedFieldNames.add(assignedArrayFieldName);
 
                }
-            } else if (instruction instanceof InstructionSet.AccessArrayElement) {
-               final InstructionSet.AccessArrayElement access = (InstructionSet.AccessArrayElement) instruction;
+            } else if (instruction instanceof AccessArrayElement) {
+               final AccessArrayElement access = (AccessArrayElement) instruction;
 
                final Instruction arrayRef = access.getArrayRef();
                // AccessField here allows instance and static array refs
-               if (arrayRef instanceof InstructionSet.I_GETFIELD) {
-                  final InstructionSet.I_GETFIELD getField = (InstructionSet.I_GETFIELD) arrayRef;
-                  final ClassModel.ConstantPool.FieldEntry field = getField.getConstantPoolFieldEntry();
+               if (arrayRef instanceof I_GETFIELD) {
+                  final I_GETFIELD getField = (I_GETFIELD) arrayRef;
+                  final FieldEntry field = getField.getConstantPoolFieldEntry();
                   final String accessedArrayFieldName = field.getNameAndTypeEntry().getNameUTF8Entry().getUTF8();
                   arrayFieldAccesses.add(accessedArrayFieldName);
                   referencedFieldNames.add(accessedArrayFieldName);
 
                }
-            } else if (instruction instanceof InstructionSet.I_ARRAYLENGTH) {
+            } else if (instruction instanceof I_ARRAYLENGTH) {
                Instruction child = instruction.getFirstChild();
-               while(child instanceof InstructionSet.I_AALOAD) {
+               while(child instanceof I_AALOAD) {
                   child = child.getFirstChild();
                }
-               if (!(child instanceof InstructionSet.AccessField)) {
+               if (!(child instanceof AccessField)) {
                   throw new ClassParseException(ClassParseException.TYPE.LOCALARRAYLENGTHACCESS);
                }
-               final InstructionSet.AccessField childField = (InstructionSet.AccessField) child;
+               final AccessField childField = (AccessField) child;
                final String arrayName = childField.getConstantPoolFieldEntry().getNameAndTypeEntry().getNameUTF8Entry().getUTF8();
                arrayFieldArrayLengthUsed.add(arrayName);
                if (logger.isLoggable(Level.FINE)) {
                   logger.fine("Noted arraylength in " + methodModel.getName() + " on " + arrayName);
                }
-            } else if (instruction instanceof InstructionSet.AccessField) {
-               final InstructionSet.AccessField access = (InstructionSet.AccessField) instruction;
-               final ClassModel.ConstantPool.FieldEntry field = access.getConstantPoolFieldEntry();
+            } else if (instruction instanceof AccessField) {
+               final AccessField access = (AccessField) instruction;
+               final FieldEntry field = access.getConstantPoolFieldEntry();
                final String accessedFieldName = field.getNameAndTypeEntry().getNameUTF8Entry().getUTF8();
                fieldAccesses.add(accessedFieldName);
                referencedFieldNames.add(accessedFieldName);
@@ -642,9 +641,9 @@ public class Entrypoint implements Cloneable {
                   }
                }
 
-            } else if (instruction instanceof InstructionSet.AssignToField) {
-               final InstructionSet.AssignToField assignment = (InstructionSet.AssignToField) instruction;
-               final ClassModel.ConstantPool.FieldEntry field = assignment.getConstantPoolFieldEntry();
+            } else if (instruction instanceof AssignToField) {
+               final AssignToField assignment = (AssignToField) instruction;
+               final FieldEntry field = assignment.getConstantPoolFieldEntry();
                final String assignedFieldName = field.getNameAndTypeEntry().getNameUTF8Entry().getUTF8();
                fieldAssignments.add(assignedFieldName);
                referencedFieldNames.add(assignedFieldName);
@@ -663,27 +662,27 @@ public class Entrypoint implements Cloneable {
                }
 
             }
-            else if (instruction instanceof InstructionSet.I_INVOKEVIRTUAL) {
-               final InstructionSet.I_INVOKEVIRTUAL invokeInstruction = (InstructionSet.I_INVOKEVIRTUAL) instruction;
+            else if (instruction instanceof I_INVOKEVIRTUAL) {
+               final I_INVOKEVIRTUAL invokeInstruction = (I_INVOKEVIRTUAL) instruction;
                MethodModel invokedMethod = invokeInstruction.getMethod();
-               ClassModel.ConstantPool.FieldEntry getterField = getSimpleGetterField(invokedMethod);
+               FieldEntry getterField = getSimpleGetterField(invokedMethod);
                if (getterField != null) {
                   referencedFieldNames.add(getterField.getNameAndTypeEntry().getNameUTF8Entry().getUTF8());
                }
                else {
-                  final ClassModel.ConstantPool.MethodEntry methodEntry = invokeInstruction.getConstantPoolMethodEntry();
+                  final MethodEntry methodEntry = invokeInstruction.getConstantPoolMethodEntry();
                   if (Kernel.isMappedMethod(methodEntry)) { //only do this for intrinsics
 
                      if (Kernel.usesAtomic32(methodEntry)) {
                         setRequiresAtomics32Pragma(true);
                      }
 
-                     final ClassModel.ConstantPool.MethodReferenceEntry.Arg methodArgs[] = methodEntry.getArgs();
+                     final Arg methodArgs[] = methodEntry.getArgs();
                      if ((methodArgs.length > 0) && methodArgs[0].isArray()) { //currently array arg can only take slot 0
                         final Instruction arrInstruction = invokeInstruction.getArg(0);
-                        if (arrInstruction instanceof InstructionSet.AccessField) {
-                           final InstructionSet.AccessField access = (InstructionSet.AccessField) arrInstruction;
-                           final ClassModel.ConstantPool.FieldEntry field = access.getConstantPoolFieldEntry();
+                        if (arrInstruction instanceof AccessField) {
+                           final AccessField access = (AccessField) arrInstruction;
+                           final FieldEntry field = access.getConstantPoolFieldEntry();
                            final String accessedFieldName = field.getNameAndTypeEntry().getNameUTF8Entry().getUTF8();
                            arrayFieldAssignments.add(accessedFieldName);
                            referencedFieldNames.add(accessedFieldName);
@@ -706,7 +705,7 @@ public class Entrypoint implements Cloneable {
             final Field field = getFieldFromClassHierarchy(clazz, referencedFieldName);
             if (field != null) {
                referencedFields.add(field);
-               final ClassModel.ClassModelField ff = classModel.getField(referencedFieldName);
+               final ClassModelField ff = classModel.getField(referencedFieldName);
                assert ff != null : "ff should not be null for " + clazz.getName() + "." + referencedFieldName;
                referencedClassModelFields.add(ff);
             }
@@ -735,8 +734,8 @@ public class Entrypoint implements Cloneable {
          }
 
          // Sort fields of each class biggest->smallest
-         final Comparator<ClassModel.ConstantPool.FieldEntry> fieldSizeComparator = new Comparator<ClassModel.ConstantPool.FieldEntry>(){
-            @Override public int compare(ClassModel.ConstantPool.FieldEntry aa, ClassModel.ConstantPool.FieldEntry bb) {
+         final Comparator<FieldEntry> fieldSizeComparator = new Comparator<FieldEntry>(){
+            @Override public int compare(FieldEntry aa, FieldEntry bb) {
                final String aType = aa.getNameAndTypeEntry().getDescriptorUTF8Entry().getUTF8();
                final String bType = bb.getNameAndTypeEntry().getDescriptorUTF8Entry().getUTF8();
 
@@ -760,7 +759,7 @@ public class Entrypoint implements Cloneable {
          };
 
          for (final ClassModel c : objectArrayFieldsClasses.values()) {
-            final ArrayList<ClassModel.ConstantPool.FieldEntry> fields = c.getStructMembers();
+            final ArrayList<FieldEntry> fields = c.getStructMembers();
             if (fields.size() > 0) {
                Collections.sort(fields, fieldSizeComparator);
 
@@ -768,7 +767,7 @@ public class Entrypoint implements Cloneable {
                int totalSize = 0;
                int alignTo = 0;
 
-               for (final ClassModel.ConstantPool.FieldEntry f : fields) {
+               for (final FieldEntry f : fields) {
                   // Record field offset for use while copying
                   // Get field we will copy out of the kernel member object
                   final Field rfield = getFieldFromClassHierarchy(c.getClassWeAreModelling(), f.getNameAndTypeEntry()
@@ -778,8 +777,8 @@ public class Entrypoint implements Cloneable {
 
                   final String fType = f.getNameAndTypeEntry().getDescriptorUTF8Entry().getUTF8();
                   //c.getStructMemberTypes().add(TypeSpec.valueOf(fType.equals("Z") ? "B" : fType));
-                  c.getStructMemberTypes().add(InstructionSet.TypeSpec.valueOf(fType));
-                  final int fSize = InstructionSet.TypeSpec.valueOf(fType.equals("Z") ? "B" : fType).getSize();
+                  c.getStructMemberTypes().add(TypeSpec.valueOf(fType));
+                  final int fSize = TypeSpec.valueOf(fType.equals("Z") ? "B" : fType).getSize();
                   if (fSize > alignTo) {
                      alignTo = fSize;
                   }
@@ -805,12 +804,12 @@ public class Entrypoint implements Cloneable {
       }
    }
 
-   private boolean noCL(ClassModel.ClassModelMethod m) {
+   private boolean noCL(ClassModelMethod m) {
       boolean found = m.getClassModel().getNoCLMethods().contains(m.getName());
       return found;
    }
 
-   private ClassModel.ConstantPool.FieldEntry getSimpleGetterField(MethodModel method) {
+   private FieldEntry getSimpleGetterField(MethodModel method) {
       return method.getAccessorVariableFieldEntry();
    }
 
@@ -853,10 +852,10 @@ public class Entrypoint implements Cloneable {
    /*
     * Return the best call target MethodModel by looking in the class hierarchy
     * @param _methodEntry MethodEntry for the desired target
-    * @return the fully qualified name such as "com_aparapi_javalabs_opencl_demo_PaternityTest$SimpleKernel__actuallyDoIt"
+    * @return the fully qualified name such as "com_amd_javalabs_opencl_demo_PaternityTest$SimpleKernel__actuallyDoIt"
     */
-   public MethodModel getCallTarget(ClassModel.ConstantPool.MethodEntry _methodEntry, boolean _isSpecial) {
-      ClassModel.ClassModelMethod target = getClassModel().getMethod(_methodEntry, _isSpecial);
+   public MethodModel getCallTarget(MethodEntry _methodEntry, boolean _isSpecial) {
+      ClassModelMethod target = getClassModel().getMethod(_methodEntry, _isSpecial);
       boolean isMapped = Kernel.isMappedMethod(_methodEntry);
 
       if (logger.isLoggable(Level.FINE) && (target == null)) {
diff --git a/src/main/java/com/aparapi/internal/model/MethodModel.java b/src/main/java/com/aparapi/internal/model/MethodModel.java
index f31726ce..d46e98a4 100644
--- a/src/main/java/com/aparapi/internal/model/MethodModel.java
+++ b/src/main/java/com/aparapi/internal/model/MethodModel.java
@@ -52,13 +52,15 @@ under those regulations, please refer to the U.S. Bureau of Industry and Securit
  */
 package com.aparapi.internal.model;
 
-import com.aparapi.Config;
-import com.aparapi.Kernel;
-import com.aparapi.internal.exception.AparapiException;
-import com.aparapi.internal.exception.ClassParseException;
-import com.aparapi.internal.instruction.*;
-import com.aparapi.internal.reader.ByteReader;
 import com.aparapi.*;
+import com.aparapi.internal.exception.*;
+import com.aparapi.internal.instruction.*;
+import com.aparapi.internal.instruction.InstructionPattern.*;
+import com.aparapi.internal.instruction.InstructionSet.*;
+import com.aparapi.internal.model.ClassModel.*;
+import com.aparapi.internal.model.ClassModel.ConstantPool.*;
+import com.aparapi.internal.model.ClassModel.ConstantPool.MethodReferenceEntry.*;
+import com.aparapi.internal.reader.*;
 
 import java.util.*;
 import java.util.Map.Entry;
@@ -70,7 +72,7 @@ public class MethodModel{
 
    private ExpressionList expressionList;
 
-   private ClassModel.ClassModelMethod method;
+   private ClassModelMethod method;
 
    /**
       True is an indication to use the fp64 pragma
@@ -91,7 +93,7 @@ public class MethodModel{
    // Only setters can use putfield
    private boolean usesPutfield;
 
-   private ClassModel.ConstantPool.FieldEntry accessorVariableFieldEntry;
+   private FieldEntry accessorVariableFieldEntry;
 
    private boolean noCL = false;
 
@@ -115,11 +117,11 @@ public class MethodModel{
       return methodIsPrivateMemoryGetter;
    }
 
-   public ClassModel.ClassModelMethod getMethod() {
+   public ClassModelMethod getMethod() {
       return method;
    }
 
-   public ClassModel.ConstantPool.FieldEntry getAccessorVariableFieldEntry() {
+   public FieldEntry getAccessorVariableFieldEntry() {
       return accessorVariableFieldEntry;
    }
 
@@ -129,7 +131,7 @@ public class MethodModel{
       return calledMethods;
    }
 
-   public LinkedHashSet<MethodModel> deepestLast(Set<MethodModel> transitiveCalledMethods, LinkedHashSet<MethodModel> result) throws AparapiException {
+   public void checkForRecursion(Set<MethodModel> transitiveCalledMethods) throws AparapiException {
 
       if (transitiveCalledMethods.contains(this)) {
          throw new ClassParseException(ClassParseException.TYPE.RECURSION, getName());
@@ -138,21 +140,15 @@ public class MethodModel{
       // Add myself
       transitiveCalledMethods.add(this);
 
-      if (result.contains(this)) {
-         result.remove(this);
-      }
-      result.add(this);
-
       // For each callee, send him a copy of the call chain up to this method
       final Iterator<MethodModel> cmi = getCalledMethods().iterator();
       while (cmi.hasNext()) {
          final MethodModel next = cmi.next();
-         next.deepestLast(transitiveCalledMethods, result);
+         next.checkForRecursion(transitiveCalledMethods);
       }
 
       // Done examining this call path, remove myself
       transitiveCalledMethods.remove(this);
-      return result;
    }
 
    /**
@@ -177,7 +173,7 @@ public class MethodModel{
          }
       }
 
-      if ((instruction instanceof InstructionSet.I_BASTORE) || (instruction instanceof InstructionSet.I_CASTORE /* || instruction instanceof I_SASTORE */)) {
+      if ((instruction instanceof I_BASTORE) || (instruction instanceof I_CASTORE /* || instruction instanceof I_SASTORE */)) {
          usesByteWrites = true;
          if (usesByteWrites && logger.isLoggable(Level.FINE)) {
             logger.fine("Found Byte Addressable Store on =" + instruction + " in " + getName());
@@ -216,56 +212,56 @@ public class MethodModel{
          final int pc = codeReader.getOffset();
          final Instruction instruction = InstructionSet.ByteCode.create(this, codeReader);
 
-         if ((!Config.enablePUTFIELD) && (instruction instanceof InstructionSet.I_PUTFIELD)) {
+         if ((!Config.enablePUTFIELD) && (instruction instanceof I_PUTFIELD)) {
             // Special case putfield handling to allow object setter processing
             // and bail later if necessary
             //throw new ClassParseException("We don't support putfield instructions");
             usesPutfield = true;
          }
 
-         if ((!Config.enableARETURN) && (instruction instanceof InstructionSet.I_ARETURN)) {
+         if ((!Config.enableARETURN) && (instruction instanceof I_ARETURN)) {
             throw new ClassParseException(instruction, ClassParseException.TYPE.ARRAY_RETURN);
          }
 
-         if ((!Config.enablePUTSTATIC) && (instruction instanceof InstructionSet.I_PUTSTATIC)) {
+         if ((!Config.enablePUTSTATIC) && (instruction instanceof I_PUTSTATIC)) {
             throw new ClassParseException(instruction, ClassParseException.TYPE.PUTFIELD);
          }
 
-         if ((!Config.enableINVOKEINTERFACE) && (instruction instanceof InstructionSet.I_INVOKEINTERFACE)) {
+         if ((!Config.enableINVOKEINTERFACE) && (instruction instanceof I_INVOKEINTERFACE)) {
             throw new ClassParseException(instruction, ClassParseException.TYPE.INVOKEINTERFACE);
          }
 
-         if ((!Config.enableGETSTATIC) && (instruction instanceof InstructionSet.I_GETSTATIC)) {
+         if ((!Config.enableGETSTATIC) && (instruction instanceof I_GETSTATIC)) {
             throw new ClassParseException(instruction, ClassParseException.TYPE.GETSTATIC);
          }
 
-         if ((!Config.enableATHROW) && (instruction instanceof InstructionSet.I_ATHROW)) {
+         if ((!Config.enableATHROW) && (instruction instanceof I_ATHROW)) {
             throw new ClassParseException(instruction, ClassParseException.TYPE.ATHROW);
          }
 
-         if ((!Config.enableMONITOR) && ((instruction instanceof InstructionSet.I_MONITORENTER) || (instruction instanceof InstructionSet.I_MONITOREXIT))) {
+         if ((!Config.enableMONITOR) && ((instruction instanceof I_MONITORENTER) || (instruction instanceof I_MONITOREXIT))) {
             throw new ClassParseException(instruction, ClassParseException.TYPE.SYNCHRONIZE);
          }
 
-         if ((!Config.enableNEW) && (instruction instanceof InstructionSet.New)) {
+         if ((!Config.enableNEW) && (instruction instanceof New)) {
             throw new ClassParseException(instruction, ClassParseException.TYPE.NEW);
          }
 
-         if (instruction instanceof InstructionSet.I_AASTORE) {
+         if (instruction instanceof I_AASTORE) {
             throw new ClassParseException(instruction, ClassParseException.TYPE.ARRAYALIAS);
          }
 
-         if ((!Config.enableSWITCH) && ((instruction instanceof InstructionSet.I_LOOKUPSWITCH) || (instruction instanceof InstructionSet.I_TABLESWITCH))) {
+         if ((!Config.enableSWITCH) && ((instruction instanceof I_LOOKUPSWITCH) || (instruction instanceof I_TABLESWITCH))) {
             throw new ClassParseException(instruction, ClassParseException.TYPE.SWITCH);
          }
 
          if (!Config.enableMETHODARRAYPASSING) {
-            if (instruction instanceof InstructionSet.MethodCall) {
-               final InstructionSet.MethodCall methodCall = (InstructionSet.MethodCall) instruction;
+            if (instruction instanceof MethodCall) {
+               final MethodCall methodCall = (MethodCall) instruction;
 
-               final ClassModel.ConstantPool.MethodReferenceEntry methodReferenceEntry = methodCall.getConstantPoolMethodEntry();
+               final MethodReferenceEntry methodReferenceEntry = methodCall.getConstantPoolMethodEntry();
                if (!Kernel.isMappedMethod(methodReferenceEntry)) { // we will allow trusted methods to violate this rule
-                  for (final ClassModel.ConstantPool.MethodReferenceEntry.Arg arg : methodReferenceEntry.getArgs()) {
+                  for (final Arg arg : methodReferenceEntry.getArgs()) {
                      if (arg.isArray()) {
                         throw new ClassParseException(instruction, ClassParseException.TYPE.METHODARRAYARG);
                      }
@@ -308,13 +304,13 @@ public class MethodModel{
     * <p>
     * Following this call the branch node at pc offset 100 will have a 'target' field which actually references the instruction at pc offset 200, and the instruction at pc offset 200 will 
     * have the branch node (at 100) added to it's forwardUnconditional list.
-    *
-    * @see com.aparapi.internal.instruction.InstructionSet.Branch#getTarget()
+    * 
+    * @see InstructionSet.Branch#getTarget()
     */
    public void buildBranchGraphs(Map<Integer, Instruction> pcMap) {
       for (Instruction instruction = pcHead; instruction != null; instruction = instruction.getNextPC()) {
          if (instruction.isBranch()) {
-            final InstructionSet.Branch branch = instruction.asBranch();
+            final Branch branch = instruction.asBranch();
             final Instruction targetInstruction = pcMap.get(branch.getAbsolute());
             branch.setTarget(targetInstruction);
          }
@@ -337,12 +333,12 @@ public class MethodModel{
 
       for (Instruction instruction = pcHead; instruction != null; instruction = instruction.getNextPC()) {
          if (instruction.isBranch()) {
-            final InstructionSet.Branch branch = instruction.asBranch();
+            final Branch branch = instruction.asBranch();
             if (branch.isReverse()) {
                final Instruction target = branch.getTarget();
-               final LinkedList<InstructionSet.Branch> list = target.getReverseUnconditionalBranches();
+               final LinkedList<Branch> list = target.getReverseUnconditionalBranches();
                if ((list != null) && (list.size() > 0) && (list.get(list.size() - 1) != branch)) {
-                  final InstructionSet.Branch unconditional = list.get(list.size() - 1).asBranch();
+                  final Branch unconditional = list.get(list.size() - 1).asBranch();
                   branch.retarget(unconditional);
 
                }
@@ -438,18 +434,18 @@ public class MethodModel{
     * 
     * @param _expressionList
     * @param _instruction
-    * @throws com.aparapi.internal.exception.ClassParseException
+    * @throws ClassParseException
     */
    public void txFormDups(ExpressionList _expressionList, final Instruction _instruction) throws ClassParseException {
-      if (_instruction instanceof InstructionSet.I_DUP) {
+      if (_instruction instanceof I_DUP) {
          Instruction e = _expressionList.getTail();
          while (!e.producesStack()) {
             e = e.getPrevExpr();
          }
 
-         _expressionList.add(new InstructionSet.CloneInstruction(this, e));
+         _expressionList.add(new CloneInstruction(this, e));
          System.out.println("clone of " + e);
-      } else if (_instruction instanceof InstructionSet.I_DUP2) {
+      } else if (_instruction instanceof I_DUP2) {
          Instruction e = _expressionList.getTail();
          while (!e.producesStack()) {
             e = e.getPrevPC();
@@ -461,16 +457,16 @@ public class MethodModel{
             e = e.getPrevExpr();
          }
 
-         _expressionList.add(new InstructionSet.CloneInstruction(this, e));
-         _expressionList.add(new InstructionSet.CloneInstruction(this, clone));
-      } else if (_instruction instanceof InstructionSet.I_DUP_X1) {
+         _expressionList.add(new CloneInstruction(this, e));
+         _expressionList.add(new CloneInstruction(this, clone));
+      } else if (_instruction instanceof I_DUP_X1) {
 
          Instruction e = _expressionList.getTail();
 
          while (!e.producesStack()) {
             e = e.getPrevExpr();
          }
-         final Instruction clone1 = new InstructionSet.CloneInstruction(this, e);
+         final Instruction clone1 = new CloneInstruction(this, e);
          e = e.getPrevExpr();
          while (!e.producesStack()) {
             e = e.getPrevExpr();
@@ -478,7 +474,7 @@ public class MethodModel{
 
          _expressionList.insertBetween(e.getPrevExpr(), e, clone1);
 
-      } else if (_instruction instanceof InstructionSet.I_DUP_X2) {
+      } else if (_instruction instanceof I_DUP_X2) {
 
          // dup_x2 duplicates top operand and jams a copy in 3 down from the top
          // ...word3, word2, word1 => ...word1, word3, word2, word1
@@ -498,7 +494,7 @@ public class MethodModel{
          }
 
          // Clone it, this will replace the dup action
-         final Instruction clone1 = new InstructionSet.CloneInstruction(this, e);
+         final Instruction clone1 = new CloneInstruction(this, e);
 
          if (logger.isLoggable(Level.FINE)) {
             logger.fine("DUP_X2 cloning: clone1=" + clone1);
@@ -526,7 +522,7 @@ public class MethodModel{
          // Add our clone in between those two writes
          _expressionList.insertBetween(e.getPrevExpr(), e, clone1);
 
-      } else if (_instruction instanceof InstructionSet.DUP) {
+      } else if (_instruction instanceof DUP) {
 
          throw new ClassParseException(_instruction, ClassParseException.TYPE.UNSUPPORTEDBYTECODE);
       }
@@ -537,7 +533,7 @@ public class MethodModel{
     *  Try to fold the instructions into higher level structures. 
     * At the end we have a folded instruction tree with 'roots' containing the 
     * top level branches (stores mostly)
-    * @throws com.aparapi.internal.exception.ClassParseException
+    * @throws ClassParseException
     */
 
    void foldExpressions() throws ClassParseException {
@@ -553,7 +549,7 @@ public class MethodModel{
          expressionList.foldComposite(instruction);
 
          // If we find a DUP then we need to txform the DUP into a set of clones on the xpressionlist
-         if (instruction instanceof InstructionSet.DUP) {
+         if (instruction instanceof DUP) {
             txFormDups(expressionList, instruction);
          } else {
             if (instruction.consumesStack()) {
@@ -627,28 +623,28 @@ public class MethodModel{
              */
 
             @Override public Instruction transform(final ExpressionList _expressionList, final Instruction i) {
-               InstructionPattern.InstructionMatch result = null;
+               InstructionMatch result = null;
 
                if (Config.enablePUTFIELD
                      && (result = InstructionPattern.accessInstanceField.matches(i, InstructionPattern.assignToInstanceField)).ok) {
 
                   final Instruction accessRaw = i;
                   final Instruction assignRaw = i.getNextExpr();
-                  final InstructionSet.AccessInstanceField access = (InstructionSet.AccessInstanceField) i.getReal();
-                  final InstructionSet.AssignToInstanceField assign = (InstructionSet.AssignToInstanceField) i.getNextExpr().getReal();
+                  final AccessInstanceField access = (AccessInstanceField) i.getReal();
+                  final AssignToInstanceField assign = (AssignToInstanceField) i.getNextExpr().getReal();
                   if (access.getConstantPoolFieldIndex() == assign.getConstantPoolFieldIndex()) {
                      Instruction child = ((Instruction) assign).getFirstChild().getNextExpr();
 
-                     if (child instanceof InstructionSet.CastOperator) {
+                     if (child instanceof CastOperator) {
                         child = child.getFirstChild();
                      }
-                     if (child instanceof InstructionSet.I_IADD) {
-                        final InstructionSet.I_IADD add = (InstructionSet.I_IADD) child;
+                     if (child instanceof I_IADD) {
+                        final I_IADD add = (I_IADD) child;
                         final Instruction lhs = add.getLhs();
                         final Instruction rhs = add.getRhs();
-                        if (lhs instanceof InstructionSet.AccessInstanceField) {
-                           if (rhs instanceof InstructionSet.I_ICONST_1) {
-                              final InstructionSet.IncrementInstruction inc = new InstructionSet.IncrementInstruction(MethodModel.this, (Instruction) access,
+                        if (lhs instanceof AccessInstanceField) {
+                           if (rhs instanceof I_ICONST_1) {
+                              final IncrementInstruction inc = new IncrementInstruction(MethodModel.this, (Instruction) access,
                                     true, false);
                               _expressionList.replaceInclusive(accessRaw, assignRaw, inc);
                               return (inc);
@@ -676,31 +672,31 @@ public class MethodModel{
              */
 
             @Override public Instruction transform(final ExpressionList _expressionList, final Instruction i) {
-               InstructionPattern.InstructionMatch result = null;
+               InstructionMatch result = null;
                if (Config.enablePUTFIELD
                      && (result = InstructionPattern.fieldPlusOne.matches(i, InstructionPattern.assignToInstanceField)).ok) {
 
                   final Instruction topAddRaw = i;
                   final Instruction assignRaw = i.getNextExpr();
-                  final InstructionSet.I_IADD topAdd = (InstructionSet.I_IADD) i.getReal();
-                  final InstructionSet.AssignToInstanceField assign = (InstructionSet.AssignToInstanceField) i.getNextExpr().getReal();
+                  final I_IADD topAdd = (I_IADD) i.getReal();
+                  final AssignToInstanceField assign = (AssignToInstanceField) i.getNextExpr().getReal();
                   final Instruction topLhs = topAdd.getLhs().getReal();
                   final Instruction topRhs = topAdd.getRhs().getReal();
-                  if (topLhs instanceof InstructionSet.AccessInstanceField) {
-                     final InstructionSet.AccessInstanceField topLhsAccess = (InstructionSet.AccessInstanceField) topLhs;
-                     if (topRhs instanceof InstructionSet.I_ICONST_1) {
+                  if (topLhs instanceof AccessInstanceField) {
+                     final AccessInstanceField topLhsAccess = (AccessInstanceField) topLhs;
+                     if (topRhs instanceof I_ICONST_1) {
                         if (topLhsAccess.getConstantPoolFieldIndex() == assign.getConstantPoolFieldIndex()) {
                            final Instruction child = ((Instruction) assign).getFirstChild().getNextExpr();
                            final Instruction valueToAssign = assign.getValueToAssign();
-                           if (valueToAssign instanceof InstructionSet.I_IADD) {
+                           if (valueToAssign instanceof I_IADD) {
 
-                              final InstructionSet.I_IADD add = (InstructionSet.I_IADD) child;
+                              final I_IADD add = (I_IADD) child;
                               final Instruction lhs = add.getLhs();
                               final Instruction rhs = add.getRhs();
-                              if (lhs instanceof InstructionSet.AccessInstanceField) {
-                                 if (rhs instanceof InstructionSet.I_ICONST_1) {
+                              if (lhs instanceof AccessInstanceField) {
+                                 if (rhs instanceof I_ICONST_1) {
 
-                                    final InstructionSet.IncrementInstruction inc = new InstructionSet.IncrementInstruction(MethodModel.this,
+                                    final IncrementInstruction inc = new IncrementInstruction(MethodModel.this,
                                           (Instruction) topLhsAccess, true, true);
                                     _expressionList.replaceInclusive(topAddRaw, assignRaw, inc);
 
@@ -739,13 +735,13 @@ public class MethodModel{
              */
             @Override public Instruction transform(ExpressionList _expressionList, Instruction i) {
                // looking for a post increment on a local variable
-               InstructionPattern.InstructionMatch result = null;
+               InstructionMatch result = null;
                if ((result = InstructionPattern.accessLocalVariable.matches(i, InstructionPattern.longHandIncLocalVariable)).ok) {
 
-                  final InstructionSet.AccessLocalVariable access = (InstructionSet.AccessLocalVariable) i;
-                  final InstructionSet.AssignToLocalVariable assign = (InstructionSet.AssignToLocalVariable) i.getNextExpr();
+                  final AccessLocalVariable access = (AccessLocalVariable) i;
+                  final AssignToLocalVariable assign = (AssignToLocalVariable) i.getNextExpr();
                   if (access.getLocalVariableTableIndex() == assign.getLocalVariableTableIndex()) {
-                     final InstructionSet.IncrementInstruction inc = new InstructionSet.IncrementInstruction(MethodModel.this, (Instruction) access, true, false);
+                     final IncrementInstruction inc = new IncrementInstruction(MethodModel.this, (Instruction) access, true, false);
                      _expressionList.replaceInclusive((Instruction) access, (Instruction) assign, inc);
                      return (inc);
                   }
@@ -776,13 +772,13 @@ public class MethodModel{
              */
             @Override public Instruction transform(ExpressionList _expressionList, Instruction i) {
 
-               InstructionPattern.InstructionMatch result = null;
+               InstructionMatch result = null;
                if ((result = InstructionPattern.accessLocalVariable.matches(i, InstructionPattern.longHandDecLocalVariable)).ok) {
 
-                  final InstructionSet.AccessLocalVariable access = (InstructionSet.AccessLocalVariable) i;
-                  final InstructionSet.AssignToLocalVariable assign = (InstructionSet.AssignToLocalVariable) i.getNextExpr();
+                  final AccessLocalVariable access = (AccessLocalVariable) i;
+                  final AssignToLocalVariable assign = (AssignToLocalVariable) i.getNextExpr();
                   if (access.getLocalVariableTableIndex() == assign.getLocalVariableTableIndex()) {
-                     final InstructionSet.IncrementInstruction inc = new InstructionSet.IncrementInstruction(MethodModel.this, (Instruction) access, false, false);
+                     final IncrementInstruction inc = new IncrementInstruction(MethodModel.this, (Instruction) access, false, false);
                      _expressionList.replaceInclusive((Instruction) access, (Instruction) assign, inc);
                      return (inc);
                   }
@@ -813,14 +809,14 @@ public class MethodModel{
              */
             @Override public Instruction transform(ExpressionList _expressionList, Instruction i) {
 
-               InstructionPattern.InstructionMatch result = null;
+               InstructionMatch result = null;
                // pre increment local variable
                if ((result = InstructionPattern.longHandIncLocalVariable.matches(i, InstructionPattern.accessLocalVariable)).ok) {
 
-                  final InstructionSet.AssignToLocalVariable assign = (InstructionSet.AssignToLocalVariable) i;
-                  final InstructionSet.AccessLocalVariable access = (InstructionSet.AccessLocalVariable) i.getNextExpr();
+                  final AssignToLocalVariable assign = (AssignToLocalVariable) i;
+                  final AccessLocalVariable access = (AccessLocalVariable) i.getNextExpr();
                   if (access.getLocalVariableTableIndex() == assign.getLocalVariableTableIndex()) {
-                     final InstructionSet.IncrementInstruction inc = new InstructionSet.IncrementInstruction(MethodModel.this, (Instruction) access, true, true);
+                     final IncrementInstruction inc = new IncrementInstruction(MethodModel.this, (Instruction) access, true, true);
                      _expressionList.replaceInclusive((Instruction) assign, (Instruction) access, inc);
                      return (inc);
                   }
@@ -845,15 +841,15 @@ public class MethodModel{
              */
             @Override public Instruction transform(ExpressionList _expressionList, Instruction i) {
 
-               InstructionPattern.InstructionMatch result = null;
+               InstructionMatch result = null;
 
                if ((result = InstructionPattern.accessLocalVariable.matches(i, InstructionPattern.assignToLocalVariable)).ok) {
 
-                  final InstructionSet.AccessLocalVariable access = (InstructionSet.AccessLocalVariable) i;
+                  final AccessLocalVariable access = (AccessLocalVariable) i;
                   if (access.getLocalVariableTableIndex() != 0) { // we don;t want to trap on 'this' references ;) 
-                     final InstructionSet.AssignToLocalVariable assign = (InstructionSet.AssignToLocalVariable) i.getNextExpr();
+                     final AssignToLocalVariable assign = (AssignToLocalVariable) i.getNextExpr();
                      if (access.getLocalVariableTableIndex() != assign.getLocalVariableTableIndex()) {
-                        final InstructionSet.InlineAssignInstruction inlineAssign = new InstructionSet.InlineAssignInstruction(MethodModel.this, assign,
+                        final InlineAssignInstruction inlineAssign = new InlineAssignInstruction(MethodModel.this, assign,
                               (Instruction) access);
                         _expressionList.replaceInclusive((Instruction) access, (Instruction) assign, inlineAssign);
                         return (inlineAssign);
@@ -869,14 +865,14 @@ public class MethodModel{
 
             @Override public Instruction transform(ExpressionList _expressionList, Instruction i) {
 
-               InstructionPattern.InstructionMatch result = null;
+               InstructionMatch result = null;
                if ((result = InstructionPattern.inc.matches(i, InstructionPattern.accessLocalVariable)).ok) {
 
-                  final InstructionSet.I_IINC iinc = (InstructionSet.I_IINC) i;
-                  final InstructionSet.AccessLocalVariable access = (InstructionSet.AccessLocalVariable) i.getNextExpr();
+                  final I_IINC iinc = (I_IINC) i;
+                  final AccessLocalVariable access = (AccessLocalVariable) i.getNextExpr();
                   if (iinc.getLocalVariableTableIndex() == access.getLocalVariableTableIndex()) {
 
-                     final InstructionSet.IncrementInstruction inc = new InstructionSet.IncrementInstruction(MethodModel.this, (Instruction) access,
+                     final IncrementInstruction inc = new IncrementInstruction(MethodModel.this, (Instruction) access,
                            iinc.isInc(), true);
                      _expressionList.replaceInclusive(iinc, (Instruction) access, inc);
                      return (inc);
@@ -890,16 +886,16 @@ public class MethodModel{
 
             @Override public Instruction transform(ExpressionList _expressionList, Instruction i) {
 
-               InstructionPattern.InstructionMatch result = null;
+               InstructionMatch result = null;
 
                if ((result = InstructionPattern.accessLocalVariable.matches(i, InstructionPattern.inc)).ok) {
 
-                  final InstructionSet.AccessLocalVariable access = (InstructionSet.AccessLocalVariable) i;
-                  final InstructionSet.I_IINC iinc = (InstructionSet.I_IINC) i.getNextExpr();
+                  final AccessLocalVariable access = (AccessLocalVariable) i;
+                  final I_IINC iinc = (I_IINC) i.getNextExpr();
 
                   if (iinc.getLocalVariableTableIndex() == access.getLocalVariableTableIndex()) {
 
-                     final InstructionSet.IncrementInstruction inc = new InstructionSet.IncrementInstruction(MethodModel.this, (Instruction) access,
+                     final IncrementInstruction inc = new IncrementInstruction(MethodModel.this, (Instruction) access,
                            iinc.isInc(), false);
                      _expressionList.replaceInclusive((Instruction) access, iinc, inc);
                      return (inc);
@@ -923,14 +919,14 @@ public class MethodModel{
              */
             @Override public Instruction transform(ExpressionList _expressionList, Instruction i) {
 
-               InstructionPattern.InstructionMatch result = null;
+               InstructionMatch result = null;
                if ((result = InstructionPattern.cast.matches(i, InstructionPattern.assignToLocalVariable)).ok) {
 
-                  final InstructionSet.CastOperator cast = (InstructionSet.CastOperator) i;
+                  final CastOperator cast = (CastOperator) i;
 
-                  final InstructionSet.AssignToLocalVariable assign = (InstructionSet.AssignToLocalVariable) i.getNextExpr();
+                  final AssignToLocalVariable assign = (AssignToLocalVariable) i.getNextExpr();
 
-                  final InstructionSet.InlineAssignInstruction inlineAssign = new InstructionSet.InlineAssignInstruction(MethodModel.this, assign, cast);
+                  final InlineAssignInstruction inlineAssign = new InlineAssignInstruction(MethodModel.this, assign, cast);
                   _expressionList.replaceInclusive((Instruction) cast, (Instruction) assign, inlineAssign);
                   return (inlineAssign);
 
@@ -959,15 +955,15 @@ public class MethodModel{
              */
             @Override public Instruction transform(ExpressionList _expressionList, Instruction i) {
 
-               InstructionPattern.InstructionMatch result = null;
+               InstructionMatch result = null;
                if ((result = InstructionPattern.fieldArrayElementPlusOne.matches(i,
                      InstructionPattern.longHandFieldArrayElementIncrement)).ok) {
 
                   final Instruction addRaw = i;
                   final Instruction assignArrayRaw = i.getNextExpr();
                   //   I_IADD add = (I_IADD) addRaw.getReal();
-                  final InstructionSet.AssignToArrayElement assignArray = (InstructionSet.AssignToArrayElement) assignArrayRaw.getReal();
-                  final InstructionSet.FieldArrayElementIncrement inlineAssign = new InstructionSet.FieldArrayElementIncrement(MethodModel.this, assignArray,
+                  final AssignToArrayElement assignArray = (AssignToArrayElement) assignArrayRaw.getReal();
+                  final FieldArrayElementIncrement inlineAssign = new FieldArrayElementIncrement(MethodModel.this, assignArray,
                         true, true);
                   _expressionList.replaceInclusive(addRaw, assignArrayRaw, inlineAssign);
                   return (inlineAssign);
@@ -998,15 +994,15 @@ public class MethodModel{
              */
             @Override public Instruction transform(ExpressionList _expressionList, Instruction i) {
 
-               InstructionPattern.InstructionMatch result = null;
+               InstructionMatch result = null;
                if ((result = InstructionPattern.fieldArrayElementMinusOne.matches(i,
                      InstructionPattern.longHandFieldArrayElementDecrement)).ok) {
 
                   final Instruction subRaw = i;
                   final Instruction assignArrayRaw = i.getNextExpr();
                   //   I_IADD add = (I_IADD) addRaw.getReal();
-                  final InstructionSet.AssignToArrayElement assignArray = (InstructionSet.AssignToArrayElement) assignArrayRaw.getReal();
-                  final InstructionSet.FieldArrayElementIncrement inlineAssign = new InstructionSet.FieldArrayElementIncrement(MethodModel.this, assignArray,
+                  final AssignToArrayElement assignArray = (AssignToArrayElement) assignArrayRaw.getReal();
+                  final FieldArrayElementIncrement inlineAssign = new FieldArrayElementIncrement(MethodModel.this, assignArray,
                         false, true);
                   _expressionList.replaceInclusive(subRaw, assignArrayRaw, inlineAssign);
                   return (inlineAssign);
@@ -1020,7 +1016,7 @@ public class MethodModel{
 
             @Override public Instruction transform(ExpressionList _expressionList, Instruction i) {
 
-               InstructionPattern.InstructionMatch result = null;
+               InstructionMatch result = null;
                if ((result = InstructionPattern.fieldArrayElementAccess.matches(i,
                      InstructionPattern.longHandFieldArrayElementIncrement)).ok) {
                   /**
@@ -1041,17 +1037,17 @@ public class MethodModel{
                    */
                   final Instruction accessArrayRaw = i;
                   final Instruction assignArrayRaw = i.getNextExpr();
-                  final InstructionSet.AccessArrayElement accessArray = (InstructionSet.AccessArrayElement) accessArrayRaw.getReal();
-                  final InstructionSet.AssignToArrayElement assignArray = (InstructionSet.AssignToArrayElement) assignArrayRaw.getReal();
-                  final InstructionSet.AccessField accessField1 = (InstructionSet.AccessField) accessArray.getArrayRef().getReal();
-                  final InstructionSet.AccessField accessField2 = (InstructionSet.AccessField) assignArray.getArrayRef().getReal();
+                  final AccessArrayElement accessArray = (AccessArrayElement) accessArrayRaw.getReal();
+                  final AssignToArrayElement assignArray = (AssignToArrayElement) assignArrayRaw.getReal();
+                  final AccessField accessField1 = (AccessField) accessArray.getArrayRef().getReal();
+                  final AccessField accessField2 = (AccessField) assignArray.getArrayRef().getReal();
                   if (accessField1.getConstantPoolFieldIndex() == accessField2.getConstantPoolFieldIndex()) {
                      // we accessing the same field at least
                      //AccessLocalVariable accessLocalVariable1 = (AccessLocalVariable) accessArray.getArrayIndex().getReal();
                      //AccessLocalVariable accessLocalVariable2 = (AccessLocalVariable) assignArray.getArrayIndex().getReal();
                      //  if (accessLocalVariable1.getLocalVariableTableIndex() == accessLocalVariable2.getLocalVariableTableIndex()) {
                      // and both arrays are referencing the array element using the same variable
-                     final InstructionSet.FieldArrayElementIncrement inlineAssign = new InstructionSet.FieldArrayElementIncrement(MethodModel.this, assignArray,
+                     final FieldArrayElementIncrement inlineAssign = new FieldArrayElementIncrement(MethodModel.this, assignArray,
                            true, false);
                      _expressionList.replaceInclusive(accessArrayRaw, assignArrayRaw, inlineAssign);
                      return (inlineAssign);
@@ -1083,23 +1079,23 @@ public class MethodModel{
              */
             @Override public Instruction transform(ExpressionList _expressionList, Instruction i) {
 
-               InstructionPattern.InstructionMatch result = null;
+               InstructionMatch result = null;
                if ((result = InstructionPattern.fieldArrayElementAccess.matches(i,
                      InstructionPattern.longHandFieldArrayElementDecrement)).ok) {
 
                   final Instruction accessArrayRaw = i;
                   final Instruction assignArrayRaw = i.getNextExpr();
-                  final InstructionSet.AccessArrayElement accessArray = (InstructionSet.AccessArrayElement) accessArrayRaw.getReal();
-                  final InstructionSet.AssignToArrayElement assignArray = (InstructionSet.AssignToArrayElement) assignArrayRaw.getReal();
-                  final InstructionSet.AccessField accessField1 = (InstructionSet.AccessField) accessArray.getArrayRef().getReal();
-                  final InstructionSet.AccessField accessField2 = (InstructionSet.AccessField) assignArray.getArrayRef().getReal();
+                  final AccessArrayElement accessArray = (AccessArrayElement) accessArrayRaw.getReal();
+                  final AssignToArrayElement assignArray = (AssignToArrayElement) assignArrayRaw.getReal();
+                  final AccessField accessField1 = (AccessField) accessArray.getArrayRef().getReal();
+                  final AccessField accessField2 = (AccessField) assignArray.getArrayRef().getReal();
                   if (accessField1.getConstantPoolFieldIndex() == accessField2.getConstantPoolFieldIndex()) {
                      // we accessing the same field at least
-                     final InstructionSet.AccessLocalVariable accessLocalVariable1 = (InstructionSet.AccessLocalVariable) accessArray.getArrayIndex().getReal();
-                     final InstructionSet.AccessLocalVariable accessLocalVariable2 = (InstructionSet.AccessLocalVariable) assignArray.getArrayIndex().getReal();
+                     final AccessLocalVariable accessLocalVariable1 = (AccessLocalVariable) accessArray.getArrayIndex().getReal();
+                     final AccessLocalVariable accessLocalVariable2 = (AccessLocalVariable) assignArray.getArrayIndex().getReal();
                      if (accessLocalVariable1.getLocalVariableTableIndex() == accessLocalVariable2.getLocalVariableTableIndex()) {
                         // and both arrays are referencing the array element using the same variable
-                        final InstructionSet.FieldArrayElementIncrement inlineAssign = new InstructionSet.FieldArrayElementIncrement(MethodModel.this,
+                        final FieldArrayElementIncrement inlineAssign = new FieldArrayElementIncrement(MethodModel.this,
                               assignArray, false, false);
                         _expressionList.replaceInclusive(accessArrayRaw, assignArrayRaw, inlineAssign);
                         return (inlineAssign);
@@ -1126,14 +1122,14 @@ public class MethodModel{
 
             @Override public Instruction transform(ExpressionList _expressionList, Instruction i) {
 
-               InstructionPattern.InstructionMatch result = null;
+               InstructionMatch result = null;
                if ((result = InstructionPattern.methodCall.matches(i, InstructionPattern.assignToLocalVariable)).ok) {
 
                   final Instruction invoke = i;
 
-                  final InstructionSet.AssignToLocalVariable assign = (InstructionSet.AssignToLocalVariable) i.getNextExpr();
+                  final AssignToLocalVariable assign = (AssignToLocalVariable) i.getNextExpr();
 
-                  final InstructionSet.InlineAssignInstruction inlineAssign = new InstructionSet.InlineAssignInstruction(MethodModel.this, assign, invoke);
+                  final InlineAssignInstruction inlineAssign = new InlineAssignInstruction(MethodModel.this, assign, invoke);
                   _expressionList.replaceInclusive(invoke, (Instruction) assign, inlineAssign);
                   return (inlineAssign);
 
@@ -1157,15 +1153,15 @@ public class MethodModel{
 
             @Override public Instruction transform(ExpressionList _expressionList, Instruction i) {
 
-               InstructionPattern.InstructionMatch result = null;
+               InstructionMatch result = null;
 
                if ((result = InstructionPattern.constant.matches(i, InstructionPattern.assignToLocalVariable)).ok) {
 
                   final Instruction constant = i;
 
-                  final InstructionSet.AssignToLocalVariable assign = (InstructionSet.AssignToLocalVariable) i.getNextExpr();
+                  final AssignToLocalVariable assign = (AssignToLocalVariable) i.getNextExpr();
 
-                  final InstructionSet.InlineAssignInstruction inlineAssign = new InstructionSet.InlineAssignInstruction(MethodModel.this, assign, constant);
+                  final InlineAssignInstruction inlineAssign = new InlineAssignInstruction(MethodModel.this, assign, constant);
                   _expressionList.replaceInclusive(constant, (Instruction) assign, inlineAssign);
                   return (inlineAssign);
 
@@ -1189,14 +1185,14 @@ public class MethodModel{
              */
             @Override public Instruction transform(ExpressionList _expressionList, Instruction i) {
 
-               InstructionPattern.InstructionMatch result = null;
+               InstructionMatch result = null;
                if ((result = InstructionPattern.methodCall.matches(i, InstructionPattern.assignToArrayElement)).ok) {
 
                   final Instruction invoke = i;
 
-                  final InstructionSet.AssignToArrayElement assign = (InstructionSet.AssignToArrayElement) i.getNextExpr();
+                  final AssignToArrayElement assign = (AssignToArrayElement) i.getNextExpr();
 
-                  final InstructionSet.FieldArrayElementAssign inlineAssign = new InstructionSet.FieldArrayElementAssign(MethodModel.this, assign, invoke);
+                  final FieldArrayElementAssign inlineAssign = new FieldArrayElementAssign(MethodModel.this, assign, invoke);
                   _expressionList.replaceInclusive(invoke, assign, inlineAssign);
                   return (inlineAssign);
 
@@ -1220,15 +1216,15 @@ public class MethodModel{
              */
             @Override public Instruction transform(ExpressionList _expressionList, Instruction i) {
 
-               InstructionPattern.InstructionMatch result = null;
+               InstructionMatch result = null;
                if ((result = InstructionPattern.assignToArrayElement.matches(i,
                      InstructionPattern.longHandFieldArrayElementIncrement)).ok) {
 
                   final Instruction invoke = i;
 
-                  final InstructionSet.AssignToArrayElement assign = (InstructionSet.AssignToArrayElement) i.getNextExpr();
+                  final AssignToArrayElement assign = (AssignToArrayElement) i.getNextExpr();
 
-                  final InstructionSet.FieldArrayElementAssign inlineAssign = new InstructionSet.FieldArrayElementAssign(MethodModel.this, assign, invoke);
+                  final FieldArrayElementAssign inlineAssign = new FieldArrayElementAssign(MethodModel.this, assign, invoke);
                   _expressionList.replaceInclusive(invoke, assign, inlineAssign);
 
                   return (inlineAssign);
@@ -1258,17 +1254,17 @@ public class MethodModel{
        * 
        * a=b=c=<exp>;
        */
-      if ((_instruction instanceof InstructionSet.AssignToLocalVariable) && _operandStart.producesStack()
-            && (_operandStart.getNextExpr() instanceof InstructionSet.AssignToLocalVariable)) {
+      if ((_instruction instanceof AssignToLocalVariable) && _operandStart.producesStack()
+            && (_operandStart.getNextExpr() instanceof AssignToLocalVariable)) {
          final Instruction assignFirst = _operandStart.getNextExpr();
          Instruction assign = assignFirst;
          int count = 0;
-         while ((assign != null) && (assign instanceof InstructionSet.AssignToLocalVariable)) {
+         while ((assign != null) && (assign instanceof AssignToLocalVariable)) {
             assign = assign.getNextExpr();
             count++;
          }
          if (assign == null) {
-            final Instruction newOne = new InstructionSet.MultiAssignInstruction(this, _operandStart, assignFirst, assign);
+            final Instruction newOne = new MultiAssignInstruction(this, _operandStart, assignFirst, assign);
             _expressionList.replaceInclusive(_operandStart, assign, newOne);
             txformed = true;
          }
@@ -1333,10 +1329,10 @@ public class MethodModel{
 
                Instruction instruction = expressionList.getHead();
 
-               if ((instruction instanceof InstructionSet.Return) && (expressionList.getHead() == expressionList.getTail())) {
+               if ((instruction instanceof Return) && (expressionList.getHead() == expressionList.getTail())) {
                   instruction = instruction.getPrevPC();
-                  if (instruction instanceof InstructionSet.AccessInstanceField) {
-                     final ClassModel.ConstantPool.FieldEntry field = ((InstructionSet.AccessInstanceField) instruction).getConstantPoolFieldEntry();
+                  if (instruction instanceof AccessInstanceField) {
+                     final FieldEntry field = ((AccessInstanceField) instruction).getConstantPoolFieldEntry();
                      accessedFieldName = field.getNameAndTypeEntry().getNameUTF8Entry().getUTF8();
                      if (accessedFieldName.equals(varNameCandidateCamelCased)) {
 
@@ -1370,7 +1366,7 @@ public class MethodModel{
                   throw new ClassParseException(ClassParseException.TYPE.BADGETTERNAMENOTFOUND, methodName);
                }
             } else {
-               ClassModel.ConstantPool.FieldEntry fieldEntry = getMethod().getOwnerClassModel().getConstantPool().getFieldEntry(varNameCandidateCamelCased);
+               FieldEntry fieldEntry = getMethod().getOwnerClassModel().getConstantPool().getFieldEntry(varNameCandidateCamelCased);
                setAccessorVariableFieldEntry(fieldEntry);
                if (getAccessorVariableFieldEntry() == null) {
                   throw new ClassParseException(ClassParseException.TYPE.BADGETTERNAMEMISMATCH, methodName);
@@ -1387,7 +1383,7 @@ public class MethodModel{
       }
    }
 
-   private void setAccessorVariableFieldEntry(ClassModel.ConstantPool.FieldEntry field) {
+   private void setAccessorVariableFieldEntry(FieldEntry field) {
       accessorVariableFieldEntry = field;
    }
 
@@ -1405,10 +1401,10 @@ public class MethodModel{
          final Instruction instruction = expressionList.getHead();
 
          // setters should be aload_0, ?load_1, putfield, return
-         if ((instruction instanceof InstructionSet.AssignToInstanceField) && (expressionList.getTail() instanceof InstructionSet.Return) && (pcMap.size() == 4)) {
+         if ((instruction instanceof AssignToInstanceField) && (expressionList.getTail() instanceof Return) && (pcMap.size() == 4)) {
             final Instruction prev = instruction.getPrevPC();
-            if (prev instanceof InstructionSet.AccessLocalVariable) {
-               final ClassModel.ConstantPool.FieldEntry field = ((InstructionSet.AssignToInstanceField) instruction).getConstantPoolFieldEntry();
+            if (prev instanceof AccessLocalVariable) {
+               final FieldEntry field = ((AssignToInstanceField) instruction).getConstantPoolFieldEntry();
                accessedFieldName = field.getNameAndTypeEntry().getNameUTF8Entry().getUTF8();
                if (accessedFieldName.equals(varNameCandidateCamelCased)) {
 
@@ -1449,18 +1445,18 @@ public class MethodModel{
    // The entrypoint is used to make checks on object accessors
    Entrypoint entrypoint = null;
 
-   MethodModel(ClassModel.ClassModelMethod _method, Entrypoint _entrypoint) throws AparapiException {
+   MethodModel(ClassModelMethod _method, Entrypoint _entrypoint) throws AparapiException {
       entrypoint = _entrypoint;
       init(_method);
    }
 
-   MethodModel(ClassModel.ClassModelMethod _method) throws AparapiException {
+   MethodModel(ClassModelMethod _method) throws AparapiException {
       init(_method);
    }
 
-   public static class FakeLocalVariableTableEntry implements ClassModel.LocalVariableTableEntry<ClassModel.LocalVariableInfo> {
+   public static class FakeLocalVariableTableEntry implements LocalVariableTableEntry<LocalVariableInfo>{
 
-      class Var implements ClassModel.LocalVariableInfo {
+      class Var implements LocalVariableInfo{
 
          int startPc = 0;
 
@@ -1474,11 +1470,11 @@ public class MethodModel{
 
          int slotIndex;
 
-         Var(InstructionSet.StoreSpec _storeSpec, int _slotIndex, int _startPc, boolean _arg) {
+         Var(StoreSpec _storeSpec, int _slotIndex, int _startPc, boolean _arg) {
             slotIndex = _slotIndex;
             arg = _arg;
             startPc = _startPc;
-            if (_storeSpec.equals(InstructionSet.StoreSpec.A)) {
+            if (_storeSpec.equals(StoreSpec.A)) {
                name = "arr_" + _slotIndex;
                descriptor = "/* arg */";
             } else {
@@ -1528,29 +1524,29 @@ public class MethodModel{
          }
       }
 
-      List<ClassModel.LocalVariableInfo> list = new ArrayList<ClassModel.LocalVariableInfo>();
+      List<LocalVariableInfo> list = new ArrayList<LocalVariableInfo>();
 
-      public FakeLocalVariableTableEntry(Map<Integer, Instruction> _pcMap, ClassModel.ClassModelMethod _method) {
+      public FakeLocalVariableTableEntry(Map<Integer, Instruction> _pcMap, ClassModelMethod _method) {
          int numberOfSlots = _method.getCodeEntry().getMaxLocals();
 
-         ClassModel.MethodDescription description = ClassModel.getMethodDescription(_method.getDescriptor());
+         MethodDescription description = ClassModel.getMethodDescription(_method.getDescriptor());
          String[] args = description.getArgs();
 
          int thisOffset = _method.isStatic() ? 0 : 1;
 
          Var[] vars = new Var[numberOfSlots + thisOffset];
-         InstructionSet.StoreSpec[] argsAsStoreSpecs = new InstructionSet.StoreSpec[args.length + thisOffset];
+         StoreSpec[] argsAsStoreSpecs = new StoreSpec[args.length + thisOffset];
          if (thisOffset == 1) {
-            argsAsStoreSpecs[0] = InstructionSet.StoreSpec.O;
+            argsAsStoreSpecs[0] = StoreSpec.O;
             vars[0] = new Var(argsAsStoreSpecs[0], 0, 0, true);
             list.add(vars[0]);
 
          }
          for (int i = 0; i < args.length; i++) {
             if (args[i].startsWith("[")) {
-               argsAsStoreSpecs[i + thisOffset] = InstructionSet.StoreSpec.A;
+               argsAsStoreSpecs[i + thisOffset] = StoreSpec.A;
             } else {
-               argsAsStoreSpecs[i + thisOffset] = InstructionSet.StoreSpec.valueOf(args[i].substring(0, 1));
+               argsAsStoreSpecs[i + thisOffset] = StoreSpec.valueOf(args[i].substring(0, 1));
             }
             vars[i + thisOffset] = new Var(argsAsStoreSpecs[i + thisOffset], i + thisOffset, 0, true);
             list.add(vars[i + thisOffset]);
@@ -1565,8 +1561,9 @@ public class MethodModel{
 
             pc = entry.getKey();
             instruction = entry.getValue();
-            InstructionSet.StoreSpec storeSpec = instruction.getByteCode().getStore();
-            if (storeSpec != InstructionSet.StoreSpec.NONE) {
+            StoreSpec storeSpec = instruction.getByteCode().getStore();
+
+            if (storeSpec != StoreSpec.NONE) {
                int slotIndex = ((InstructionSet.LocalVariableTableIndexAccessor) instruction).getLocalVariableTableIndex();
                Var prevVar = vars[slotIndex];
                Var var = new Var(storeSpec, slotIndex, pc + instruction.getLength(), false); // will get collected pretty soon if this is not the same as the previous in this slot
@@ -1581,8 +1578,8 @@ public class MethodModel{
             vars[i].endPc = pc + instruction.getLength();
          }
 
-         Collections.sort(list, new Comparator<ClassModel.LocalVariableInfo>(){
-            @Override public int compare(ClassModel.LocalVariableInfo o1, ClassModel.LocalVariableInfo o2) {
+         Collections.sort(list, new Comparator<LocalVariableInfo>(){
+            @Override public int compare(LocalVariableInfo o1, LocalVariableInfo o2) {
                return o1.getStart() - o2.getStart();
             }
          });
@@ -1590,7 +1587,7 @@ public class MethodModel{
          if (Config.enableShowFakeLocalVariableTable) {
             System.out.println("FakeLocalVariableTable:");
             System.out.println(" Start  Length  Slot    Name   Signature");
-            for (ClassModel.LocalVariableInfo lvi : list) {
+            for (LocalVariableInfo lvi : list) {
                Var var = (Var) lvi;
                System.out.println(String.format(" %5d   %5d  %4d  %8s     %s", var.startPc, var.getLength(), var.slotIndex,
                      var.name, var.descriptor));
@@ -1598,10 +1595,10 @@ public class MethodModel{
          }
       }
 
-      @Override public ClassModel.LocalVariableInfo getVariable(int _pc, int _index) {
-         ClassModel.LocalVariableInfo returnValue = null;
+      @Override public LocalVariableInfo getVariable(int _pc, int _index) {
+         LocalVariableInfo returnValue = null;
          //  System.out.println("pc = " + _pc + " index = " + _index);
-         for (ClassModel.LocalVariableInfo localVariableInfo : list) {
+         for (LocalVariableInfo localVariableInfo : list) {
             // System.out.println("   start=" + localVariableInfo.getStart() + " length=" + localVariableInfo.getLength()
             // + " varidx=" + localVariableInfo.getVariableIndex());
             if (_pc >= localVariableInfo.getStart() - 1 && _pc <= (localVariableInfo.getStart() + localVariableInfo.getLength())
@@ -1613,13 +1610,13 @@ public class MethodModel{
          return (returnValue);
       }
 
-      @Override public Iterator<ClassModel.LocalVariableInfo> iterator() {
+      @Override public Iterator<LocalVariableInfo> iterator() {
          return list.iterator();
       }
 
    }
 
-   private void init(ClassModel.ClassModelMethod _method) throws AparapiException {
+   private void init(ClassModelMethod _method) throws AparapiException {
       try {
          method = _method;
          expressionList = new ExpressionList(this);
@@ -1644,7 +1641,7 @@ public class MethodModel{
          // Pass #1 create a linked list of instructions from head to tail
          final Map<Integer, Instruction> pcMap = createListOfInstructions();
 
-         ClassModel.LocalVariableTableEntry<ClassModel.LocalVariableInfo> localVariableTableEntry = method.getLocalVariableTableEntry();
+         LocalVariableTableEntry<LocalVariableInfo> localVariableTableEntry = method.getLocalVariableTableEntry();
          if (localVariableTableEntry == null) {
             localVariableTableEntry = new FakeLocalVariableTableEntry(pcMap, method);
             method.setLocalVariableTableEntry(localVariableTableEntry);
@@ -1694,15 +1691,15 @@ public class MethodModel{
       }
    }
 
-   public ClassModel.LocalVariableTableEntry<ClassModel.LocalVariableInfo> getLocalVariableTableEntry() {
+   public LocalVariableTableEntry<LocalVariableInfo> getLocalVariableTableEntry() {
       return (method.getLocalVariableTableEntry());
    }
 
-   public ClassModel.ConstantPool getConstantPool() {
+   public ConstantPool getConstantPool() {
       return (method.getConstantPool());
    }
 
-   public ClassModel.LocalVariableInfo getLocalVariable(int _pc, int _index) {
+   public LocalVariableInfo getLocalVariable(int _pc, int _index) {
       return (method.getLocalVariable(_pc, _index));
    }
 
@@ -1711,7 +1708,7 @@ public class MethodModel{
    }
 
    /*
-    * @return the fully qualified name such as "com_aparapi_javalabs_opencl_demo_PaternityTest$SimpleKernel__actuallyDoIt"
+    * @return the fully qualified name such as "com_amd_javalabs_opencl_demo_PaternityTest$SimpleKernel__actuallyDoIt"
     */
    public String getName() {
       return (method.getClassModel().getMethod(method.getName(), method.getDescriptor()).getClassModel().getClassWeAreModelling()
@@ -1725,12 +1722,12 @@ public class MethodModel{
       return (returnType.substring(index + 1));
    }
 
-   public List<InstructionSet.MethodCall> getMethodCalls() {
-      final List<InstructionSet.MethodCall> methodCalls = new ArrayList<InstructionSet.MethodCall>();
+   public List<MethodCall> getMethodCalls() {
+      final List<MethodCall> methodCalls = new ArrayList<MethodCall>();
 
       for (Instruction i = getPCHead(); i != null; i = i.getNextPC()) {
-         if (i instanceof InstructionSet.MethodCall) {
-            final InstructionSet.MethodCall methodCall = (InstructionSet.MethodCall) i;
+         if (i instanceof MethodCall) {
+            final MethodCall methodCall = (MethodCall) i;
             methodCalls.add(methodCall);
          }
       }
diff --git a/src/main/java/com/aparapi/internal/opencl/OpenCLLoader.java b/src/main/java/com/aparapi/internal/opencl/OpenCLLoader.java
index 193fed42..abdce55f 100644
--- a/src/main/java/com/aparapi/internal/opencl/OpenCLLoader.java
+++ b/src/main/java/com/aparapi/internal/opencl/OpenCLLoader.java
@@ -18,13 +18,13 @@ package com.aparapi.internal.opencl;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-import com.aparapi.internal.jni.OpenCLJNI;
 import com.aparapi.Config;
+import com.aparapi.internal.jni.OpenCLJNI;
 
 /**
  * This class is intended to be a singleton which determines if OpenCL is available upon startup of Aparapi
  */
-public class OpenCLLoader extends OpenCLJNI {
+public class OpenCLLoader extends OpenCLJNI{
 
    private static final Logger logger = Logger.getLogger(Config.getLoggerName());
 
diff --git a/src/main/java/com/aparapi/internal/opencl/OpenCLPlatform.java b/src/main/java/com/aparapi/internal/opencl/OpenCLPlatform.java
index fe4bf99d..c7e715e9 100644
--- a/src/main/java/com/aparapi/internal/opencl/OpenCLPlatform.java
+++ b/src/main/java/com/aparapi/internal/opencl/OpenCLPlatform.java
@@ -15,12 +15,12 @@
  */
 package com.aparapi.internal.opencl;
 
-import com.aparapi.device.OpenCLDevice;
-import com.aparapi.internal.jni.OpenCLJNI;
+import com.aparapi.device.*;
+import com.aparapi.internal.jni.*;
 
 import java.util.*;
 
-public class OpenCLPlatform extends OpenCLJNI {
+public class OpenCLPlatform extends OpenCLJNI{
 
    private long platformId;
 
diff --git a/src/main/java/com/aparapi/internal/opencl/OpenCLProgram.java b/src/main/java/com/aparapi/internal/opencl/OpenCLProgram.java
index 85d6f413..dfd417f8 100644
--- a/src/main/java/com/aparapi/internal/opencl/OpenCLProgram.java
+++ b/src/main/java/com/aparapi/internal/opencl/OpenCLProgram.java
@@ -15,14 +15,15 @@
  */
 package com.aparapi.internal.opencl;
 
-import com.aparapi.device.OpenCLDevice;
-import com.aparapi.internal.jni.OpenCLJNI;
 import com.aparapi.ProfileInfo;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-public class OpenCLProgram extends OpenCLJNI {
+import com.aparapi.device.OpenCLDevice;
+import com.aparapi.internal.jni.OpenCLJNI;
+
+public class OpenCLProgram extends OpenCLJNI{
 
    private final long programId;
 
diff --git a/src/main/java/com/aparapi/internal/reader/ByteBuffer.java b/src/main/java/com/aparapi/internal/reader/ByteBuffer.java
index 6d5ee856..583e0519 100644
--- a/src/main/java/com/aparapi/internal/reader/ByteBuffer.java
+++ b/src/main/java/com/aparapi/internal/reader/ByteBuffer.java
@@ -63,7 +63,7 @@ import java.io.InputStream;
  * 
  * Does not keep track of accesses.  For this you will need a <code>ByteReader</code>
  * 
- * @see ByteReader
+ * @see com.aparapi.internal.reader.ByteReader
  * 
  * @author gfrost
  *
diff --git a/src/main/java/com/aparapi/internal/reader/ByteReader.java b/src/main/java/com/aparapi/internal/reader/ByteReader.java
index 1310640f..da507b81 100644
--- a/src/main/java/com/aparapi/internal/reader/ByteReader.java
+++ b/src/main/java/com/aparapi/internal/reader/ByteReader.java
@@ -60,7 +60,7 @@ import java.io.InputStream;
  * Basically wraps a <code>ByteBuffer</code> and keeps track of the current offset. All requests on 
  * this <code>ByteReader</code> will be delegated to wrapped<code>ByteBuffer</code>.
  * </p>
- * @see ByteBuffer
+ * @see com.aparapi.internal.reader.ByteBuffer
  * 
  * @author gfrost
  *
diff --git a/src/main/java/com/aparapi/internal/tool/InstructionViewer.java b/src/main/java/com/aparapi/internal/tool/InstructionViewer.java
index 3416af5b..711540ad 100644
--- a/src/main/java/com/aparapi/internal/tool/InstructionViewer.java
+++ b/src/main/java/com/aparapi/internal/tool/InstructionViewer.java
@@ -64,14 +64,14 @@ import javax.swing.UnsupportedLookAndFeelException;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 
+import com.aparapi.Config;
+import com.aparapi.internal.exception.AparapiException;
+import com.aparapi.internal.exception.ClassParseException;
 import com.aparapi.internal.instruction.Instruction;
-import com.aparapi.internal.instruction.InstructionSet;
+import com.aparapi.internal.instruction.InstructionSet.CompositeInstruction;
 import com.aparapi.internal.model.ClassModel;
 import com.aparapi.internal.model.Entrypoint;
 import com.aparapi.internal.model.MethodModel;
-import com.aparapi.Config;
-import com.aparapi.internal.exception.AparapiException;
-import com.aparapi.internal.exception.ClassParseException;
 import com.aparapi.internal.tool.InstructionViewer.Form.Check;
 import com.aparapi.internal.tool.InstructionViewer.Form.Template;
 import com.aparapi.internal.tool.InstructionViewer.Form.Toggle;
@@ -890,7 +890,7 @@ public class InstructionViewer implements Config.InstructionListener{
                lastInstruction = instruction;
             }
             lastInstruction.getRootExpr();
-            while (lastInstruction instanceof InstructionSet.CompositeInstruction) {
+            while (lastInstruction instanceof CompositeInstruction) {
                lastInstruction = lastInstruction.getLastChild();
             }
             for (Instruction instruction = lastInstruction.getNextPC(); instruction != null; instruction = instruction.getNextPC()) {
diff --git a/src/main/java/com/aparapi/internal/writer/BlockWriter.java b/src/main/java/com/aparapi/internal/writer/BlockWriter.java
index d40d7b85..b43fa98a 100644
--- a/src/main/java/com/aparapi/internal/writer/BlockWriter.java
+++ b/src/main/java/com/aparapi/internal/writer/BlockWriter.java
@@ -52,15 +52,17 @@ under those regulations, please refer to the U.S. Bureau of Industry and Securit
 */
 package com.aparapi.internal.writer;
 
-import com.aparapi.Config;
-import com.aparapi.internal.exception.CodeGenException;
-import com.aparapi.internal.instruction.BranchSet;
-import com.aparapi.internal.instruction.Instruction;
-import com.aparapi.internal.instruction.InstructionSet;
-import com.aparapi.internal.model.ClassModel;
-import com.aparapi.internal.model.Entrypoint;
-import com.aparapi.internal.model.MethodModel;
 import com.aparapi.*;
+import com.aparapi.internal.exception.*;
+import com.aparapi.internal.instruction.*;
+import com.aparapi.internal.instruction.BranchSet.LogicalExpressionNode;
+import com.aparapi.internal.instruction.InstructionSet.AccessInstanceField;
+import com.aparapi.internal.instruction.BranchSet.*;
+import com.aparapi.internal.instruction.InstructionSet.*;
+import com.aparapi.internal.model.ClassModel.ConstantPool.*;
+import com.aparapi.internal.model.ClassModel.*;
+import com.aparapi.internal.model.*;
+import com.aparapi.internal.model.ClassModel.ConstantPool.NameAndTypeEntry;
 
 import java.util.*;
 
@@ -102,16 +104,16 @@ public abstract class BlockWriter{
       }
    }
 
-   public void writeConditionalBranch16(InstructionSet.ConditionalBranch16 _branch16, boolean _invert) throws CodeGenException {
+   public void writeConditionalBranch16(ConditionalBranch16 _branch16, boolean _invert) throws CodeGenException {
 
-      if (_branch16 instanceof InstructionSet.If) {
-         final InstructionSet.If iff = (InstructionSet.If) _branch16;
+      if (_branch16 instanceof If) {
+         final If iff = (If) _branch16;
 
          writeInstruction(iff.getLhs());
          write(_branch16.getOperator().getText(_invert));
          writeInstruction(iff.getRhs());
-      } else if (_branch16 instanceof InstructionSet.I_IFNULL) {
-         final InstructionSet.I_IFNULL iff = (InstructionSet.I_IFNULL) _branch16;
+      } else if (_branch16 instanceof I_IFNULL) {
+         final I_IFNULL iff = (I_IFNULL) _branch16;
          writeInstruction(iff.getFirstChild());
 
          if (_invert) {
@@ -120,8 +122,8 @@ public abstract class BlockWriter{
             write(" == NULL");
          }
 
-      } else if (_branch16 instanceof InstructionSet.I_IFNONNULL) {
-         final InstructionSet.I_IFNONNULL iff = (InstructionSet.I_IFNONNULL) _branch16;
+      } else if (_branch16 instanceof I_IFNONNULL) {
+         final I_IFNONNULL iff = (I_IFNONNULL) _branch16;
          writeInstruction(iff.getFirstChild());
 
          if (_invert) {
@@ -129,10 +131,10 @@ public abstract class BlockWriter{
          } else {
             write(" != NULL");
          }
-      } else if (_branch16 instanceof InstructionSet.IfUnary) {
-         final InstructionSet.IfUnary branch16 = (InstructionSet.IfUnary) _branch16;
+      } else if (_branch16 instanceof IfUnary) {
+         final IfUnary branch16 = (IfUnary) _branch16;
          final Instruction comparison = branch16.getUnary();
-         final InstructionSet.ByteCode comparisonByteCode = comparison.getByteCode();
+         final ByteCode comparisonByteCode = comparison.getByteCode();
          final String comparisonOperator = _branch16.getOperator().getText(_invert);
 
          switch (comparisonByteCode) {
@@ -158,19 +160,19 @@ public abstract class BlockWriter{
       }
    }
 
-   public void writeComposite(InstructionSet.CompositeInstruction instruction) throws CodeGenException {
-      if (instruction instanceof InstructionSet.CompositeArbitraryScopeInstruction) {
+   public void writeComposite(CompositeInstruction instruction) throws CodeGenException {
+      if (instruction instanceof CompositeArbitraryScopeInstruction) {
          newLine();
 
          writeBlock(instruction.getFirstChild(), null);
-      } else if (instruction instanceof InstructionSet.CompositeIfInstruction) {
+      } else if (instruction instanceof CompositeIfInstruction) {
          newLine();
          write("if (");
          final Instruction blockStart = writeConditional(instruction.getBranchSet());
 
          write(")");
          writeBlock(blockStart, null);
-      } else if (instruction instanceof InstructionSet.CompositeIfElseInstruction) {
+      } else if (instruction instanceof CompositeIfElseInstruction) {
          newLine();
          write("if (");
          final Instruction blockStart = writeConditional(instruction.getBranchSet());
@@ -182,11 +184,11 @@ public abstract class BlockWriter{
          writeBlock(blockStart, elseGoto);
          write(" else ");
          writeBlock(elseGoto.getNextExpr(), null);
-      } else if (instruction instanceof InstructionSet.CompositeForSunInstruction) {
+      } else if (instruction instanceof CompositeForSunInstruction) {
          newLine();
          write("for (");
          Instruction topBranch = instruction.getFirstChild();
-         if (topBranch instanceof InstructionSet.AssignToLocalVariable) {
+         if (topBranch instanceof AssignToLocalVariable) {
             writeInstruction(topBranch);
             topBranch = topBranch.getNextExpr();
          }
@@ -202,7 +204,7 @@ public abstract class BlockWriter{
          } else {
             final Instruction delta = lastGoto.getPrevExpr();
             write("; ");
-            if (!(delta instanceof InstructionSet.CompositeInstruction)) {
+            if (!(delta instanceof CompositeInstruction)) {
                writeInstruction(delta);
                write(")");
                writeBlock(blockStart, delta);
@@ -220,7 +222,7 @@ public abstract class BlockWriter{
             }
          }
 
-      } else if (instruction instanceof InstructionSet.CompositeWhileInstruction) {
+      } else if (instruction instanceof CompositeWhileInstruction) {
          newLine();
          write("while (");
          final BranchSet branchSet = instruction.getBranchSet();
@@ -229,11 +231,11 @@ public abstract class BlockWriter{
          final Instruction lastGoto = instruction.getLastChild();
          writeBlock(blockStart, lastGoto);
 
-      } else if (instruction instanceof InstructionSet.CompositeEmptyLoopInstruction) {
+      } else if (instruction instanceof CompositeEmptyLoopInstruction) {
          newLine();
          write("for (");
          Instruction topBranch = instruction.getFirstChild();
-         if (topBranch instanceof InstructionSet.AssignToLocalVariable) {
+         if (topBranch instanceof AssignToLocalVariable) {
             writeInstruction(topBranch);
             topBranch = topBranch.getNextExpr();
          }
@@ -241,11 +243,11 @@ public abstract class BlockWriter{
          writeConditional(instruction.getBranchSet());
          write(";){}");
 
-      } else if (instruction instanceof InstructionSet.CompositeForEclipseInstruction) {
+      } else if (instruction instanceof CompositeForEclipseInstruction) {
          newLine();
          write("for (");
          Instruction topGoto = instruction.getFirstChild();
-         if (topGoto instanceof InstructionSet.AssignToLocalVariable) {
+         if (topGoto instanceof AssignToLocalVariable) {
             writeInstruction(topGoto);
             topGoto = topGoto.getNextExpr();
          }
@@ -257,7 +259,7 @@ public abstract class BlockWriter{
          writeConditional(instruction.getBranchSet(), true);
          write("; ");
          final Instruction delta = last.getPrevExpr();
-         if (!(delta instanceof InstructionSet.CompositeInstruction)) {
+         if (!(delta instanceof CompositeInstruction)) {
             writeInstruction(delta);
             write(")");
             writeBlock(topGoto.getNextExpr(), delta);
@@ -274,14 +276,14 @@ public abstract class BlockWriter{
 
          }
 
-      } else if (instruction instanceof InstructionSet.CompositeDoWhileInstruction) {
+      } else if (instruction instanceof CompositeDoWhileInstruction) {
          newLine();
          write("do");
          Instruction blockStart = instruction.getFirstChild();
          Instruction blockEnd = instruction.getLastChild();
          writeBlock(blockStart, blockEnd);
          write("while(");
-         writeConditional(((InstructionSet.CompositeInstruction) instruction).getBranchSet(), true);
+         writeConditional(((CompositeInstruction) instruction).getBranchSet(), true);
          write(");");
          newLine();
       }
@@ -290,9 +292,9 @@ public abstract class BlockWriter{
    public void writeSequence(Instruction _first, Instruction _last) throws CodeGenException {
 
       for (Instruction instruction = _first; instruction != _last; instruction = instruction.getNextExpr()) {
-         if (instruction instanceof InstructionSet.CompositeInstruction) {
-            writeComposite((InstructionSet.CompositeInstruction) instruction);
-         } else if (!instruction.getByteCode().equals(InstructionSet.ByteCode.NONE)) {
+         if (instruction instanceof CompositeInstruction) {
+            writeComposite((CompositeInstruction) instruction);
+         } else if (!instruction.getByteCode().equals(ByteCode.NONE)) {
             newLine();
             writeInstruction(instruction);
             write(";");
@@ -302,7 +304,7 @@ public abstract class BlockWriter{
 
    }
 
-   protected void writeGetterBlock(ClassModel.ConstantPool.FieldEntry accessorVariableFieldEntry) {
+   protected void writeGetterBlock(FieldEntry accessorVariableFieldEntry) {
       write("{");
       in();
       newLine();
@@ -331,20 +333,20 @@ public abstract class BlockWriter{
 
    public Instruction writeConditional(BranchSet _branchSet, boolean _invert) throws CodeGenException {
 
-      final BranchSet.LogicalExpressionNode logicalExpression = _branchSet.getLogicalExpression();
+      final LogicalExpressionNode logicalExpression = _branchSet.getLogicalExpression();
       write(_invert ? logicalExpression : logicalExpression.cloneInverted());
       return (_branchSet.getLast().getNextExpr());
    }
 
-   public void write(BranchSet.LogicalExpressionNode _node) throws CodeGenException {
-      if (_node instanceof BranchSet.SimpleLogicalExpressionNode) {
-         final BranchSet.SimpleLogicalExpressionNode sn = (BranchSet.SimpleLogicalExpressionNode) _node;
+   public void write(LogicalExpressionNode _node) throws CodeGenException {
+      if (_node instanceof SimpleLogicalExpressionNode) {
+         final SimpleLogicalExpressionNode sn = (SimpleLogicalExpressionNode) _node;
 
-         writeConditionalBranch16((InstructionSet.ConditionalBranch16) sn.getBranch(), sn.isInvert());
+         writeConditionalBranch16((ConditionalBranch16) sn.getBranch(), sn.isInvert());
       } else {
-         final BranchSet.CompoundLogicalExpressionNode ln = (BranchSet.CompoundLogicalExpressionNode) _node;
+         final CompoundLogicalExpressionNode ln = (CompoundLogicalExpressionNode) _node;
          boolean needParenthesis = false;
-         final BranchSet.CompoundLogicalExpressionNode parent = (BranchSet.CompoundLogicalExpressionNode) ln.getParent();
+         final CompoundLogicalExpressionNode parent = (CompoundLogicalExpressionNode) ln.getParent();
          if (parent != null) {
             if (!ln.isAnd() && parent.isAnd()) {
                needParenthesis = true;
@@ -376,13 +378,13 @@ public abstract class BlockWriter{
    }
 
    public void writeInstruction(Instruction _instruction) throws CodeGenException {
-      if (_instruction instanceof InstructionSet.CompositeIfElseInstruction) {
+      if (_instruction instanceof CompositeIfElseInstruction) {
          boolean needParenthesis = isNeedParenthesis(_instruction);
          if(needParenthesis){
              write("(");
          }
          write("(");
-         final Instruction lhs = writeConditional(((InstructionSet.CompositeInstruction) _instruction).getBranchSet());
+         final Instruction lhs = writeConditional(((CompositeInstruction) _instruction).getBranchSet());
          write(")?");
          writeInstruction(lhs);
          write(":");
@@ -390,13 +392,13 @@ public abstract class BlockWriter{
          if(needParenthesis){
              write(")");
          }
-      } else if (_instruction instanceof InstructionSet.CompositeInstruction) {
-         writeComposite((InstructionSet.CompositeInstruction) _instruction);
+      } else if (_instruction instanceof CompositeInstruction) {
+         writeComposite((CompositeInstruction) _instruction);
 
-      } else if (_instruction instanceof InstructionSet.AssignToLocalVariable) {
-         final InstructionSet.AssignToLocalVariable assignToLocalVariable = (InstructionSet.AssignToLocalVariable) _instruction;
+      } else if (_instruction instanceof AssignToLocalVariable) {
+         final AssignToLocalVariable assignToLocalVariable = (AssignToLocalVariable) _instruction;
 
-         final ClassModel.LocalVariableInfo localVariableInfo = assignToLocalVariable.getLocalVariableInfo();
+         final LocalVariableInfo localVariableInfo = assignToLocalVariable.getLocalVariableInfo();
          if (assignToLocalVariable.isDeclaration()) {
             final String descriptor = localVariableInfo.getVariableDescriptor();
             // Arrays always map to __global arrays
@@ -415,8 +417,8 @@ public abstract class BlockWriter{
             writeInstruction(operand);
          }
 
-      } else if (_instruction instanceof InstructionSet.AssignToArrayElement) {
-         final InstructionSet.AssignToArrayElement arrayAssignmentInstruction = (InstructionSet.AssignToArrayElement) _instruction;
+      } else if (_instruction instanceof AssignToArrayElement) {
+         final AssignToArrayElement arrayAssignmentInstruction = (AssignToArrayElement) _instruction;
          writeInstruction(arrayAssignmentInstruction.getArrayRef());
          write("[");
          writeInstruction(arrayAssignmentInstruction.getArrayIndex());
@@ -424,7 +426,7 @@ public abstract class BlockWriter{
          write(" ");
          write(" = ");
          writeInstruction(arrayAssignmentInstruction.getValue());
-      } else if (_instruction instanceof InstructionSet.AccessArrayElement) {
+      } else if (_instruction instanceof AccessArrayElement) {
 
          //we're getting an element from an array
          //if the array is a primitive then we just return the value
@@ -434,10 +436,10 @@ public abstract class BlockWriter{
          //a pointer to our index our position in the array.  The code will look like
          //&(arrayName[arrayIndex * this->arrayNameLen_dimension]
          //
-         final InstructionSet.AccessArrayElement arrayLoadInstruction = (InstructionSet.AccessArrayElement) _instruction;
+         final AccessArrayElement arrayLoadInstruction = (AccessArrayElement) _instruction;
 
          //object array, get address
-         boolean isMultiDimensional = arrayLoadInstruction instanceof InstructionSet.I_AALOAD && isMultiDimensionalArray(arrayLoadInstruction);
+         boolean isMultiDimensional = arrayLoadInstruction instanceof I_AALOAD && isMultiDimensionalArray(arrayLoadInstruction);
          if (isMultiDimensional) {
             write("(&");
          }
@@ -450,12 +452,12 @@ public abstract class BlockWriter{
          if (isMultiDimensional) {
             int dim = 0;
             Instruction load = arrayLoadInstruction.getArrayRef();
-            while (load instanceof InstructionSet.I_AALOAD) {
+            while (load instanceof I_AALOAD) {
                load = load.getFirstChild();
                dim++;
             }
 
-            ClassModel.ConstantPool.NameAndTypeEntry nameAndTypeEntry = ((InstructionSet.AccessInstanceField) load).getConstantPoolFieldEntry().getNameAndTypeEntry();
+            NameAndTypeEntry nameAndTypeEntry = ((AccessInstanceField) load).getConstantPoolFieldEntry().getNameAndTypeEntry();
             if (isMultiDimensionalArray(nameAndTypeEntry)) {
                String arrayName = nameAndTypeEntry.getNameUTF8Entry().getUTF8();
                write(" * this->" + arrayName + arrayDimMangleSuffix + dim);
@@ -468,14 +470,14 @@ public abstract class BlockWriter{
          if (isMultiDimensional) {
             write(")");
          }
-      } else if (_instruction instanceof InstructionSet.AccessField) {
-         final InstructionSet.AccessField accessField = (InstructionSet.AccessField) _instruction;
-         if (accessField instanceof InstructionSet.AccessInstanceField) {
-            Instruction accessInstanceField = ((InstructionSet.AccessInstanceField) accessField).getInstance();
-            if (accessInstanceField instanceof InstructionSet.CloneInstruction) {
-               accessInstanceField = ((InstructionSet.CloneInstruction) accessInstanceField).getReal();
+      } else if (_instruction instanceof AccessField) {
+         final AccessField accessField = (AccessField) _instruction;
+         if (accessField instanceof AccessInstanceField) {
+            Instruction accessInstanceField = ((AccessInstanceField) accessField).getInstance();
+            if (accessInstanceField instanceof CloneInstruction) {
+               accessInstanceField = ((CloneInstruction) accessInstanceField).getReal();
             }
-            if (!(accessInstanceField instanceof InstructionSet.I_ALOAD_0)) {
+            if (!(accessInstanceField instanceof I_ALOAD_0)) {
                writeInstruction(accessInstanceField);
                write(".");
             } else {
@@ -484,7 +486,7 @@ public abstract class BlockWriter{
          }
          write(accessField.getConstantPoolFieldEntry().getNameAndTypeEntry().getNameUTF8Entry().getUTF8());
 
-      } else if (_instruction instanceof InstructionSet.I_ARRAYLENGTH) {
+      } else if (_instruction instanceof I_ARRAYLENGTH) {
 
          //getting the length of an array.
          //if this is a primitive array, then this is trivial
@@ -492,21 +494,21 @@ public abstract class BlockWriter{
          //we're looking at
          int dim = 0;
          Instruction load = _instruction.getFirstChild();
-         while (load instanceof InstructionSet.I_AALOAD) {
+         while (load instanceof I_AALOAD) {
             load = load.getFirstChild();
             dim++;
          }
-         ClassModel.ConstantPool.NameAndTypeEntry nameAndTypeEntry = ((InstructionSet.AccessInstanceField) load).getConstantPoolFieldEntry().getNameAndTypeEntry();
+         NameAndTypeEntry nameAndTypeEntry = ((AccessInstanceField) load).getConstantPoolFieldEntry().getNameAndTypeEntry();
          final String arrayName = nameAndTypeEntry.getNameUTF8Entry().getUTF8();
          String dimSuffix = isMultiDimensionalArray(nameAndTypeEntry) ? Integer.toString(dim) : "";
          write("this->" + arrayName + arrayLengthMangleSuffix + dimSuffix);
-      } else if (_instruction instanceof InstructionSet.AssignToField) {
-         final InstructionSet.AssignToField assignedField = (InstructionSet.AssignToField) _instruction;
+      } else if (_instruction instanceof AssignToField) {
+         final AssignToField assignedField = (AssignToField) _instruction;
 
-         if (assignedField instanceof InstructionSet.AssignToInstanceField) {
-            final Instruction accessInstanceField = ((InstructionSet.AssignToInstanceField) assignedField).getInstance().getReal();
+         if (assignedField instanceof AssignToInstanceField) {
+            final Instruction accessInstanceField = ((AssignToInstanceField) assignedField).getInstance().getReal();
 
-            if (!(accessInstanceField instanceof InstructionSet.I_ALOAD_0)) {
+            if (!(accessInstanceField instanceof I_ALOAD_0)) {
                writeInstruction(accessInstanceField);
                write(".");
             } else {
@@ -516,8 +518,8 @@ public abstract class BlockWriter{
          write(assignedField.getConstantPoolFieldEntry().getNameAndTypeEntry().getNameUTF8Entry().getUTF8());
          write("=");
          writeInstruction(assignedField.getValueToAssign());
-      } else if (_instruction instanceof InstructionSet.Constant<?>) {
-         final InstructionSet.Constant<?> constantInstruction = (InstructionSet.Constant<?>) _instruction;
+      } else if (_instruction instanceof Constant<?>) {
+         final Constant<?> constantInstruction = (Constant<?>) _instruction;
          final Object value = constantInstruction.getValue();
 
          if (value instanceof Float) {
@@ -554,13 +556,13 @@ public abstract class BlockWriter{
             }
          }
 
-      } else if (_instruction instanceof InstructionSet.AccessLocalVariable) {
-         final InstructionSet.AccessLocalVariable localVariableLoadInstruction = (InstructionSet.AccessLocalVariable) _instruction;
-         final ClassModel.LocalVariableInfo localVariable = localVariableLoadInstruction.getLocalVariableInfo();
+      } else if (_instruction instanceof AccessLocalVariable) {
+         final AccessLocalVariable localVariableLoadInstruction = (AccessLocalVariable) _instruction;
+         final LocalVariableInfo localVariable = localVariableLoadInstruction.getLocalVariableInfo();
          write(localVariable.getVariableName());
-      } else if (_instruction instanceof InstructionSet.I_IINC) {
-         final InstructionSet.I_IINC location = (InstructionSet.I_IINC) _instruction;
-         final ClassModel.LocalVariableInfo localVariable = location.getLocalVariableInfo();
+      } else if (_instruction instanceof I_IINC) {
+         final I_IINC location = (I_IINC) _instruction;
+         final LocalVariableInfo localVariable = location.getLocalVariableInfo();
          final int adjust = location.getAdjust();
 
          write(localVariable.getVariableName());
@@ -573,8 +575,8 @@ public abstract class BlockWriter{
          } else if (adjust < -1) {
             write("-=" + (-adjust));
          }
-      } else if (_instruction instanceof InstructionSet.BinaryOperator) {
-         final InstructionSet.BinaryOperator binaryInstruction = (InstructionSet.BinaryOperator) _instruction;
+      } else if (_instruction instanceof BinaryOperator) {
+         final BinaryOperator binaryInstruction = (BinaryOperator) _instruction;
          final Instruction parent = binaryInstruction.getParentExpr();
          boolean needsParenthesis = isNeedParenthesis(binaryInstruction);
 
@@ -591,23 +593,23 @@ public abstract class BlockWriter{
             write(")");
          }
 
-      } else if (_instruction instanceof InstructionSet.CastOperator) {
-         final InstructionSet.CastOperator castInstruction = (InstructionSet.CastOperator) _instruction;
+      } else if (_instruction instanceof CastOperator) {
+         final CastOperator castInstruction = (CastOperator) _instruction;
          //  write("(");
          write(convertCast(castInstruction.getOperator().getText()));
 
          writeInstruction(castInstruction.getUnary());
          //    write(")");
-      } else if (_instruction instanceof InstructionSet.UnaryOperator) {
-         final InstructionSet.UnaryOperator unaryInstruction = (InstructionSet.UnaryOperator) _instruction;
+      } else if (_instruction instanceof UnaryOperator) {
+         final UnaryOperator unaryInstruction = (UnaryOperator) _instruction;
          //   write("(");
          write(unaryInstruction.getOperator().getText());
 
          writeInstruction(unaryInstruction.getUnary());
          //   write(")");
-      } else if (_instruction instanceof InstructionSet.Return) {
+      } else if (_instruction instanceof Return) {
 
-         final InstructionSet.Return ret = (InstructionSet.Return) _instruction;
+         final Return ret = (Return) _instruction;
          write("return");
          if (ret.getStackConsumeCount() > 0) {
             write("(");
@@ -615,17 +617,17 @@ public abstract class BlockWriter{
             write(")");
          }
 
-      } else if (_instruction instanceof InstructionSet.MethodCall) {
-         final InstructionSet.MethodCall methodCall = (InstructionSet.MethodCall) _instruction;
+      } else if (_instruction instanceof MethodCall) {
+         final MethodCall methodCall = (MethodCall) _instruction;
 
-         final ClassModel.ConstantPool.MethodEntry methodEntry = methodCall.getConstantPoolMethodEntry();
+         final MethodEntry methodEntry = methodCall.getConstantPoolMethodEntry();
 
          writeMethod(methodCall, methodEntry);
-      } else if (_instruction.getByteCode().equals(InstructionSet.ByteCode.CLONE)) {
-         final InstructionSet.CloneInstruction cloneInstruction = (InstructionSet.CloneInstruction) _instruction;
+      } else if (_instruction.getByteCode().equals(ByteCode.CLONE)) {
+         final CloneInstruction cloneInstruction = (CloneInstruction) _instruction;
          writeInstruction(cloneInstruction.getReal());
-      } else if (_instruction.getByteCode().equals(InstructionSet.ByteCode.INCREMENT)) {
-         final InstructionSet.IncrementInstruction incrementInstruction = (InstructionSet.IncrementInstruction) _instruction;
+      } else if (_instruction.getByteCode().equals(ByteCode.INCREMENT)) {
+         final IncrementInstruction incrementInstruction = (IncrementInstruction) _instruction;
 
          if (incrementInstruction.isPre()) {
             if (incrementInstruction.isInc()) {
@@ -643,21 +645,21 @@ public abstract class BlockWriter{
                write("--");
             }
          }
-      } else if (_instruction.getByteCode().equals(InstructionSet.ByteCode.MULTI_ASSIGN)) {
-         final InstructionSet.MultiAssignInstruction multiAssignInstruction = (InstructionSet.MultiAssignInstruction) _instruction;
-         InstructionSet.AssignToLocalVariable from = (InstructionSet.AssignToLocalVariable) multiAssignInstruction.getFrom();
-         final InstructionSet.AssignToLocalVariable last = (InstructionSet.AssignToLocalVariable) multiAssignInstruction.getTo();
+      } else if (_instruction.getByteCode().equals(ByteCode.MULTI_ASSIGN)) {
+         final MultiAssignInstruction multiAssignInstruction = (MultiAssignInstruction) _instruction;
+         AssignToLocalVariable from = (AssignToLocalVariable) multiAssignInstruction.getFrom();
+         final AssignToLocalVariable last = (AssignToLocalVariable) multiAssignInstruction.getTo();
          final Instruction common = multiAssignInstruction.getCommon();
-         final Stack<InstructionSet.AssignToLocalVariable> stack = new Stack<InstructionSet.AssignToLocalVariable>();
+         final Stack<AssignToLocalVariable> stack = new Stack<AssignToLocalVariable>();
 
          while (from != last) {
             stack.push(from);
-            from = (InstructionSet.AssignToLocalVariable) ((Instruction) from).getNextExpr();
+            from = (AssignToLocalVariable) ((Instruction) from).getNextExpr();
          }
 
-         for (InstructionSet.AssignToLocalVariable alv = stack.pop(); alv != null; alv = stack.size() > 0 ? stack.pop() : null) {
+         for (AssignToLocalVariable alv = stack.pop(); alv != null; alv = stack.size() > 0 ? stack.pop() : null) {
 
-            final ClassModel.LocalVariableInfo localVariableInfo = alv.getLocalVariableInfo();
+            final LocalVariableInfo localVariableInfo = alv.getLocalVariableInfo();
             if (alv.isDeclaration()) {
                write(convertType(localVariableInfo.getVariableDescriptor(), true));
             }
@@ -669,11 +671,11 @@ public abstract class BlockWriter{
 
          }
          writeInstruction(common);
-      } else if (_instruction.getByteCode().equals(InstructionSet.ByteCode.INLINE_ASSIGN)) {
-         final InstructionSet.InlineAssignInstruction inlineAssignInstruction = (InstructionSet.InlineAssignInstruction) _instruction;
-         final InstructionSet.AssignToLocalVariable assignToLocalVariable = inlineAssignInstruction.getAssignToLocalVariable();
+      } else if (_instruction.getByteCode().equals(ByteCode.INLINE_ASSIGN)) {
+         final InlineAssignInstruction inlineAssignInstruction = (InlineAssignInstruction) _instruction;
+         final AssignToLocalVariable assignToLocalVariable = inlineAssignInstruction.getAssignToLocalVariable();
 
-         final ClassModel.LocalVariableInfo localVariableInfo = assignToLocalVariable.getLocalVariableInfo();
+         final LocalVariableInfo localVariableInfo = assignToLocalVariable.getLocalVariableInfo();
          if (assignToLocalVariable.isDeclaration()) {
             // this is bad! we need a general way to hoist up a required declaration
             throw new CodeGenException("/* we can't declare this " + convertType(localVariableInfo.getVariableDescriptor(), true)
@@ -682,9 +684,9 @@ public abstract class BlockWriter{
          write(localVariableInfo.getVariableName());
          write("=");
          writeInstruction(inlineAssignInstruction.getRhs());
-      } else if (_instruction.getByteCode().equals(InstructionSet.ByteCode.FIELD_ARRAY_ELEMENT_ASSIGN)) {
-         final InstructionSet.FieldArrayElementAssign inlineAssignInstruction = (InstructionSet.FieldArrayElementAssign) _instruction;
-         final InstructionSet.AssignToArrayElement arrayAssignmentInstruction = inlineAssignInstruction.getAssignToArrayElement();
+      } else if (_instruction.getByteCode().equals(ByteCode.FIELD_ARRAY_ELEMENT_ASSIGN)) {
+         final FieldArrayElementAssign inlineAssignInstruction = (FieldArrayElementAssign) _instruction;
+         final AssignToArrayElement arrayAssignmentInstruction = inlineAssignInstruction.getAssignToArrayElement();
 
          writeInstruction(arrayAssignmentInstruction.getArrayRef());
          write("[");
@@ -694,10 +696,10 @@ public abstract class BlockWriter{
          write(" = ");
 
          writeInstruction(inlineAssignInstruction.getRhs());
-      } else if (_instruction.getByteCode().equals(InstructionSet.ByteCode.FIELD_ARRAY_ELEMENT_INCREMENT)) {
+      } else if (_instruction.getByteCode().equals(ByteCode.FIELD_ARRAY_ELEMENT_INCREMENT)) {
 
-         final InstructionSet.FieldArrayElementIncrement fieldArrayElementIncrement = (InstructionSet.FieldArrayElementIncrement) _instruction;
-         final InstructionSet.AssignToArrayElement arrayAssignmentInstruction = fieldArrayElementIncrement.getAssignToArrayElement();
+         final FieldArrayElementIncrement fieldArrayElementIncrement = (FieldArrayElementIncrement) _instruction;
+         final AssignToArrayElement arrayAssignmentInstruction = fieldArrayElementIncrement.getAssignToArrayElement();
          if (fieldArrayElementIncrement.isPre()) {
             if (fieldArrayElementIncrement.isInc()) {
                write("++");
@@ -718,12 +720,12 @@ public abstract class BlockWriter{
             }
          }
 
-      } else if (_instruction.getByteCode().equals(InstructionSet.ByteCode.NONE)) {
+      } else if (_instruction.getByteCode().equals(ByteCode.NONE)) {
          // we are done
-      } else if (_instruction instanceof InstructionSet.Branch) {
+      } else if (_instruction instanceof Branch) {
          throw new CodeGenException(String.format("%s -> %04d", _instruction.getByteCode().toString().toLowerCase(),
-               ((InstructionSet.Branch) _instruction).getTarget().getThisPC()));
-      } else if (_instruction instanceof InstructionSet.I_POP) {
+               ((Branch) _instruction).getTarget().getThisPC()));
+      } else if (_instruction instanceof I_POP) {
          //POP discarded void call return?
          writeInstruction(_instruction.getFirstChild());
       } else {
@@ -736,11 +738,11 @@ public abstract class BlockWriter{
         final Instruction parent = instruction.getParentExpr();
         boolean needsParenthesis = true;
 
-        if (parent instanceof InstructionSet.AssignToLocalVariable) {
+        if (parent instanceof AssignToLocalVariable) {
            needsParenthesis = false;
-        } else if (parent instanceof InstructionSet.AssignToField) {
+        } else if (parent instanceof AssignToField) {
            needsParenthesis = false;
-        } else if (parent instanceof InstructionSet.AssignToArrayElement) {
+        } else if (parent instanceof AssignToArrayElement) {
            needsParenthesis = false;
         } else {
            /**
@@ -755,43 +757,43 @@ public abstract class BlockWriter{
         return needsParenthesis;
    }
 
-   private boolean isMultiDimensionalArray(ClassModel.ConstantPool.NameAndTypeEntry nameAndTypeEntry) {
+   private boolean isMultiDimensionalArray(NameAndTypeEntry nameAndTypeEntry) {
       return nameAndTypeEntry.getDescriptorUTF8Entry().getUTF8().startsWith("[[");
    }
 
-   private boolean isObjectArray(ClassModel.ConstantPool.NameAndTypeEntry nameAndTypeEntry) {
+   private boolean isObjectArray(NameAndTypeEntry nameAndTypeEntry) {
       return nameAndTypeEntry.getDescriptorUTF8Entry().getUTF8().startsWith("[L");
    }
 
-   private boolean isMultiDimensionalArray(final InstructionSet.AccessArrayElement arrayLoadInstruction) {
-      InstructionSet.AccessInstanceField accessInstanceField = getUltimateInstanceFieldAccess(arrayLoadInstruction);
+   private boolean isMultiDimensionalArray(final AccessArrayElement arrayLoadInstruction) {
+      AccessInstanceField accessInstanceField = getUltimateInstanceFieldAccess(arrayLoadInstruction);
       return isMultiDimensionalArray(accessInstanceField.getConstantPoolFieldEntry().getNameAndTypeEntry());
    }
 
-   private boolean isObjectArray(final InstructionSet.AccessArrayElement arrayLoadInstruction) {
-      InstructionSet.AccessInstanceField accessInstanceField = getUltimateInstanceFieldAccess(arrayLoadInstruction);
+   private boolean isObjectArray(final AccessArrayElement arrayLoadInstruction) {
+      AccessInstanceField accessInstanceField = getUltimateInstanceFieldAccess(arrayLoadInstruction);
       return isObjectArray(accessInstanceField.getConstantPoolFieldEntry().getNameAndTypeEntry());
    }
 
-   private InstructionSet.AccessInstanceField getUltimateInstanceFieldAccess(final InstructionSet.AccessArrayElement arrayLoadInstruction) {
+   private AccessInstanceField getUltimateInstanceFieldAccess(final AccessArrayElement arrayLoadInstruction) {
       Instruction load = arrayLoadInstruction.getArrayRef();
-      while (load instanceof InstructionSet.I_AALOAD) {
+      while (load instanceof I_AALOAD) {
          load = load.getFirstChild();
       }
 
-      return (InstructionSet.AccessInstanceField) load;
+      return (AccessInstanceField) load;
    }
 
-   public void writeMethod(InstructionSet.MethodCall _methodCall, ClassModel.ConstantPool.MethodEntry _methodEntry) throws CodeGenException {
+   public void writeMethod(MethodCall _methodCall, MethodEntry _methodEntry) throws CodeGenException {
       boolean noCL = _methodEntry.getOwnerClassModel().getNoCLMethods()
             .contains(_methodEntry.getNameAndTypeEntry().getNameUTF8Entry().getUTF8());
       if (noCL) {
          return;
       }
 
-      if (_methodCall instanceof InstructionSet.VirtualMethodCall) {
-         final Instruction instanceInstruction = ((InstructionSet.VirtualMethodCall) _methodCall).getInstanceReference();
-         if (!(instanceInstruction instanceof InstructionSet.I_ALOAD_0)) {
+      if (_methodCall instanceof VirtualMethodCall) {
+         final Instruction instanceInstruction = ((VirtualMethodCall) _methodCall).getInstanceReference();
+         if (!(instanceInstruction instanceof I_ALOAD_0)) {
             writeInstruction(instanceInstruction);
             write(".");
          } else {
@@ -818,7 +820,7 @@ public abstract class BlockWriter{
 
    public void writeMethodBody(MethodModel _methodModel) throws CodeGenException {
       if (_methodModel.isGetter() && !_methodModel.isNoCL()) {
-         ClassModel.ConstantPool.FieldEntry accessorVariableFieldEntry = _methodModel.getAccessorVariableFieldEntry();
+         FieldEntry accessorVariableFieldEntry = _methodModel.getAccessorVariableFieldEntry();
          writeGetterBlock(accessorVariableFieldEntry);
       } else {
          writeBlock(_methodModel.getExprHead(), null);
diff --git a/src/main/java/com/aparapi/internal/writer/KernelWriter.java b/src/main/java/com/aparapi/internal/writer/KernelWriter.java
index 815bedd5..9de60797 100644
--- a/src/main/java/com/aparapi/internal/writer/KernelWriter.java
+++ b/src/main/java/com/aparapi/internal/writer/KernelWriter.java
@@ -52,16 +52,15 @@ under those regulations, please refer to the U.S. Bureau of Industry and Securit
  */
 package com.aparapi.internal.writer;
 
-import com.aparapi.Config;
-import com.aparapi.Kernel;
-import com.aparapi.internal.exception.ClassParseException;
-import com.aparapi.internal.exception.CodeGenException;
-import com.aparapi.internal.instruction.Instruction;
-import com.aparapi.internal.instruction.InstructionSet;
-import com.aparapi.internal.model.ClassModel;
-import com.aparapi.internal.model.Entrypoint;
-import com.aparapi.internal.model.MethodModel;
 import com.aparapi.*;
+import com.aparapi.internal.exception.*;
+import com.aparapi.internal.instruction.*;
+import com.aparapi.internal.instruction.InstructionSet.*;
+import com.aparapi.internal.model.*;
+import com.aparapi.internal.model.ClassModel.AttributePool.*;
+import com.aparapi.internal.model.ClassModel.AttributePool.RuntimeAnnotationsEntry.*;
+import com.aparapi.internal.model.ClassModel.*;
+import com.aparapi.internal.model.ClassModel.ConstantPool.*;
 
 import java.util.*;
 
@@ -184,7 +183,7 @@ public abstract class KernelWriter extends BlockWriter{
       }
    }
 
-   @Override public void writeMethod(InstructionSet.MethodCall _methodCall, ClassModel.ConstantPool.MethodEntry _methodEntry) throws CodeGenException {
+   @Override public void writeMethod(MethodCall _methodCall, MethodEntry _methodEntry) throws CodeGenException {
       final int argc = _methodEntry.getStackConsumeCount();
 
       final String methodName = _methodEntry.getNameAndTypeEntry().getNameUTF8Entry().getUTF8();
@@ -209,10 +208,10 @@ public abstract class KernelWriter extends BlockWriter{
             write(barrierAndGetterMappings);
          }
       } else {
-         final boolean isSpecial = _methodCall instanceof InstructionSet.I_INVOKESPECIAL;
+         final boolean isSpecial = _methodCall instanceof I_INVOKESPECIAL;
          MethodModel m = entryPoint.getCallTarget(_methodEntry, isSpecial);
 
-         ClassModel.ConstantPool.FieldEntry getterField = null;
+         FieldEntry getterField = null;
          if (m != null && m.isGetter()) {
             getterField = m.getAccessorVariableFieldEntry();
          }
@@ -249,17 +248,17 @@ public abstract class KernelWriter extends BlockWriter{
 
          write("(");
 
-         if ((intrinsicMapping == null) && (_methodCall instanceof InstructionSet.VirtualMethodCall) && (!isIntrinsic)) {
+         if ((intrinsicMapping == null) && (_methodCall instanceof VirtualMethodCall) && (!isIntrinsic)) {
 
-            final Instruction i = ((InstructionSet.VirtualMethodCall) _methodCall).getInstanceReference();
+            final Instruction i = ((VirtualMethodCall) _methodCall).getInstanceReference();
 
-            if (i instanceof InstructionSet.I_ALOAD_0) {
+            if (i instanceof I_ALOAD_0) {
                write("this");
-            } else if (i instanceof InstructionSet.AccessArrayElement) {
-               final InstructionSet.AccessArrayElement arrayAccess = (InstructionSet.AccessArrayElement) ((InstructionSet.VirtualMethodCall) _methodCall).getInstanceReference();
+            } else if (i instanceof AccessArrayElement) {
+               final AccessArrayElement arrayAccess = (AccessArrayElement) ((VirtualMethodCall) _methodCall).getInstanceReference();
                final Instruction refAccess = arrayAccess.getArrayRef();
                //assert refAccess instanceof I_GETFIELD : "ref should come from getfield";
-               final String fieldName = ((InstructionSet.AccessField) refAccess).getConstantPoolFieldEntry().getNameAndTypeEntry()
+               final String fieldName = ((AccessField) refAccess).getConstantPoolFieldEntry().getNameAndTypeEntry()
                      .getNameUTF8Entry().getUTF8();
                write(" &(this->" + fieldName);
                write("[");
@@ -270,7 +269,7 @@ public abstract class KernelWriter extends BlockWriter{
             }
          }
          for (int arg = 0; arg < argc; arg++) {
-            if (((intrinsicMapping == null) && (_methodCall instanceof InstructionSet.VirtualMethodCall) && (!isIntrinsic)) || (arg != 0)) {
+            if (((intrinsicMapping == null) && (_methodCall instanceof VirtualMethodCall) && (!isIntrinsic)) || (arg != 0)) {
                write(", ");
             }
             writeInstruction(_methodCall.getArg(arg));
@@ -280,7 +279,7 @@ public abstract class KernelWriter extends BlockWriter{
    }
 
    private boolean isThis(Instruction instruction) {
-      return instruction instanceof InstructionSet.I_ALOAD_0;
+      return instruction instanceof I_ALOAD_0;
    }
 
    public void writePragma(String _name, boolean _enable) {
@@ -296,9 +295,9 @@ public abstract class KernelWriter extends BlockWriter{
 
    public final static String __private = "__private";
 
-   public final static String LOCAL_ANNOTATION_NAME = "L" + Kernel.Local.class.getName().replace('.', '/') + ";";
+   public final static String LOCAL_ANNOTATION_NAME = "L" + com.aparapi.Kernel.Local.class.getName().replace('.', '/') + ";";
 
-   public final static String CONSTANT_ANNOTATION_NAME = "L" + Kernel.Constant.class.getName().replace('.', '/')
+   public final static String CONSTANT_ANNOTATION_NAME = "L" + com.aparapi.Kernel.Constant.class.getName().replace('.', '/')
          + ";";
 
    @Override public void write(Entrypoint _entryPoint) throws CodeGenException {
@@ -308,7 +307,7 @@ public abstract class KernelWriter extends BlockWriter{
 
       entryPoint = _entryPoint;
 
-      for (final ClassModel.ClassModelField field : _entryPoint.getReferencedClassModelFields()) {
+      for (final ClassModelField field : _entryPoint.getReferencedClassModelFields()) {
          // Field field = _entryPoint.getClassModel().getField(f.getName());
          final StringBuilder thisStructLine = new StringBuilder();
          final StringBuilder argLine = new StringBuilder();
@@ -334,10 +333,10 @@ public abstract class KernelWriter extends BlockWriter{
          if (privateMemorySize != null) {
             type = __private;
          }
-         final ClassModel.AttributePool.RuntimeAnnotationsEntry visibleAnnotations = field.getAttributePool().getRuntimeVisibleAnnotationsEntry();
+         final RuntimeAnnotationsEntry visibleAnnotations = field.getAttributePool().getRuntimeVisibleAnnotationsEntry();
 
          if (visibleAnnotations != null) {
-            for (final ClassModel.AttributePool.RuntimeAnnotationsEntry.AnnotationInfo ai : visibleAnnotations) {
+            for (final AnnotationInfo ai : visibleAnnotations) {
                final String typeDescriptor = ai.getTypeDescriptor();
                if (typeDescriptor.equals(LOCAL_ANNOTATION_NAME)) {
                   type = __local;
@@ -366,7 +365,7 @@ public abstract class KernelWriter extends BlockWriter{
          // If it is a converted array of objects, emit the struct param
          String className = null;
          if (signature.startsWith("L")) {
-            // Turn Lcom/aparapi/javalabs/opencl/demo/DummyOOA; into com_aparapi_javalabs_opencl_demo_DummyOOA for example
+            // Turn Lcom/aparapi/javalabs/opencl/demo/DummyOOA; into com_amd_javalabs_opencl_demo_DummyOOA for example
             className = (signature.substring(1, signature.length() - 1)).replace('/', '_');
             // if (logger.isLoggable(Level.FINE)) {
             // logger.fine("Examining object parameter: " + signature + " new: " + className);
@@ -416,7 +415,7 @@ public abstract class KernelWriter extends BlockWriter{
                final StringBuilder lenAssignLine = new StringBuilder();
 
                String suffix = numDimensions == 1 ? "" : Integer.toString(i);
-               String lenName = field.getName() + arrayLengthMangleSuffix + suffix;
+               String lenName = field.getName() + BlockWriter.arrayLengthMangleSuffix + suffix;
 
                lenStructLine.append("int " + lenName);
 
@@ -435,7 +434,7 @@ public abstract class KernelWriter extends BlockWriter{
                   final StringBuilder dimStructLine = new StringBuilder();
                   final StringBuilder dimArgLine = new StringBuilder();
                   final StringBuilder dimAssignLine = new StringBuilder();
-                  String dimName = field.getName() + arrayDimMangleSuffix + suffix;
+                  String dimName = field.getName() + BlockWriter.arrayDimMangleSuffix + suffix;
 
                   dimStructLine.append("int " + dimName);
 
@@ -499,7 +498,7 @@ public abstract class KernelWriter extends BlockWriter{
 
       // Emit structs for oop transformation accessors
       for (final ClassModel cm : _entryPoint.getObjectArrayFieldsClasses().values()) {
-         final ArrayList<ClassModel.ConstantPool.FieldEntry> fieldSet = cm.getStructMembers();
+         final ArrayList<FieldEntry> fieldSet = cm.getStructMembers();
          if (fieldSet.size() > 0) {
             final String mangledClassName = cm.getClassWeAreModelling().getName().replace('.', '_');
             newLine();
@@ -510,9 +509,9 @@ public abstract class KernelWriter extends BlockWriter{
             int totalSize = 0;
             int alignTo = 0;
 
-            final Iterator<ClassModel.ConstantPool.FieldEntry> it = fieldSet.iterator();
+            final Iterator<FieldEntry> it = fieldSet.iterator();
             while (it.hasNext()) {
-               final ClassModel.ConstantPool.FieldEntry field = it.next();
+               final FieldEntry field = it.next();
                final String fType = field.getNameAndTypeEntry().getDescriptorUTF8Entry().getUTF8();
                final int fSize = InstructionSet.TypeSpec.valueOf(fType.equals("Z") ? "B" : fType).getSize();
 
@@ -611,8 +610,8 @@ public abstract class KernelWriter extends BlockWriter{
 
          boolean alreadyHasFirstArg = !mm.getMethod().isStatic();
 
-         final ClassModel.LocalVariableTableEntry<ClassModel.LocalVariableInfo> lvte = mm.getLocalVariableTableEntry();
-         for (final ClassModel.LocalVariableInfo lvi : lvte) {
+         final LocalVariableTableEntry<LocalVariableInfo> lvte = mm.getLocalVariableTableEntry();
+         for (final LocalVariableInfo lvi : lvte) {
             if ((lvi.getStart() == 0) && ((lvi.getVariableIndex() != 0) || mm.getMethod().isStatic())) { // full scope but skip this
                final String descriptor = lvi.getVariableDescriptor();
                if (alreadyHasFirstArg) {
@@ -683,23 +682,23 @@ public abstract class KernelWriter extends BlockWriter{
    }
 
    @Override public void writeInstruction(Instruction _instruction) throws CodeGenException {
-      if ((_instruction instanceof InstructionSet.I_IUSHR) || (_instruction instanceof InstructionSet.I_LUSHR)) {
-         final InstructionSet.BinaryOperator binaryInstruction = (InstructionSet.BinaryOperator) _instruction;
+      if ((_instruction instanceof I_IUSHR) || (_instruction instanceof I_LUSHR)) {
+         final BinaryOperator binaryInstruction = (BinaryOperator) _instruction;
          final Instruction parent = binaryInstruction.getParentExpr();
          boolean needsParenthesis = true;
 
-         if (parent instanceof InstructionSet.AssignToLocalVariable) {
+         if (parent instanceof AssignToLocalVariable) {
             needsParenthesis = false;
-         } else if (parent instanceof InstructionSet.AssignToField) {
+         } else if (parent instanceof AssignToField) {
             needsParenthesis = false;
-         } else if (parent instanceof InstructionSet.AssignToArrayElement) {
+         } else if (parent instanceof AssignToArrayElement) {
             needsParenthesis = false;
          }
          if (needsParenthesis) {
             write("(");
          }
 
-         if (binaryInstruction instanceof InstructionSet.I_IUSHR) {
+         if (binaryInstruction instanceof I_IUSHR) {
             write("((unsigned int)");
          } else {
             write("((unsigned long)");
-- 
GitLab