diff --git a/.gitignore b/.gitignore
index 3e1b52e424ac9f2ebe4a28b4809fc5034448ecfc..3eb6598eea1b7216cf9c00a37283079e7e74635c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -31,3 +31,5 @@ hs_err_pid*
 /.libs/
 /findbugs/
 /target/
+.idea
+*.iml
diff --git a/pom.xml b/pom.xml
index 0ee5e13aa4dc94231de16cd5269201c05a0e1dae..c31fadec18b50148f82bf9e7cf61d5b84fca1f98 100644
--- a/pom.xml
+++ b/pom.xml
@@ -148,7 +148,7 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-javadoc-plugin</artifactId>
-                <version>2.10.4</version>
+                <version>2.10.3</version>
                 <configuration>
                     <additionalparam>-Xdoclint:none</additionalparam>
                 </configuration>
diff --git a/src/main/java/com/aparapi/Config.java b/src/main/java/com/aparapi/Config.java
index 6d04663d298668e683cc55a9a7ad0c9eead69454..c85648fe25206f26e67c75d95c8701f95c3d41d8 100644
--- a/src/main/java/com/aparapi/Config.java
+++ b/src/main/java/com/aparapi/Config.java
@@ -52,11 +52,13 @@ under those regulations, please refer to the U.S. Bureau of Industry and Securit
  */
 package com.aparapi;
 
-import com.aparapi.internal.instruction.*;
-import com.aparapi.internal.jni.*;
-import com.aparapi.internal.tool.*;
+import com.aparapi.internal.instruction.Instruction;
+import com.aparapi.internal.jni.ConfigJNI;
+import com.aparapi.internal.tool.InstructionViewer;
 
-import java.util.logging.*;
+import java.util.logging.Handler;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 /**
  * A central location for holding all runtime configurable properties as well as logging configuration.
@@ -69,11 +71,22 @@ import java.util.logging.*;
  */
 public class Config extends ConfigJNI{
 
-   // Logging setup
    private static final String logPropName = propPkgName + ".logLevel";
 
    private static final Logger logger = Logger.getLogger(Config.getLoggerName());
 
+
+   /** originally from Range.java: */
+   public static final int THREADS_PER_CORE = 16;
+
+   /** originally from Range.java: */
+   public static final int MAX_OPENCL_GROUP_SIZE = 256;
+
+   /** originally from Range.java: */
+   public static final int MAX_GROUP_SIZE =
+           Math.max(Runtime.getRuntime().availableProcessors() * THREADS_PER_CORE,
+                    MAX_OPENCL_GROUP_SIZE);
+
    /**
     * Allows the user to request to use a jvmti agent to 
     * access JNI code rather than loading explicitly.
@@ -167,11 +180,11 @@ public class Config extends ConfigJNI{
 
    public static final boolean enableSWITCH = Boolean.getBoolean(propPkgName + ".enable.SWITCH");
 
-   public static boolean enableShowFakeLocalVariableTable = Boolean.getBoolean(propPkgName + ".enableShowFakeLocalVariableTable");
+   public static final boolean enableShowFakeLocalVariableTable = Boolean.getBoolean(propPkgName + ".enableShowFakeLocalVariableTable");
 
    public static final boolean enableInstructionDecodeViewer = Boolean.getBoolean(propPkgName + ".enableInstructionDecodeViewer");
 
-   public static String instructionListenerClassName = System.getProperty(propPkgName + ".instructionListenerClass");
+   public static /* TODO final */ String instructionListenerClassName = System.getProperty(propPkgName + ".instructionListenerClass");
 
    public static InstructionListener instructionListener = null;
 
@@ -193,7 +206,7 @@ public class Config extends ConfigJNI{
          System.out.println("Exception " + e + " in Aparapi logging setup");
          e.printStackTrace();
       }
-   };
+   }
 
    static {
       if (enableInstructionDecodeViewer && ((instructionListenerClassName == null) || instructionListenerClassName.equals(""))) {
@@ -204,13 +217,7 @@ public class Config extends ConfigJNI{
          try {
             final Class<?> instructionListenerClass = Class.forName(instructionListenerClassName);
             instructionListener = (InstructionListener) instructionListenerClass.newInstance();
-         } catch (final ClassNotFoundException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-         } catch (final InstantiationException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-         } catch (final IllegalAccessException e) {
+         } catch (final ClassNotFoundException | IllegalAccessException | InstantiationException e) {
             // TODO Auto-generated catch block
             e.printStackTrace();
          }
diff --git a/src/main/java/com/aparapi/Kernel.java b/src/main/java/com/aparapi/Kernel.java
index ecdff9200928312452fed79a76b28bc3a5ede98e..9d6d3a24faea3fbb60f00a3459fce0adf273ce9f 100644
--- a/src/main/java/com/aparapi/Kernel.java
+++ b/src/main/java/com/aparapi/Kernel.java
@@ -53,7 +53,14 @@ under those regulations, please refer to the U.S. Bureau of Industry and Securit
 package com.aparapi;
 
 import com.aparapi.annotation.Experimental;
+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.CacheEnabler;
 import com.aparapi.internal.model.ClassModel.ConstantPool.MethodReferenceEntry;
 import com.aparapi.internal.model.ClassModel.ConstantPool.NameAndTypeEntry;
@@ -61,36 +68,16 @@ 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.Reflection;
+import com.aparapi.internal.util.UnsafeWrapper;
 
-import java.lang.annotation.Annotation;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
+import java.lang.annotation.*;
 import java.lang.reflect.Method;
-import java.util.ArrayDeque;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Deque;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.concurrent.BrokenBarrierException;
 import java.util.concurrent.CyclicBarrier;
 import java.util.logging.Logger;
 
-import com.aparapi.device.Device;
-import com.aparapi.device.JavaDevice;
-import com.aparapi.device.OpenCLDevice;
-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.util.Reflection;
-import com.aparapi.internal.util.UnsafeWrapper;
-
 /**
  * A <i>kernel</i> encapsulates a data parallel algorithm that will execute either on a GPU
  * (through conversion to OpenCL) or on a CPU via a Java Thread Pool.
@@ -179,7 +166,7 @@ import com.aparapi.internal.util.UnsafeWrapper;
  */
 public abstract class Kernel implements Cloneable {
 
-   private static Logger logger = Logger.getLogger(Config.getLoggerName());
+   private static final Logger logger = Logger.getLogger(Config.getLoggerName());
 
    /**
     *  We can use this Annotation to 'tag' intended local buffers.
@@ -392,7 +379,7 @@ public abstract class Kernel implements Cloneable {
     * @version Alpha, 21/09/2010
     */
    @Deprecated
-   public static enum EXECUTION_MODE {
+   public enum EXECUTION_MODE {
       /**
        *
        */
@@ -435,7 +422,7 @@ public abstract class Kernel implements Cloneable {
        */
       @Deprecated
       static LinkedHashSet<EXECUTION_MODE> getDefaultExecutionModes() {
-         LinkedHashSet<EXECUTION_MODE> defaultExecutionModes = new LinkedHashSet<EXECUTION_MODE>();
+         LinkedHashSet<EXECUTION_MODE> defaultExecutionModes = new LinkedHashSet<>();
 
          if (OpenCLLoader.isOpenCLAvailable()) {
             defaultExecutionModes.add(GPU);
@@ -473,7 +460,7 @@ public abstract class Kernel implements Cloneable {
       }
 
       static LinkedHashSet<EXECUTION_MODE> getExecutionModeFromString(String executionMode) {
-         final LinkedHashSet<EXECUTION_MODE> executionModes = new LinkedHashSet<EXECUTION_MODE>();
+         final LinkedHashSet<EXECUTION_MODE> executionModes = new LinkedHashSet<>();
          for (final String mode : executionMode.split(",")) {
             executionModes.add(valueOf(mode.toUpperCase()));
          }
@@ -498,7 +485,7 @@ public abstract class Kernel implements Cloneable {
       public boolean isOpenCL() {
          return (this == GPU) || (this == ACC) || (this == CPU);
       }
-   };
+   }
 
    private KernelRunner kernelRunner = null;
 
@@ -663,10 +650,7 @@ public abstract class Kernel implements Cloneable {
          if (!localBarrierDisabled) {
             try {
                kernelState.getLocalBarrier().await();
-            } catch (final InterruptedException e) {
-               // TODO Auto-generated catch block
-               e.printStackTrace();
-            } catch (final BrokenBarrierException e) {
+            } catch (final InterruptedException | BrokenBarrierException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
             }
@@ -2257,7 +2241,7 @@ public abstract class Kernel implements Cloneable {
       executionMode = EXECUTION_MODE.getFallbackExecutionMode();
    }
 
-   final static Map<String, String> typeToLetterMap = new HashMap<String, String>();
+   final static Map<String, String> typeToLetterMap = new HashMap<>();
 
    static {
       // only primitive types for now
diff --git a/src/main/java/com/aparapi/ProfileInfo.java b/src/main/java/com/aparapi/ProfileInfo.java
index 00aadbffa38a2107e0e90b69743075035bba5704..8c3ffd02b7d22ae1bbfeba04569e75f30f440cd6 100644
--- a/src/main/java/com/aparapi/ProfileInfo.java
+++ b/src/main/java/com/aparapi/ProfileInfo.java
@@ -58,7 +58,7 @@ public class ProfileInfo{
       R,
       X,
       W
-   }; // 0 = write, 1 = execute, 2 = read
+   } // 0 = write, 1 = execute, 2 = read
 
    private final TYPE type;
 
diff --git a/src/main/java/com/aparapi/Range.java b/src/main/java/com/aparapi/Range.java
index 5ee2272500228a9b780252e9da08d0c05c1badb8..cc39ca07c2511d0b865bac8eeed7b9e1fea55d7c 100644
--- a/src/main/java/com/aparapi/Range.java
+++ b/src/main/java/com/aparapi/Range.java
@@ -15,10 +15,12 @@
  */
 package com.aparapi;
 
-import com.aparapi.device.*;
-import com.aparapi.internal.jni.*;
+import com.aparapi.device.Device;
+import com.aparapi.device.JavaDevice;
+import com.aparapi.device.OpenCLDevice;
+import com.aparapi.internal.jni.RangeJNI;
 
-import java.util.*;
+import java.util.Arrays;
 
 /**
  * 
@@ -64,21 +66,14 @@ import java.util.*;
  */
 public class Range extends RangeJNI{
 
-   public static final int THREADS_PER_CORE = 16;
-
-   public static final int MAX_OPENCL_GROUP_SIZE = 256;
-
-   public static final int MAX_GROUP_SIZE = Math.max(Runtime.getRuntime().availableProcessors() * THREADS_PER_CORE,
-         MAX_OPENCL_GROUP_SIZE);
-
    private OpenCLDevice device = null;
 
    private int maxWorkGroupSize;
 
    private int[] maxWorkItemSize = new int[] {
-         MAX_GROUP_SIZE,
-         MAX_GROUP_SIZE,
-         MAX_GROUP_SIZE
+         Config.MAX_GROUP_SIZE,
+         Config.MAX_GROUP_SIZE,
+         Config.MAX_GROUP_SIZE
    };
 
    /**
@@ -95,7 +90,7 @@ public class Range extends RangeJNI{
          maxWorkItemSize = device.getMaxWorkItemSize();
          maxWorkGroupSize = device.getMaxWorkGroupSize();
       } else {
-         maxWorkGroupSize = MAX_GROUP_SIZE;
+         maxWorkGroupSize = Config.MAX_GROUP_SIZE;
       }
    }
 
@@ -128,7 +123,7 @@ public class Range extends RangeJNI{
     */
 
    private static int[] getFactors(int _value, int _max) {
-      final int factors[] = new int[MAX_GROUP_SIZE];
+      final int factors[] = new int[Config.MAX_GROUP_SIZE];
       int factorIdx = 0;
 
       for (int possibleFactor = 1; possibleFactor <= _max; possibleFactor++) {
@@ -429,15 +424,13 @@ public class Range extends RangeJNI{
 
       switch (dims) {
          case 1:
-            sb.append("global:" + globalSize_0 + " local:" + (localIsDerived ? "(derived)" : "") + localSize_0);
+            sb.append("global:").append(globalSize_0).append(" local:").append(localIsDerived ? "(derived)" : "").append(localSize_0);
             break;
          case 2:
-            sb.append("2D(global:" + globalSize_0 + "x" + globalSize_1 + " local:" + (localIsDerived ? "(derived)" : "")
-                  + localSize_0 + "x" + localSize_1 + ")");
+            sb.append("2D(global:").append(globalSize_0).append("x").append(globalSize_1).append(" local:").append(localIsDerived ? "(derived)" : "").append(localSize_0).append("x").append(localSize_1).append(")");
             break;
          case 3:
-             sb.append("3D(global:" + globalSize_0 + "x" + globalSize_1 + "x" + globalSize_2 + " local:"
-                  + (localIsDerived ? "(derived)" : "") + localSize_0 + "x" + localSize_1 + "x" + localSize_2 + ")");
+             sb.append("3D(global:").append(globalSize_0).append("x").append(globalSize_1).append("x").append(globalSize_2).append(" local:").append(localIsDerived ? "(derived)" : "").append(localSize_0).append("x").append(localSize_1).append("x").append(localSize_2).append(")");
             break;
       }
 
diff --git a/src/main/java/com/aparapi/device/Device.java b/src/main/java/com/aparapi/device/Device.java
index e43e90b25d65cf1a35d896a2a7f503dbe8bf3da5..6ffa8858ab7d84be6a3185a90d4bbf05a5ee5d0c 100644
--- a/src/main/java/com/aparapi/device/Device.java
+++ b/src/main/java/com/aparapi/device/Device.java
@@ -15,12 +15,12 @@
  */
 package com.aparapi.device;
 
-import com.aparapi.*;
-import com.aparapi.internal.kernel.*;
+import com.aparapi.Range;
+import com.aparapi.internal.kernel.KernelManager;
 
 public abstract class Device{
 
-   public static enum TYPE {
+   public enum TYPE {
       UNKNOWN(Integer.MAX_VALUE),
       GPU(2),
       CPU(3),
@@ -35,7 +35,7 @@ public abstract class Device{
       TYPE(int rank) {
          this.rank = rank;
       }
-   };
+   }
 
    /** @deprecated  use {@link KernelManager#bestDevice()}
     *  @see com.aparapi.device
diff --git a/src/main/java/com/aparapi/device/OpenCLDevice.java b/src/main/java/com/aparapi/device/OpenCLDevice.java
index fbd86e40db86903137b3cbf40ea30ca2c11568a5..d4e31404cf378aa55efc7d6874bab8e2df47c64f 100644
--- a/src/main/java/com/aparapi/device/OpenCLDevice.java
+++ b/src/main/java/com/aparapi/device/OpenCLDevice.java
@@ -15,7 +15,13 @@
  */
 package com.aparapi.device;
 
-import com.aparapi.opencl.OpenCL.Kernel;
+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.opencl.OpenCL.*;
 
 import java.io.BufferedReader;
 import java.io.IOException;
@@ -30,21 +36,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-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.opencl.OpenCL.Arg;
-import com.aparapi.opencl.OpenCL.Constant;
-import com.aparapi.opencl.OpenCL.GlobalReadOnly;
-import com.aparapi.opencl.OpenCL.GlobalReadWrite;
-import com.aparapi.opencl.OpenCL.GlobalWriteOnly;
-import com.aparapi.opencl.OpenCL.Local;
-import com.aparapi.opencl.OpenCL.Resource;
-import com.aparapi.opencl.OpenCL.Source;
-
 public class OpenCLDevice extends Device{
 
    private final OpenCLPlatform platform;
@@ -162,8 +153,9 @@ public class OpenCLDevice extends Device{
                kernel.invoke(args);
             }
          } else {
-            if (method.getName().equals("put")) {
-               System.out.println("put not implemented");
+            switch (method.getName()) {
+               case "put":
+                  System.out.println("put not implemented");
 
                /*
                for (Object arg : args) {
@@ -186,8 +178,9 @@ public class OpenCLDevice extends Device{
                   }
                }
                */
-            } else if (method.getName().equals("get")) {
-               System.out.println("get not implemented");
+                  break;
+               case "get":
+                  System.out.println("get not implemented");
                /*
                for (Object arg : args) {
                   Class<?> argClass = arg.getClass();
@@ -209,20 +202,25 @@ public class OpenCLDevice extends Device{
                   }
                }
                */
-            } else if (method.getName().equals("begin")) {
-               System.out.println("begin not implemented");
-            } else if (method.getName().equals("dispose")) {
-              // System.out.println("dispose");
-               for (OpenCLKernel k:map.values()){
-                   k.dispose();
-               }
-               program.dispose();
-               map.clear();
-               disposed=true;
-            } else if (method.getName().equals("end")) {
-               System.out.println("end not implemented");
-            }  else if (method.getName().equals("getProfileInfo")){
-               proxy = program.getProfileInfo();
+                  break;
+               case "begin":
+                  System.out.println("begin not implemented");
+                  break;
+               case "dispose":
+                  // System.out.println("dispose");
+                  for (OpenCLKernel k : map.values()) {
+                     k.dispose();
+                  }
+                  program.dispose();
+                  map.clear();
+                  disposed = true;
+                  break;
+               case "end":
+                  System.out.println("end not implemented");
+                  break;
+               case "getProfileInfo":
+                  proxy = program.getProfileInfo();
+                  break;
             }
          }
          return proxy;
@@ -230,7 +228,7 @@ public class OpenCLDevice extends Device{
    }
 
    public List<OpenCLArgDescriptor> getArgs(Method m) {
-      final List<OpenCLArgDescriptor> args = new ArrayList<OpenCLArgDescriptor>();
+      final List<OpenCLArgDescriptor> args = new ArrayList<>();
       final Annotation[][] parameterAnnotations = m.getParameterAnnotations();
       final Class<?>[] parameterTypes = m.getParameterTypes();
 
@@ -352,7 +350,7 @@ public class OpenCLDevice extends Device{
    }
 
    public <T extends OpenCL<T>> T bind(Class<T> _interface, String _source) {
-      final Map<String, List<OpenCLArgDescriptor>> kernelNameToArgsMap = new HashMap<String, List<OpenCLArgDescriptor>>();
+      final Map<String, List<OpenCLArgDescriptor>> kernelNameToArgsMap = new HashMap<>();
 
       if (_source == null) {
          final StringBuilder sourceBuilder = new StringBuilder();
@@ -386,7 +384,7 @@ public class OpenCLDevice extends Device{
                      //  System.out.println("   annotation "+a);
                      // System.out.println("   annotation type " + a.annotationType());
                      if (a instanceof Kernel) {
-                        sourceBuilder.append("__kernel void " + m.getName() + "(");
+                        sourceBuilder.append("__kernel void ").append(m.getName()).append("(");
                         final List<OpenCLArgDescriptor> args = getArgs(m);
 
                         boolean first = true;
@@ -396,7 +394,7 @@ public class OpenCLDevice extends Device{
                            } else {
                               sourceBuilder.append(",");
                            }
-                           sourceBuilder.append("\n   " + arg);
+                           sourceBuilder.append("\n   ").append(arg);
                         }
 
                         sourceBuilder.append(")");
@@ -422,7 +420,7 @@ public class OpenCLDevice extends Device{
 
       final OpenCLProgram program = new OpenCLProgram(this, _source).createProgram(this);
 
-      final Map<String, OpenCLKernel> map = new HashMap<String, OpenCLKernel>();
+      final Map<String, OpenCLKernel> map = new HashMap<>();
       for (final String name : kernelNameToArgsMap.keySet()) {
          final OpenCLKernel kernel = OpenCLKernel.createKernel(program, name, kernelNameToArgsMap.get(name));
          //final OpenCLKernel kernel = new OpenCLKernel(program, name, kernelNameToArgsMap.get(name));
@@ -433,7 +431,7 @@ public class OpenCLDevice extends Device{
          map.put(name, kernel);
       }
 
-      final OpenCLInvocationHandler<T> invocationHandler = new OpenCLInvocationHandler<T>(program, map);
+      final OpenCLInvocationHandler<T> invocationHandler = new OpenCLInvocationHandler<>(program, map);
       final T instance = (T) Proxy.newProxyInstance(OpenCLDevice.class.getClassLoader(), new Class[] {
             _interface,
             OpenCL.class
diff --git a/src/main/java/com/aparapi/internal/exception/ClassParseException.java b/src/main/java/com/aparapi/internal/exception/ClassParseException.java
index 4114d7c5433b41a7adcaaa780b4d7e74b20e18ea..286495a22dffb13602da68c23bf0f8b66bde8f2e 100644
--- a/src/main/java/com/aparapi/internal/exception/ClassParseException.java
+++ b/src/main/java/com/aparapi/internal/exception/ClassParseException.java
@@ -65,7 +65,7 @@ import com.aparapi.internal.instruction.Instruction;
  */
 @SuppressWarnings("serial") public class ClassParseException extends AparapiException{
 
-   public static enum TYPE {
+   public enum TYPE {
       NONE("none"), //
       ARRAY_RETURN("We don't support areturn instructions"), //
       PUTFIELD("We don't support putstatic instructions"), //
@@ -101,7 +101,7 @@ import com.aparapi.internal.instruction.Instruction;
       MISSINGLOCALVARIABLETABLE("Method does not contain a local variable table (recompile with -g?)"), //
       IMPROPERPRIVATENAMEMANGLING("Could not parse private array size from field name");
 
-      private String description;
+      private final String description;
 
       TYPE(final String _description) {
          description = _description;
@@ -110,7 +110,7 @@ import com.aparapi.internal.instruction.Instruction;
       public String getDescription() {
          return (description);
       }
-   };
+   }
 
    private Instruction instruction;
 
diff --git a/src/main/java/com/aparapi/internal/instruction/BranchSet.java b/src/main/java/com/aparapi/internal/instruction/BranchSet.java
index bdce4bfc92fc945e472b2199259debfef883ab33..7ff43748da1ad855fb95a641854b18889f54ece1 100644
--- a/src/main/java/com/aparapi/internal/instruction/BranchSet.java
+++ b/src/main/java/com/aparapi/internal/instruction/BranchSet.java
@@ -52,14 +52,14 @@ 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.Branch;
+import com.aparapi.internal.instruction.InstructionSet.ConditionalBranch;
+
 import java.util.ArrayList;
 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.
  * 
@@ -300,7 +300,7 @@ public class BranchSet {
 
    }
 
-   private final List<ConditionalBranch> set = new ArrayList<ConditionalBranch>();
+   private final List<ConditionalBranch> set = new ArrayList<>();
 
    private final Instruction fallThrough;
 
@@ -323,7 +323,7 @@ public class BranchSet {
       target = _branch.getTarget();
       last = _branch;
 
-      final Set<Branch> expandedSet = new LinkedHashSet<Branch>();
+      final Set<Branch> expandedSet = new LinkedHashSet<>();
       final Instruction fallThroughRoot = last.getNextExpr();
       fallThrough = fallThroughRoot == null ? last.getNextPC() : fallThroughRoot.getStartInstruction();
       first = last;
diff --git a/src/main/java/com/aparapi/internal/instruction/ExpressionList.java b/src/main/java/com/aparapi/internal/instruction/ExpressionList.java
index c5c8413cf5f77b6e2c5e2f2f83c8849c1a03eec6..6cceeca629d09cca6d3ab7ad5171924f8bc28aac 100644
--- a/src/main/java/com/aparapi/internal/instruction/ExpressionList.java
+++ b/src/main/java/com/aparapi/internal/instruction/ExpressionList.java
@@ -52,27 +52,19 @@ under those regulations, please refer to the U.S. Bureau of Industry and Securit
 */
 package com.aparapi.internal.instruction;
 
+import com.aparapi.Config;
+import com.aparapi.internal.exception.ClassParseException;
+import com.aparapi.internal.instruction.InstructionSet.*;
+import com.aparapi.internal.model.ClassModel.LocalVariableInfo;
+import com.aparapi.internal.model.ClassModel.LocalVariableTableEntry;
+import com.aparapi.internal.model.MethodModel;
+
 import java.util.ArrayList;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-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;
-
 /**
  * Essentially a glorified linked list of Instructions plus some additional state to allow us to transform sequences.
  * 
@@ -83,7 +75,7 @@ import com.aparapi.internal.model.ClassModel.LocalVariableInfo;
  */
 public class ExpressionList{
 
-   private static Logger logger = Logger.getLogger(Config.getLoggerName());
+   private static final Logger logger = Logger.getLogger(Config.getLoggerName());
 
    private final MethodModel methodModel;
 
@@ -830,8 +822,6 @@ public class ExpressionList{
             Config.instructionListener.showAndTell("after folding", head, _instruction);
          }
 
-      } catch (final ClassParseException _classParseException) {
-         throw new ClassParseException(_classParseException);
       } catch (final Throwable t) {
          throw new ClassParseException(t);
 
@@ -861,7 +851,7 @@ public class ExpressionList{
     */
    public String dumpDiagram(Instruction _instruction) {
       final StringBuilder sb = new StringBuilder();
-      final List<Instruction> list = new ArrayList<Instruction>();
+      final List<Instruction> list = new ArrayList<>();
 
       for (Instruction i = head; i != null; i = i.getNextExpr()) {
          list.add(i);
@@ -874,7 +864,7 @@ public class ExpressionList{
       final Instruction[] array = list.toArray(new Instruction[0]);
       boolean lastWasCursor = false;
 
-      final List<Branch> branches = new ArrayList<Branch>();
+      final List<Branch> branches = new ArrayList<>();
       for (final Instruction i : list) {
          sb.append(String.format(" %3d", i.getStartPC()));
       }
diff --git a/src/main/java/com/aparapi/internal/instruction/Instruction.java b/src/main/java/com/aparapi/internal/instruction/Instruction.java
index 9d3b2352580aaf23a2590a6cfda3b4c7eb66d865..d304d495c285bab9e8e9b3fb26b1df2dee5e2a39 100644
--- a/src/main/java/com/aparapi/internal/instruction/Instruction.java
+++ b/src/main/java/com/aparapi/internal/instruction/Instruction.java
@@ -52,8 +52,6 @@ under those regulations, please refer to the U.S. Bureau of Industry and Securit
 */
 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;
@@ -61,6 +59,8 @@ import com.aparapi.internal.instruction.InstructionSet.ConditionalBranch;
 import com.aparapi.internal.model.MethodModel;
 import com.aparapi.internal.reader.ByteReader;
 
+import java.util.LinkedList;
+
 /**
  * Initially represents a single Java bytecode instruction.
  * 
@@ -74,13 +74,13 @@ import com.aparapi.internal.reader.ByteReader;
  */
 public abstract class Instruction{
 
-   protected MethodModel method;
+   protected final MethodModel method;
 
    private final ByteCode byteCode;
 
    private int length;
 
-   protected int pc;
+   protected final int pc;
 
    abstract String getDescription();
 
@@ -316,24 +316,24 @@ public abstract class Instruction{
       if (_branch.isReverse()) {
          if (_branch.isConditional()) {
             if (reverseConditionalBranchTargets == null) {
-               reverseConditionalBranchTargets = new LinkedList<ConditionalBranch>();
+               reverseConditionalBranchTargets = new LinkedList<>();
             }
             reverseConditionalBranchTargets.add((ConditionalBranch) _branch);
          } else {
             if (reverseUnconditionalBranchTargets == null) {
-               reverseUnconditionalBranchTargets = new LinkedList<Branch>();
+               reverseUnconditionalBranchTargets = new LinkedList<>();
             }
             reverseUnconditionalBranchTargets.add(_branch);
          }
       } else {
          if (_branch.isConditional()) {
             if (forwardConditionalBranchTargets == null) {
-               forwardConditionalBranchTargets = new LinkedList<ConditionalBranch>();
+               forwardConditionalBranchTargets = new LinkedList<>();
             }
             forwardConditionalBranchTargets.add((ConditionalBranch) _branch);
          } else {
             if (forwardUnconditionalBranchTargets == null) {
-               forwardUnconditionalBranchTargets = new LinkedList<Branch>();
+               forwardUnconditionalBranchTargets = new LinkedList<>();
             }
             forwardUnconditionalBranchTargets.add(_branch);
          }
diff --git a/src/main/java/com/aparapi/internal/instruction/InstructionPattern.java b/src/main/java/com/aparapi/internal/instruction/InstructionPattern.java
index 019f9686d7692cce303ae2a7e649e079f0ef45f8..1a5e84556efad829b27fcc63fc41527dd91e390a 100644
--- a/src/main/java/com/aparapi/internal/instruction/InstructionPattern.java
+++ b/src/main/java/com/aparapi/internal/instruction/InstructionPattern.java
@@ -52,19 +52,7 @@ 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;
+import com.aparapi.internal.instruction.InstructionSet.*;
 
 public class InstructionPattern{
 
diff --git a/src/main/java/com/aparapi/internal/instruction/InstructionSet.java b/src/main/java/com/aparapi/internal/instruction/InstructionSet.java
index 61510ec287e57ff79c0caa8a0534f23ff37bb4bb..6a84dfe0ed9f6e19bff7f5308944b8f258ae8b95 100644
--- a/src/main/java/com/aparapi/internal/instruction/InstructionSet.java
+++ b/src/main/java/com/aparapi/internal/instruction/InstructionSet.java
@@ -52,21 +52,21 @@ under those regulations, please refer to the U.S. Bureau of Industry and Securit
 */
 package com.aparapi.internal.instruction;
 
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-
-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.model.ClassModel.LocalVariableTableEntry;
+import com.aparapi.internal.model.MethodModel;
 import com.aparapi.internal.reader.ByteReader;
 
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+
 public class InstructionSet{
 
-   public static enum LoadSpec {
+   public enum LoadSpec {
       NONE, //
       F, // Float
       D, // Double
@@ -76,7 +76,7 @@ public class InstructionSet{
       O, // Object
    }
 
-   public static enum StoreSpec {
+   public enum StoreSpec {
       NONE, //
       F, // Float
       D, // Double
@@ -86,7 +86,7 @@ public class InstructionSet{
       O, // Object
    }
 
-   public static enum TypeSpec {
+   public enum TypeSpec {
       NONE("none", "none", 0, 0), //
       Z("Z", "boolean", 4, 1), // Note 'Z' is the java code for 'boolean' type
       C("C", "char", 2, 1), //
@@ -114,7 +114,7 @@ public class InstructionSet{
 
       private final int slots;
 
-      private TypeSpec(String _shortName, String _longName, int _size, int _slots) {
+      TypeSpec(String _shortName, String _longName, int _size, int _slots) {
          shortName = _shortName;
          longName = _longName;
          size = _size;
@@ -145,7 +145,7 @@ public class InstructionSet{
     *
     */
 
-   public static enum Operator {
+   public enum Operator {
       NONE,
       LogicalOr(true, "||"), //
       LogicalAnd(true, "&&", LogicalOr), //
@@ -198,19 +198,19 @@ public class InstructionSet{
 
       private Operator compliment;
 
-      private Operator(boolean _binary, String _text) {
+      Operator(boolean _binary, String _text) {
 
          text = _text;
          binary = _binary;
       }
 
-      private Operator(boolean _binary, String _text, Operator _c) {
+      Operator(boolean _binary, String _text, Operator _c) {
          this(_binary, _text);
          compliment = _c;
          compliment.compliment = this;
       }
 
-      private Operator() {
+      Operator() {
          this(false, null);
       }
 
@@ -237,7 +237,7 @@ public class InstructionSet{
       }
    }
 
-   public static enum PushSpec {
+   public enum PushSpec {
       NONE, //
       UNKNOWN, //
       I(TypeSpec.I), //
@@ -256,7 +256,7 @@ public class InstructionSet{
       LorD(TypeSpec.LorD), //
       RA(TypeSpec.RA);
 
-      private PushSpec(TypeSpec... _types) {
+      PushSpec(TypeSpec... _types) {
          types = _types;
       }
 
@@ -267,7 +267,7 @@ public class InstructionSet{
       }
    }
 
-   public static enum PopSpec {
+   public enum PopSpec {
       NONE, //
       UNKNOWN(TypeSpec.UNKNOWN), //
       I(TypeSpec.I), //
@@ -299,7 +299,7 @@ public class InstructionSet{
       OARGS(TypeSpec.O, TypeSpec.ARGS), //
       ;
 
-      private PopSpec(TypeSpec... _types) {
+      PopSpec(TypeSpec... _types) {
          types = _types;
       }
 
@@ -310,7 +310,7 @@ public class InstructionSet{
       }
    }
 
-   public static enum ImmediateSpec {
+   public enum ImmediateSpec {
       NONE("NONE"), //
       UNKNOWN("UNKNOWN"), //
       Bconst("byte constant value", TypeSpec.B), //
@@ -329,7 +329,7 @@ public class InstructionSet{
 
       private final String name;
 
-      private ImmediateSpec(String _name, TypeSpec... _types) {
+      ImmediateSpec(String _name, TypeSpec... _types) {
 
          name = _name;
          types = _types;
@@ -346,7 +346,7 @@ public class InstructionSet{
       }
    }
 
-   public static enum ByteCode {
+   public enum ByteCode {
       // name, operation type, immediateOperands, pop operands, push operands
       NOP(null, LoadSpec.NONE, StoreSpec.NONE, ImmediateSpec.NONE, PopSpec.NONE, PushSpec.NONE, Operator.NONE), //
       ACONST_NULL(I_ACONST_NULL.class, PushSpec.N), //
@@ -640,14 +640,14 @@ public class InstructionSet{
 
       private final Operator operator;
 
-      private LoadSpec loadSpec;
+      private final LoadSpec loadSpec;
 
-      private StoreSpec storeSpec;
+      private final StoreSpec storeSpec;
 
       private Constructor<?> constructor;
 
-      private ByteCode(Class<?> _class, LoadSpec _loadSpec, StoreSpec _storeSpec, ImmediateSpec _immediate, PopSpec _pop,
-            PushSpec _push, Operator _operator) {
+      ByteCode(Class<?> _class, LoadSpec _loadSpec, StoreSpec _storeSpec, ImmediateSpec _immediate, PopSpec _pop,
+               PushSpec _push, Operator _operator) {
          clazz = _class;
          immediate = _immediate;
          push = _push;
@@ -660,68 +660,62 @@ public class InstructionSet{
 
             try {
                constructor = clazz.getDeclaredConstructor(MethodModel.class, ByteReader.class, boolean.class);
-            } catch (final SecurityException e) {
-               // TODO Auto-generated catch block
-               e.printStackTrace();
-            } catch (final NoSuchMethodException e) {
-               // TODO Auto-generated catch block
-               e.printStackTrace();
-            } catch (final IllegalArgumentException e) {
+            } catch (final SecurityException | IllegalArgumentException | NoSuchMethodException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
             }
          }
       }
 
-      private ByteCode(Class<?> _class, ImmediateSpec _immediate) {
+      ByteCode(Class<?> _class, ImmediateSpec _immediate) {
          this(_class, LoadSpec.NONE, StoreSpec.NONE, _immediate, PopSpec.NONE, PushSpec.NONE, Operator.NONE);
       }
 
-      private ByteCode(Class<?> _class, PushSpec _push) {
+      ByteCode(Class<?> _class, PushSpec _push) {
          this(_class, LoadSpec.NONE, StoreSpec.NONE, ImmediateSpec.NONE, PopSpec.NONE, _push, Operator.NONE);
       }
 
-      private ByteCode(Class<?> _class, StoreSpec _store, ImmediateSpec _immediate, PopSpec _pop) {
+      ByteCode(Class<?> _class, StoreSpec _store, ImmediateSpec _immediate, PopSpec _pop) {
          this(_class, LoadSpec.NONE, _store, _immediate, _pop, PushSpec.NONE, Operator.NONE);
       }
 
-      private ByteCode(Class<?> _class, StoreSpec _store, PopSpec _pop) {
+      ByteCode(Class<?> _class, StoreSpec _store, PopSpec _pop) {
          this(_class, LoadSpec.NONE, _store, ImmediateSpec.NONE, _pop, PushSpec.NONE, Operator.NONE);
       }
 
-      private ByteCode(Class<?> _class, ImmediateSpec _immediate, PopSpec _pop) {
+      ByteCode(Class<?> _class, ImmediateSpec _immediate, PopSpec _pop) {
          this(_class, LoadSpec.NONE, StoreSpec.NONE, _immediate, _pop, PushSpec.NONE, Operator.NONE);
       }
 
-      private ByteCode(Class<?> _class, ImmediateSpec _immediate, PopSpec _pop, Operator _operator) {
+      ByteCode(Class<?> _class, ImmediateSpec _immediate, PopSpec _pop, Operator _operator) {
          this(_class, LoadSpec.NONE, StoreSpec.NONE, _immediate, _pop, PushSpec.NONE, _operator);
       }
 
-      private ByteCode(Class<?> _class, LoadSpec _load, ImmediateSpec _immediate, PushSpec _push) {
+      ByteCode(Class<?> _class, LoadSpec _load, ImmediateSpec _immediate, PushSpec _push) {
          this(_class, _load, StoreSpec.NONE, _immediate, PopSpec.NONE, _push, Operator.NONE);
       }
 
-      private ByteCode(Class<?> _class, LoadSpec _load, PushSpec _push) {
+      ByteCode(Class<?> _class, LoadSpec _load, PushSpec _push) {
          this(_class, _load, StoreSpec.NONE, ImmediateSpec.NONE, PopSpec.NONE, _push, Operator.NONE);
       }
 
-      private ByteCode(Class<?> _class, ImmediateSpec _immediate, PushSpec _push) {
+      ByteCode(Class<?> _class, ImmediateSpec _immediate, PushSpec _push) {
          this(_class, LoadSpec.NONE, StoreSpec.NONE, _immediate, PopSpec.NONE, _push, Operator.NONE);
       }
 
-      private ByteCode(Class<?> _class, PopSpec _pop, PushSpec _push) {
+      ByteCode(Class<?> _class, PopSpec _pop, PushSpec _push) {
          this(_class, LoadSpec.NONE, StoreSpec.NONE, ImmediateSpec.NONE, _pop, _push, Operator.NONE);
       }
 
-      private ByteCode(Class<?> _class, PopSpec _pop, PushSpec _push, Operator _operator) {
+      ByteCode(Class<?> _class, PopSpec _pop, PushSpec _push, Operator _operator) {
          this(_class, LoadSpec.NONE, StoreSpec.NONE, ImmediateSpec.NONE, _pop, _push, _operator);
       }
 
-      private ByteCode(Class<?> _class, PopSpec _pop) {
+      ByteCode(Class<?> _class, PopSpec _pop) {
          this(_class, LoadSpec.NONE, StoreSpec.NONE, ImmediateSpec.NONE, _pop, PushSpec.NONE, Operator.NONE);
       }
 
-      private ByteCode() {
+      ByteCode() {
          this(null, LoadSpec.NONE, StoreSpec.NONE, ImmediateSpec.NONE, PopSpec.NONE, PushSpec.NONE, Operator.NONE);
       }
 
@@ -754,11 +748,8 @@ public class InstructionSet{
          final PushSpec push = getPush();
          final PopSpec pop = getPop();
 
-         if ((push == PushSpec.D) || (pop == PopSpec.D) || (pop == PopSpec.DD) || (pop == PopSpec.AID)) {
-            return true;
-         }
+         return (push == PushSpec.D) || (pop == PopSpec.D) || (pop == PopSpec.DD) || (pop == PopSpec.AID);
 
-         return false;
       }
 
       public Instruction newInstruction(MethodModel _methodModel, ByteReader byteReader, boolean _isWide) {
@@ -767,19 +758,7 @@ public class InstructionSet{
             try {
                newInstruction = (Instruction) constructor.newInstance(_methodModel, byteReader, _isWide);
                newInstruction.setLength(byteReader.getOffset() - newInstruction.getThisPC());
-            } catch (final SecurityException e) {
-               // TODO Auto-generated catch block
-               e.printStackTrace();
-            } catch (final IllegalArgumentException e) {
-               // TODO Auto-generated catch block
-               e.printStackTrace();
-            } catch (final InstantiationException e) {
-               // TODO Auto-generated catch block
-               e.printStackTrace();
-            } catch (final IllegalAccessException e) {
-               // TODO Auto-generated catch block
-               e.printStackTrace();
-            } catch (final InvocationTargetException e) {
+            } catch (final SecurityException | InvocationTargetException | IllegalAccessException | InstantiationException | IllegalArgumentException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
             }
@@ -819,7 +798,7 @@ public class InstructionSet{
 
    public static class CompositeInstruction extends Instruction{
 
-      protected BranchSet branchSet;
+      protected final BranchSet branchSet;
 
       public CompositeInstruction(MethodModel method, ByteCode _byteCode, Instruction _firstChild, Instruction _lastChild,
             BranchSet _branchSet) {
@@ -2454,7 +2433,7 @@ public class InstructionSet{
    }
 
    public static class I_IINC extends Index08{
-      private int delta;
+      private final int delta;
 
       private final boolean wide;
 
@@ -3558,7 +3537,7 @@ public class InstructionSet{
    }
 
    public static class I_WIDE extends Instruction{
-      private boolean iinc;
+      private final boolean iinc;
 
       private int increment;
 
@@ -3695,24 +3674,24 @@ public class InstructionSet{
    }
 
    public interface InterfaceConstantPoolMethodIndexAccessor{
-      public int getConstantPoolInterfaceMethodIndex();
+      int getConstantPoolInterfaceMethodIndex();
 
-      public ConstantPool.InterfaceMethodEntry getConstantPoolInterfaceMethodEntry();
+      ConstantPool.InterfaceMethodEntry getConstantPoolInterfaceMethodEntry();
 
-      public Instruction getInstanceReference();
+      Instruction getInstanceReference();
 
-      public int getArgs();
+      int getArgs();
 
-      public Instruction getArg(int _arg);
+      Instruction getArg(int _arg);
    }
 
-   public static interface New{
+   public interface New{
    }
 
    public interface FieldReference{
-      public int getConstantPoolFieldIndex();
+      int getConstantPoolFieldIndex();
 
-      public FieldEntry getConstantPoolFieldEntry();
+      FieldEntry getConstantPoolFieldEntry();
    }
 
    public interface AccessField extends FieldReference{
@@ -3753,7 +3732,7 @@ public class InstructionSet{
       int getConstantPoolIndex();
 
       ConstantPool.Entry getConstantPoolEntry();
-   };
+   }
 
    public interface HasOperator{
       Operator getOperator();
diff --git a/src/main/java/com/aparapi/internal/jni/KernelArgJNI.java b/src/main/java/com/aparapi/internal/jni/KernelArgJNI.java
index 863e89bea673b20955a35856c3c045e830e2e113..10a5504966671bf3883429d7b0076cf81e64f820 100644
--- a/src/main/java/com/aparapi/internal/jni/KernelArgJNI.java
+++ b/src/main/java/com/aparapi/internal/jni/KernelArgJNI.java
@@ -15,9 +15,9 @@
  */
 package com.aparapi.internal.jni;
 
-import com.aparapi.internal.annotation.*;
+import com.aparapi.internal.annotation.UsedByJNICode;
 
-import java.lang.reflect.*;
+import java.lang.reflect.Field;
 
 /**
  * This class is intended to be used as a 'proxy' or 'facade' object for Java code to interact with JNI
diff --git a/src/main/java/com/aparapi/internal/jni/OpenCLJNI.java b/src/main/java/com/aparapi/internal/jni/OpenCLJNI.java
index b31187e37955c6237ee7be68aa9494dc0206ead7..467f287e86e855e236ac9328f7fdeef0c9cec406 100644
--- a/src/main/java/com/aparapi/internal/jni/OpenCLJNI.java
+++ b/src/main/java/com/aparapi/internal/jni/OpenCLJNI.java
@@ -16,14 +16,10 @@
 package com.aparapi.internal.jni;
 
 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;
+import com.aparapi.internal.opencl.*;
+
+import java.util.List;
 
 /**
  * This class is intended to be used as a 'proxy' or 'facade' object for Java code to interact with JNI
diff --git a/src/main/java/com/aparapi/internal/kernel/KernelArg.java b/src/main/java/com/aparapi/internal/kernel/KernelArg.java
index d8c92ab7cc3f89bd2a320ecb6bb1e45db89227dd..aad907a1ecd4f0b9055d89237806f447c6d56cf7 100644
--- a/src/main/java/com/aparapi/internal/kernel/KernelArg.java
+++ b/src/main/java/com/aparapi/internal/kernel/KernelArg.java
@@ -15,12 +15,12 @@
  */
 package com.aparapi.internal.kernel;
 
-import com.aparapi.internal.jni.*;
-import com.aparapi.internal.model.*;
-import com.aparapi.internal.util.*;
+import com.aparapi.internal.jni.KernelArgJNI;
+import com.aparapi.internal.model.ClassModel;
+import com.aparapi.internal.util.Reflection;
 
-import java.lang.reflect.*;
-import java.nio.*;
+import java.lang.reflect.Field;
+import java.nio.ByteBuffer;
 
 /**
  * Each field (or captured field in the case of an anonymous inner class) referenced by any bytecode reachable from the users Kernel.run(), will
diff --git a/src/main/java/com/aparapi/internal/kernel/KernelDeviceProfile.java b/src/main/java/com/aparapi/internal/kernel/KernelDeviceProfile.java
index b58dd6d20897e8877e6f162ea359d19dc438b6c8..38ecc258b695a7e3dbdcfb978b1f062debfdefbb 100644
--- a/src/main/java/com/aparapi/internal/kernel/KernelDeviceProfile.java
+++ b/src/main/java/com/aparapi/internal/kernel/KernelDeviceProfile.java
@@ -15,19 +15,21 @@
  */
 package com.aparapi.internal.kernel;
 
-import com.aparapi.*;
-import com.aparapi.device.*;
+import com.aparapi.Config;
+import com.aparapi.Kernel;
+import com.aparapi.device.Device;
 
-import java.text.*;
-import java.util.*;
-import java.util.logging.*;
+import java.text.DecimalFormat;
+import java.util.Arrays;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 /**
  * Created by Barney on 02/09/2015.
  */
 public class KernelDeviceProfile {
 
-   private static Logger logger = Logger.getLogger(Config.getLoggerName());
+   private static final Logger logger = Logger.getLogger(Config.getLoggerName());
    private static final double MILLION = 1000 * 1000;
    private static final int TABLE_COLUMN_HEADER_WIDTH = 21;
    private static final int TABLE_COLUMN_COUNT_WIDTH = 8;
@@ -35,8 +37,8 @@ public class KernelDeviceProfile {
    private static String tableHeader = null;
    private final Class<? extends Kernel> kernel;
    private final Device device;
-   private long[] currentTimes = new long[ProfilingEvent.values().length];
-   private long[] accumulatedTimes = new long[ProfilingEvent.values().length];
+   private final long[] currentTimes = new long[ProfilingEvent.values().length];
+   private final long[] accumulatedTimes = new long[ProfilingEvent.values().length];
    private ProfilingEvent lastEvent = null;
    private final DecimalFormat format;
    private long invocationCount = 0;
diff --git a/src/main/java/com/aparapi/internal/kernel/KernelManager.java b/src/main/java/com/aparapi/internal/kernel/KernelManager.java
index 3ae9d30760c0bcd66dd7102bebefa19c149e4826..1ead1ecdf2f7a8a53e90ef38366affb6791e7d71 100644
--- a/src/main/java/com/aparapi/internal/kernel/KernelManager.java
+++ b/src/main/java/com/aparapi/internal/kernel/KernelManager.java
@@ -15,14 +15,6 @@
  */
 package com.aparapi.internal.kernel;
 
-import java.lang.reflect.Constructor;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.List;
-
 import com.aparapi.Config;
 import com.aparapi.Kernel;
 import com.aparapi.device.Device;
@@ -30,15 +22,18 @@ import com.aparapi.device.JavaDevice;
 import com.aparapi.device.OpenCLDevice;
 import com.aparapi.internal.util.Reflection;
 
+import java.lang.reflect.Constructor;
+import java.util.*;
+
 /**
  * Created by Barney on 24/08/2015.
  */
 public class KernelManager {
 
    private static KernelManager INSTANCE = new KernelManager();
-   private LinkedHashMap<Integer, PreferencesWrapper> preferences = new LinkedHashMap<>();
-   private LinkedHashMap<Class<? extends Kernel>, KernelProfile> profiles = new LinkedHashMap<>();
-   private LinkedHashMap<Class<? extends Kernel>, Kernel> sharedInstances = new LinkedHashMap<>();
+   private final LinkedHashMap<Integer, PreferencesWrapper> preferences = new LinkedHashMap<>();
+   private final LinkedHashMap<Class<? extends Kernel>, KernelProfile> profiles = new LinkedHashMap<>();
+   private final LinkedHashMap<Class<? extends Kernel>, Kernel> sharedInstances = new LinkedHashMap<>();
 
    private KernelPreferences defaultPreferences;
 
@@ -116,7 +111,7 @@ public class KernelManager {
             int row = 0;
             for (KernelDeviceProfile deviceProfile : profile.getDeviceProfiles()) {
                if (row == 0) {
-                  builder.append(deviceProfile.getTableHeader()).append("\n");
+                  builder.append(KernelDeviceProfile.getTableHeader()).append("\n");
                }
                builder.append(deviceProfile.getAverageAsTableRow()).append("\n");
                ++row;
diff --git a/src/main/java/com/aparapi/internal/kernel/KernelManagers.java b/src/main/java/com/aparapi/internal/kernel/KernelManagers.java
index d9767812ce42ed9632fc3debbe57f02179d52e14..0438174a2b33cf072dda7247a5e729915370dc17 100644
--- a/src/main/java/com/aparapi/internal/kernel/KernelManagers.java
+++ b/src/main/java/com/aparapi/internal/kernel/KernelManagers.java
@@ -15,9 +15,10 @@
  */
 package com.aparapi.internal.kernel;
 
-import com.aparapi.device.*;
+import com.aparapi.device.Device;
 
-import java.util.*;
+import java.util.Collections;
+import java.util.List;
 
 /**
  * KernelManager instances useful for debugging.
@@ -26,7 +27,7 @@ public class KernelManagers {
 
    public static final KernelManager JTP_ONLY = new KernelManager() {
 
-      private List<Device.TYPE> types = Collections.singletonList(Device.TYPE.JTP);
+      private final List<Device.TYPE> types = Collections.singletonList(Device.TYPE.JTP);
 
       @Override
       protected List<Device.TYPE> getPreferredDeviceTypes() {
diff --git a/src/main/java/com/aparapi/internal/kernel/KernelPreferences.java b/src/main/java/com/aparapi/internal/kernel/KernelPreferences.java
index 20d2954edd51a23293032ac7b09a709122d8ba32..3a82d67cb8ff3962de8b6844cf4ed86cacbedd5b 100644
--- a/src/main/java/com/aparapi/internal/kernel/KernelPreferences.java
+++ b/src/main/java/com/aparapi/internal/kernel/KernelPreferences.java
@@ -15,15 +15,16 @@
  */
 package com.aparapi.internal.kernel;
 
-import com.aparapi.*;
-import com.aparapi.device.*;
+import com.aparapi.Kernel;
+import com.aparapi.device.Device;
 
 import java.util.*;
+import java.util.concurrent.CopyOnWriteArrayList;
 
 public class KernelPreferences {
    private final Class<? extends Kernel> kernelClass;
    private final KernelManager manager;
-   private volatile LinkedList<Device> preferredDevices = null;
+   private final List<Device> preferredDevices = new CopyOnWriteArrayList<>();
    private final LinkedHashSet<Device> failedDevices = new LinkedHashSet<>();
 
    public KernelPreferences(KernelManager manager, Class<? extends Kernel> kernelClass) {
@@ -55,14 +56,14 @@ public class KernelPreferences {
       return Collections.unmodifiableList(localPreferredDevices);
    }
 
-   synchronized void setPreferredDevices(LinkedHashSet<Device> _preferredDevices) {
-      if (preferredDevices != null) {
+   synchronized void setPreferredDevices(Collection<Device> _preferredDevices) {
+      //if (preferredDevices != null) {
          preferredDevices.clear();
          preferredDevices.addAll(_preferredDevices);
-      }
+      /*}
       else {
          preferredDevices = new LinkedList<>(_preferredDevices);
-      }
+      }*/
       failedDevices.clear();
    }
 
@@ -78,16 +79,13 @@ public class KernelPreferences {
    }
 
    private void maybeSetUpDefaultPreferredDevices() {
-      if (preferredDevices == null) {
-         synchronized (this) {
-            if (preferredDevices == null) {
-               preferredDevices = new LinkedList<>(manager.getDefaultPreferences().getPreferredDevices(null));
-            }
-         }
+      synchronized (this) {
+         if (preferredDevices.isEmpty())
+            setPreferredDevices(manager.getDefaultPreferences().getPreferredDevices(null));
       }
    }
 
-   public List<Device> getFailedDevices() {
+   List<Device> getFailedDevices() {
       return new ArrayList<>(failedDevices);
    }
 }
diff --git a/src/main/java/com/aparapi/internal/kernel/KernelProfile.java b/src/main/java/com/aparapi/internal/kernel/KernelProfile.java
index b4d70681db1368c169fd4644778fbb78aa308a25..d60eb758d4da2bee175755a375d4a4ede3df72df 100644
--- a/src/main/java/com/aparapi/internal/kernel/KernelProfile.java
+++ b/src/main/java/com/aparapi/internal/kernel/KernelProfile.java
@@ -15,11 +15,14 @@
  */
 package com.aparapi.internal.kernel;
 
-import com.aparapi.*;
-import com.aparapi.device.*;
+import com.aparapi.Config;
+import com.aparapi.Kernel;
+import com.aparapi.device.Device;
 
-import java.util.*;
-import java.util.logging.*;
+import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 /**
  * Collects profiling information per kernel class per device. Not thread safe, it is necessary for client code to correctly synchronize on
@@ -28,9 +31,9 @@ import java.util.logging.*;
 public class KernelProfile {
 
    private static final double MILLION = 1000000d;
-   private static Logger logger = Logger.getLogger(Config.getLoggerName());
+   private static final Logger logger = Logger.getLogger(Config.getLoggerName());
    private final Class<? extends Kernel> kernelClass;
-   private LinkedHashMap<Device, KernelDeviceProfile> deviceProfiles = new LinkedHashMap<>();
+   private final LinkedHashMap<Device, KernelDeviceProfile> deviceProfiles = new LinkedHashMap<>();
    private Device currentDevice;
    private Device lastDevice;
    private KernelDeviceProfile currentDeviceProfile;
diff --git a/src/main/java/com/aparapi/internal/kernel/KernelRunner.java b/src/main/java/com/aparapi/internal/kernel/KernelRunner.java
index 66d34cf6db5724e632d05e94e69ddf7ef513f31d..bc35600e515dfda1b148299d53cff9abd187bca8 100644
--- a/src/main/java/com/aparapi/internal/kernel/KernelRunner.java
+++ b/src/main/java/com/aparapi/internal/kernel/KernelRunner.java
@@ -52,25 +52,43 @@ under those regulations, please refer to the U.S. Bureau of Industry and Securit
 */
 package com.aparapi.internal.kernel;
 
-import com.aparapi.*;
+import com.aparapi.Config;
+import com.aparapi.Kernel;
 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.*;
+import com.aparapi.Kernel.EXECUTION_MODE;
+import com.aparapi.Kernel.KernelState;
+import com.aparapi.Kernel.Local;
+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.TypeSpec;
+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 java.lang.reflect.Array;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.IntBuffer;
 import java.util.*;
-import java.util.concurrent.*;
-import java.util.concurrent.ForkJoinPool.*;
-import java.util.logging.*;
+import java.util.concurrent.BrokenBarrierException;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.ForkJoinPool;
+import java.util.concurrent.ForkJoinPool.ForkJoinWorkerThreadFactory;
+import java.util.concurrent.ForkJoinPool.ManagedBlocker;
+import java.util.concurrent.ForkJoinWorkerThread;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 /**
  * The class is responsible for executing <code>Kernel</code> implementations. <br/>
@@ -90,7 +108,7 @@ import java.util.logging.*;
  */
 public class KernelRunner extends KernelRunnerJNI{
 
-   public static boolean BINARY_CACHING_DISABLED = false;
+   public static final boolean BINARY_CACHING_DISABLED = false;
 
    private static final int MINIMUM_ARRAY_SIZE = 1;
 
@@ -102,7 +120,7 @@ public class KernelRunner extends KernelRunnerJNI{
    @UsedByJNICode public static final int CANCEL_STATUS_TRUE = 1;
    private static final String CODE_GEN_ERROR_MARKER = CodeGenException.class.getName();
 
-   private static Logger logger = Logger.getLogger(Config.getLoggerName());
+   private static final Logger logger = Logger.getLogger(Config.getLoggerName());
 
    private long jniContextHandle = 0;
 
@@ -147,8 +165,8 @@ public class KernelRunner extends KernelRunnerJNI{
 
    private static final ForkJoinPool threadPool = new ForkJoinPool(Runtime.getRuntime().availableProcessors(),
          lowPriorityThreadFactory, null, false);
-   private static HashMap<Class<? extends Kernel>, String> openCLCache = new HashMap<>();
-   private static LinkedHashSet<String> seenBinaryKeys = new LinkedHashSet<>();
+   private static final HashMap<Class<? extends Kernel>, String> openCLCache = new HashMap<>();
+   private static final LinkedHashSet<String> seenBinaryKeys = new LinkedHashSet<>();
 
    /**
     * Create a KernelRunner for a specific Kernel instance.
@@ -362,7 +380,7 @@ public class KernelRunner extends KernelRunnerJNI{
                }
             } else {
                boolean silently = true; // not having an alternative algorithm is the normal state, and does not need reporting
-               fallBackToNextDevice(_settings, (Exception) null, silently);
+               fallBackToNextDevice(_settings, null, silently);
             }
          } else {
             final int localSize0 = _settings.range.getLocalSize(0);
@@ -678,10 +696,7 @@ public class KernelRunner extends KernelRunnerJNI{
    private static void await(CyclicBarrier _barrier) {
       try {
          _barrier.await();
-      } catch (final InterruptedException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final BrokenBarrierException e) {
+      } catch (final InterruptedException | BrokenBarrierException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
       }
@@ -902,7 +917,7 @@ public class KernelRunner extends KernelRunnerJNI{
                   if (logger.isLoggable(Level.FINEST)) {
                      logger.finest("fType = " + t.getShortName() + " x= " + x);
                   }
-                  UnsafeWrapper.putBoolean(object, offset, (x == 1 ? true : false));
+                  UnsafeWrapper.putBoolean(object, offset, (x == 1));
                   // Booleans converted to 1 byte C chars for open cl
                   sizeWritten += TypeSpec.B.getSize();
                   break;
@@ -1031,9 +1046,7 @@ public class KernelRunner extends KernelRunnerJNI{
                arg.setSizeInBytes(totalElements * primitiveSize);
                arg.setArray(buffer);
             }
-         } catch (final IllegalArgumentException e) {
-            e.printStackTrace();
-         } catch (final IllegalAccessException e) {
+         } catch (final IllegalArgumentException | IllegalAccessException e) {
             e.printStackTrace();
          }
       }
@@ -1164,6 +1177,7 @@ public class KernelRunner extends KernelRunnerJNI{
          boolean legacyExecutionMode = kernel.getExecutionMode() != Kernel.EXECUTION_MODE.AUTO;
 
          ExecutionSettings settings = new ExecutionSettings(preferences, profile, _entrypoint, _range, _passes, legacyExecutionMode);
+
          // Two Kernels of the same class share the same KernelPreferences object, and since failure (fallback) generally mutates
          // the preferences object, we must lock it. Note this prevents two Kernels of the same class executing simultaneously.
          synchronized (preferences) {
@@ -1296,7 +1310,7 @@ public class KernelRunner extends KernelRunnerJNI{
                   }
 
                   final String extensions = getExtensionsJNI(jniContextHandle);
-                  capabilitiesSet = new HashSet<String>();
+                  capabilitiesSet = new HashSet<>();
 
                   final StringTokenizer strTok = new StringTokenizer(extensions);
                   while (strTok.hasMoreTokens()) {
@@ -1526,7 +1540,7 @@ public class KernelRunner extends KernelRunnerJNI{
             if (!(device instanceof JavaDevice)) {
                fallBackToNextDevice(_settings, "Non-OpenCL Kernel.EXECUTION_MODE requested but device is not a JavaDevice ");
             }
-            executeJava(_settings, (JavaDevice) device);
+            executeJava(_settings, device);
          }
 
          if (Config.enableExecutionModeReporting) {
@@ -1691,7 +1705,7 @@ public class KernelRunner extends KernelRunnerJNI{
       }
    }
 
-   private final Set<Object> puts = new HashSet<Object>();
+   private final Set<Object> puts = new HashSet<>();
 
    /**
     * Enqueue a request to return this array from the GPU. This method blocks until the array is available.
diff --git a/src/main/java/com/aparapi/internal/kernel/PreferencesWrapper.java b/src/main/java/com/aparapi/internal/kernel/PreferencesWrapper.java
index ba8bb0d4ebd2c73f6890adee7344c1617c844c99..9354ee4a0150cf800d5e2d5e0449b5f5d4808cfb 100644
--- a/src/main/java/com/aparapi/internal/kernel/PreferencesWrapper.java
+++ b/src/main/java/com/aparapi/internal/kernel/PreferencesWrapper.java
@@ -19,8 +19,8 @@ import com.aparapi.Kernel;
 
 public class PreferencesWrapper {
 
-  private Class<? extends Kernel> klass;
-  private KernelPreferences preferences;
+  private final Class<? extends Kernel> klass;
+  private final KernelPreferences preferences;
 
   public PreferencesWrapper(Class<? extends Kernel> klass, KernelPreferences preferences) {
     super();
diff --git a/src/main/java/com/aparapi/internal/model/ClassModel.java b/src/main/java/com/aparapi/internal/model/ClassModel.java
index e0ce45d0386d52fa12a77b2d1a6e4ace622a0866..6f13d2b699d64cd8969ff360fd1a4a0d2d9e3183 100644
--- a/src/main/java/com/aparapi/internal/model/ClassModel.java
+++ b/src/main/java/com/aparapi/internal/model/ClassModel.java
@@ -52,20 +52,28 @@ under those regulations, please refer to the U.S. Bureau of Industry and Securit
 */
 package com.aparapi.internal.model;
 
-import com.aparapi.*;
-import com.aparapi.internal.annotation.*;
-import com.aparapi.internal.exception.*;
-import com.aparapi.internal.instruction.InstructionSet.*;
+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.TypeSpec;
+import com.aparapi.internal.model.ClassModel.AttributePool.CodeEntry;
+import com.aparapi.internal.model.ClassModel.ConstantPool.FieldEntry;
+import com.aparapi.internal.model.ClassModel.ConstantPool.MethodEntry;
+import com.aparapi.internal.model.ClassModel.ConstantPool.NameAndTypeEntry;
+import com.aparapi.internal.model.ClassModel.ConstantPool.UTF8Entry;
 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 com.aparapi.internal.reader.ByteReader;
+import com.aparapi.internal.util.Reflection;
 
-import java.io.*;
-import java.lang.reflect.*;
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
 import java.util.*;
-import java.util.logging.*;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 /**
  * Class represents a ClassFile (MyClass.class).
@@ -135,7 +143,7 @@ public class ClassModel {
 
    public static final char SIGC_PACKAGE = '/';
 
-   private static Logger logger = Logger.getLogger(Config.getLoggerName());
+   private static final Logger logger = Logger.getLogger(Config.getLoggerName());
 
    private ClassModel superClazz = null;
 
@@ -148,7 +156,7 @@ public class ClassModel {
    });
 
    //   private Memoizer<Map<String, Kernel.PrivateMemorySpace>> privateMemoryFields = Memoizer.of(this::computePrivateMemoryFields);
-   private Memoizer<Map<String, Kernel.PrivateMemorySpace>> privateMemoryFields = Memoizer.Impl
+   private final Memoizer<Map<String, Kernel.PrivateMemorySpace>> privateMemoryFields = Memoizer.Impl
          .of(new Supplier<Map<String, Kernel.PrivateMemorySpace>>(){
             @Override
             public Map<String, Kernel.PrivateMemorySpace> get() {
@@ -158,7 +166,7 @@ public class ClassModel {
 
    //   private ValueCache<String, Integer, ClassParseException> privateMemorySizes = ValueCache.on(this::computePrivateMemorySize);
 
-   private ValueCache<String, Integer, ClassParseException> privateMemorySizes = ValueCache
+   private final ValueCache<String, Integer, ClassParseException> privateMemorySizes = ValueCache
          .on(new ThrowingValueComputer<String, Integer, ClassParseException>(){
             @Override
             public Integer compute(String fieldName) throws ClassParseException {
@@ -190,13 +198,13 @@ public class ClassModel {
       }
    }
 
-   ClassModel(InputStream _inputStream) throws ClassParseException {
+   ClassModel(InputStream _inputStream) {
 
       parse(_inputStream);
 
    }
 
-   ClassModel(Class<?> _clazz, byte[] _bytes) throws ClassParseException {
+   ClassModel(Class<?> _clazz, byte[] _bytes) {
       clazz = _clazz;
       parse(new ByteArrayInputStream(_bytes));
    }
@@ -208,13 +216,9 @@ public class ClassModel {
     * @return true if 'this' a superclass of another named class 
     */
    public boolean isSuperClass(String otherClassName) {
-      if (getClassWeAreModelling().getName().equals(otherClassName)) {
-         return true;
-      } else if (superClazz != null) {
-         return superClazz.isSuperClass(otherClassName);
-      } else {
-         return false;
-      }
+      return getClassWeAreModelling().getName().equals(otherClassName)
+              || ((superClazz != null)
+              && (superClazz.isSuperClass(otherClassName)));
    }
 
    /**
@@ -314,8 +318,8 @@ public class ClassModel {
    }
 
    private Map<String, Kernel.PrivateMemorySpace> computePrivateMemoryFields() {
-      Map<String, Kernel.PrivateMemorySpace> tempPrivateMemoryFields = new HashMap<String, Kernel.PrivateMemorySpace>();
-      Map<Field, Kernel.PrivateMemorySpace> privateMemoryFields = new HashMap<Field, Kernel.PrivateMemorySpace>();
+      Map<String, Kernel.PrivateMemorySpace> tempPrivateMemoryFields = new HashMap<>();
+      Map<Field, Kernel.PrivateMemorySpace> privateMemoryFields = new HashMap<>();
       for (Field field : getClassWeAreModelling().getDeclaredFields()) {
          Kernel.PrivateMemorySpace privateMemorySpace = field.getAnnotation(Kernel.PrivateMemorySpace.class);
          if (privateMemorySpace != null) {
@@ -348,7 +352,7 @@ public class ClassModel {
          int lastDollar = fieldName.lastIndexOf('$');
          String sizeText = fieldName.substring(lastDollar + 1);
          try {
-            return new Integer(Integer.parseInt(sizeText));
+            return Integer.parseInt(sizeText);
          } catch (NumberFormatException e) {
             throw new ClassParseException(ClassParseException.TYPE.IMPROPERPRIVATENAMEMANGLING, fieldName);
          }
@@ -361,8 +365,8 @@ public class ClassModel {
    }
 
    private Set<String> computeNoCLMethods() {
-      Set<String> tempNoClMethods = new HashSet<String>();
-      HashSet<Method> methods = new HashSet<Method>();
+      Set<String> tempNoClMethods = new HashSet<>();
+      HashSet<Method> methods = new HashSet<>();
       for (Method method : getClassWeAreModelling().getDeclaredMethods()) {
          if (method.getAnnotation(Kernel.NoCL.class) != null) {
             methods.add(method);
@@ -388,7 +392,7 @@ public class ClassModel {
    }
 
    public static String convert(String _string, String _insert, boolean _showFullClassName) {
-      Stack<String> stringStack = new Stack<String>();
+      Stack<String> stringStack = new Stack<>();
       Stack<String> methodStack = null;
       final int length = _string.length();
       final char[] chars = _string.toCharArray();
@@ -490,7 +494,7 @@ public class ClassModel {
                inArgs = false;
                stringStack.push(")");
                methodStack = stringStack;
-               stringStack = new Stack<String>();
+               stringStack = new Stack<>();
                i++; // step over this
             }
                break;
@@ -567,7 +571,7 @@ public class ClassModel {
          methodName = _string.substring(dotIndex + 1, parenIndex);
       }
 
-      Stack<String> stringStack = new Stack<String>();
+      Stack<String> stringStack = new Stack<>();
       Stack<String> methodStack = null;
       final int length = descriptor.length();
       final char[] chars = new char[descriptor.length()];
@@ -634,7 +638,7 @@ public class ClassModel {
                inMethod = true;
                inArray = false;
                methodStack = stringStack;
-               stringStack = new Stack<String>();
+               stringStack = new Stack<>();
                i++; // step over this
             }
                break;
@@ -651,25 +655,21 @@ public class ClassModel {
       return (methodDescription);
    }
 
-   private static final ValueCache<Class<?>, ClassModel, ClassParseException> classModelCache = ValueCache
-         .on(new ThrowingValueComputer<Class<?>, ClassModel, ClassParseException>(){
+   private static final ValueCache<Class<?>, ClassModel, ClassParseException>
+           classModelCache = ValueCache.on(new ThrowingValueComputer<Class<?>, ClassModel, ClassParseException>(){
             @Override
             public ClassModel compute(Class<?> key) throws ClassParseException {
-               return createClassModelInternal(key);
+               ClassModel classModel = new ClassModel(key);
+               return classModel;
             }
          });
 
-   private static ClassModel createClassModelInternal(Class<?> key) throws ClassParseException {
-      ClassModel classModel = new ClassModel(key);
-      return classModel;
-   }
-
    public static ClassModel createClassModel(Class<?> _class) throws ClassParseException {
       if (CacheEnabler.areCachesEnabled()) {
          return classModelCache.computeIfAbsent(_class);
       }
 
-      return createClassModelInternal(_class);
+      return new ClassModel(_class);
    }
 
    private int magic;
@@ -686,11 +686,11 @@ public class ClassModel {
 
    private int superClassConstantPoolIndex;
 
-   private final List<ClassModelInterface> interfaces = new ArrayList<ClassModelInterface>();
+   private final List<ClassModelInterface> interfaces = new ArrayList<>();
 
-   private final List<ClassModelField> fields = new ArrayList<ClassModelField>();
+   private final List<ClassModelField> fields = new ArrayList<>();
 
-   private final List<ClassModelMethod> methods = new ArrayList<ClassModelMethod>();
+   private final List<ClassModelMethod> methods = new ArrayList<>();
 
    private AttributePool attributePool;
 
@@ -714,7 +714,7 @@ public class ClassModel {
       METHODTYPE, //16
       UNUSED17,
       INVOKEDYNAMIC//18
-   };
+   }
 
    public enum Access {
       PUBLIC(0x00000001),
@@ -734,9 +734,9 @@ public class ClassModel {
       STRICT(0x00000800),
       ANNOTATION(0x00002000),
       ACC_ENUM(0x00004000);
-      int bits;
+      final int bits;
 
-      private Access(int _bits) {
+      Access(int _bits) {
          bits = _bits;
       }
 
@@ -745,10 +745,10 @@ public class ClassModel {
       }
 
       public String convert(int _accessFlags) {
-         final StringBuffer stringBuffer = new StringBuffer();
+         final StringBuilder stringBuffer = new StringBuilder();
          for (final Access access : Access.values()) {
             if (access.bitIsSet(_accessFlags)) {
-               stringBuffer.append(" " + access.name().toLowerCase());
+               stringBuffer.append(" ").append(access.name().toLowerCase());
             }
          }
 
@@ -756,17 +756,17 @@ public class ClassModel {
       }
    }
 
-   private static enum SignatureParseState {
+   private enum SignatureParseState {
       skipping,
       counting,
       inclass,
       inArray,
-      done;
-   };
+      done
+   }
 
    public class ConstantPool implements Iterable<ConstantPool.Entry>{
 
-      private final List<Entry> entries = new ArrayList<Entry>();
+      private final List<Entry> entries = new ArrayList<>();
 
       public abstract class Entry {
          private final ConstantPoolType constantPoolType;
@@ -923,7 +923,7 @@ public class ClassModel {
       }
 
       class MethodTypeEntry extends Entry{
-         private int descriptorIndex;
+         private final int descriptorIndex;
 
          MethodTypeEntry(ByteReader _byteReader, int _slot) {
             super(_byteReader, _slot, ConstantPoolType.METHODTYPE);
@@ -943,9 +943,9 @@ public class ClassModel {
       class MethodHandleEntry extends Entry{
          // http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.4
 
-         private int referenceKind;
+         private final int referenceKind;
 
-         private int referenceIndex;
+         private final int referenceIndex;
 
          MethodHandleEntry(ByteReader _byteReader, int _slot) {
             super(_byteReader, _slot, ConstantPoolType.METHODHANDLE);
@@ -966,9 +966,9 @@ public class ClassModel {
       class InvokeDynamicEntry extends Entry{
          // http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.4
 
-         private int bootstrapMethodAttrIndex;
+         private final int bootstrapMethodAttrIndex;
 
-         private int nameAndTypeIndex;
+         private final int nameAndTypeIndex;
 
          InvokeDynamicEntry(ByteReader _byteReader, int _slot) {
             super(_byteReader, _slot, ConstantPoolType.INVOKEDYNAMIC);
@@ -1043,7 +1043,7 @@ public class ClassModel {
 
          public Arg[] getArgs() {
             if ((args == null) || (returnType == null)) {
-               final List<Arg> argList = new ArrayList<Arg>();
+               final List<Arg> argList = new ArrayList<>();
                final NameAndTypeEntry nameAndTypeEntry = getNameAndTypeEntry();
 
                final String signature = nameAndTypeEntry.getDescriptorUTF8Entry().getUTF8();// "([[IF)V" for a method that takes an int[][], float and returns void.
@@ -1121,9 +1121,9 @@ public class ClassModel {
       }
 
       public abstract class ReferenceEntry extends Entry{
-         protected int referenceClassIndex;
+         protected final int referenceClassIndex;
 
-         protected int nameAndTypeIndex;
+         protected final int nameAndTypeIndex;
 
          protected int argCount = -1;
 
@@ -1397,7 +1397,6 @@ public class ClassModel {
       public String getDescription(ConstantPool.Entry _entry) {
          final StringBuilder sb = new StringBuilder();
          if (_entry instanceof ConstantPool.EmptyEntry) {
-            ;
          } else if (_entry instanceof ConstantPool.DoubleEntry) {
             final ConstantPool.DoubleEntry doubleEntry = (ConstantPool.DoubleEntry) _entry;
             sb.append(doubleEntry.getDoubleValue());
@@ -1425,7 +1424,7 @@ public class ClassModel {
             final ConstantPool.NameAndTypeEntry nameAndTypeEntry = (ConstantPool.NameAndTypeEntry) _entry;
             final ConstantPool.UTF8Entry utf8NameEntry = (ConstantPool.UTF8Entry) get(nameAndTypeEntry.getNameIndex());
             final ConstantPool.UTF8Entry utf8DescriptorEntry = (ConstantPool.UTF8Entry) get(nameAndTypeEntry.getDescriptorIndex());
-            sb.append(utf8NameEntry.getUTF8() + "." + utf8DescriptorEntry.getUTF8());
+            sb.append(utf8NameEntry.getUTF8()).append(".").append(utf8DescriptorEntry.getUTF8());
          } else if (_entry instanceof ConstantPool.MethodEntry) {
             final ConstantPool.MethodEntry methodEntry = (ConstantPool.MethodEntry) _entry;
             final ConstantPool.ClassEntry classEntry = (ConstantPool.ClassEntry) get(methodEntry.getClassIndex());
@@ -1526,7 +1525,7 @@ public class ClassModel {
       }
 
       public String getType(ConstantPool.Entry _entry) {
-         final StringBuffer sb = new StringBuffer();
+         final StringBuilder sb = new StringBuilder();
          if (_entry instanceof ConstantPool.EmptyEntry) {
             sb.append("empty");
          } else if (_entry instanceof ConstantPool.DoubleEntry) {
@@ -1582,7 +1581,7 @@ public class ClassModel {
    }
 
    public class AttributePool {
-      private final List<AttributePoolEntry> attributePoolEntries = new ArrayList<AttributePoolEntry>();
+      private final List<AttributePoolEntry> attributePoolEntries = new ArrayList<>();
 
       public class CodeEntry extends AttributePoolEntry{
 
@@ -1623,7 +1622,7 @@ public class ClassModel {
             }
          }
 
-         private final List<ExceptionPoolEntry> exceptionPoolEntries = new ArrayList<ExceptionPoolEntry>();
+         private final List<ExceptionPoolEntry> exceptionPoolEntries = new ArrayList<>();
 
          private final AttributePool codeEntryAttributePool;
 
@@ -1695,9 +1694,9 @@ public class ClassModel {
       }
 
       public abstract class AttributePoolEntry {
-         protected int length;
+         protected final int length;
 
-         protected int nameIndex;
+         protected final int nameIndex;
 
          public AttributePoolEntry(ByteReader _byteReader, int _nameIndex, int _length) {
             nameIndex = _nameIndex;
@@ -1722,7 +1721,7 @@ public class ClassModel {
       }
 
       public abstract class PoolEntry<T> extends AttributePoolEntry implements Iterable<T>{
-         private final List<T> pool = new ArrayList<T>();
+         private final List<T> pool = new ArrayList<>();
 
          public List<T> getPool() {
             return (pool);
@@ -1976,7 +1975,7 @@ public class ClassModel {
 
          public String getVariableName(int _pc, int _index) {
             String returnValue = "unknown";
-            final RealLocalVariableInfo localVariableInfo = (RealLocalVariableInfo) getVariable(_pc, _index);
+            final RealLocalVariableInfo localVariableInfo = getVariable(_pc, _index);
             if (localVariableInfo != null) {
                returnValue = convert(constantPool.getUTF8Entry(localVariableInfo.getDescriptorIndex()).getUTF8(), constantPool
                      .getUTF8Entry(localVariableInfo.getNameIndex()).getUTF8());
@@ -1994,7 +1993,7 @@ public class ClassModel {
                   argument = _byteReader.u2();
                }
 
-               int argument;// u2;
+               final int argument;// u2;
             }
 
             public BootstrapMethod(ByteReader _byteReader) {
@@ -2006,11 +2005,11 @@ public class ClassModel {
                }
             }
 
-            int bootstrapMethodRef; //u2
+            final int bootstrapMethodRef; //u2
 
-            int numBootstrapArguments; //u2
+            final int numBootstrapArguments; //u2
 
-            BootstrapArgument bootstrapArguments[];
+            final BootstrapArgument[] bootstrapArguments;
          }
 
          BootstrapMethodsEntry(ByteReader _byteReader, int _nameIndex, int _length) {
@@ -2022,9 +2021,9 @@ public class ClassModel {
             }
          }
 
-         private int numBootstrapMethods;
+         private final int numBootstrapMethods;
 
-         BootstrapMethod bootstrapMethods[];
+         final BootstrapMethod[] bootstrapMethods;
 
          int getNumBootstrapMethods() {
             return (numBootstrapMethods);
@@ -2052,7 +2051,7 @@ public class ClassModel {
       }
 
       class StackMapTableEntry extends AttributePoolEntry{
-         private byte[] bytes;
+         private final byte[] bytes;
 
          StackMapTableEntry(ByteReader _byteReader, int _nameIndex, int _length) {
             super(_byteReader, _nameIndex, _length);
@@ -2070,7 +2069,7 @@ public class ClassModel {
       }
 
       public class LocalVariableTypeTableEntry extends AttributePoolEntry{
-         private byte[] bytes;
+         private final byte[] bytes;
 
          public LocalVariableTypeTableEntry(ByteReader _byteReader, int _nameIndex, int _length) {
             super(_byteReader, _nameIndex, _length);
@@ -2123,7 +2122,7 @@ public class ClassModel {
                      tag = _tag;
                   }
 
-                  int tag;
+                  final int tag;
 
                }
 
@@ -2305,56 +2304,74 @@ public class ClassModel {
                throw new IllegalStateException("corrupted state reading attributes for " + name);
             }
             final String attributeName = utf8Entry.getUTF8();
-            if (attributeName.equals(LOCALVARIABLETABLE_TAG)) {
-               localVariableTableEntry = new RealLocalVariableTableEntry(_byteReader, attributeNameIndex, length);
-               entry = (RealLocalVariableTableEntry) localVariableTableEntry;
-            } else if (attributeName.equals(CONSTANTVALUE_TAG)) {
-               entry = new ConstantValueEntry(_byteReader, attributeNameIndex, length);
-            } else if (attributeName.equals(LINENUMBERTABLE_TAG)) {
-               lineNumberTableEntry = new LineNumberTableEntry(_byteReader, attributeNameIndex, length);
-               entry = lineNumberTableEntry;
-            } else if (attributeName.equals(SOURCEFILE_TAG)) {
-               sourceFileEntry = new SourceFileEntry(_byteReader, attributeNameIndex, length);
-               entry = sourceFileEntry;
-            } else if (attributeName.equals(SYNTHETIC_TAG)) {
-               syntheticEntry = new SyntheticEntry(_byteReader, attributeNameIndex, length);
-               entry = syntheticEntry;
-            } else if (attributeName.equals(EXCEPTIONS_TAG)) {
-               exceptionEntry = new ExceptionEntry(_byteReader, attributeNameIndex, length);
-               entry = exceptionEntry;
-            } else if (attributeName.equals(INNERCLASSES_TAG)) {
-               entry = new InnerClassesEntry(_byteReader, attributeNameIndex, length);
-            } else if (attributeName.equals(DEPRECATED_TAG)) {
-               deprecatedEntry = new DeprecatedEntry(_byteReader, attributeNameIndex, length);
-               entry = deprecatedEntry;
-            } else if (attributeName.equals(CODE_TAG)) {
-               codeEntry = new CodeEntry(_byteReader, attributeNameIndex, length);
-               entry = codeEntry;
-            } else if (attributeName.equals(ENCLOSINGMETHOD_TAG)) {
-               enclosingMethodEntry = new EnclosingMethodEntry(_byteReader, attributeNameIndex, length);
-               entry = enclosingMethodEntry;
-            } else if (attributeName.equals(SIGNATURE_TAG)) {
-               entry = new SignatureEntry(_byteReader, attributeNameIndex, length);
-            } else if (attributeName.equals(RUNTIMEINVISIBLEANNOTATIONS_TAG)) {
-               runtimeInvisibleAnnotationsEntry = new RuntimeAnnotationsEntry(_byteReader, attributeNameIndex, length);
-               entry = runtimeInvisibleAnnotationsEntry;
-            } else if (attributeName.equals(RUNTIMEVISIBLEANNOTATIONS_TAG)) {
-               runtimeVisibleAnnotationsEntry = new RuntimeAnnotationsEntry(_byteReader, attributeNameIndex, length);
-               entry = runtimeVisibleAnnotationsEntry;
-            } else if (attributeName.equals(BOOTSTRAPMETHODS_TAG)) {
-               bootstrapMethodsEntry = new BootstrapMethodsEntry(_byteReader, attributeNameIndex, length);
-               entry = bootstrapMethodsEntry;
-               // http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.7.21
-            } else if (attributeName.equals(STACKMAPTABLE_TAG)) {
-               // http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.7.4
-
-               entry = new StackMapTableEntry(_byteReader, attributeNameIndex, length);
-            } else if (attributeName.equals(LOCALVARIABLETYPETABLE_TAG)) {
-               // http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.7.14
-               entry = new LocalVariableTypeTableEntry(_byteReader, attributeNameIndex, length);
-            } else {
-               logger.warning("Found unexpected Attribute (name = " + attributeName + ")");
-               entry = new OtherEntry(_byteReader, attributeNameIndex, length);
+            switch (attributeName) {
+               case LOCALVARIABLETABLE_TAG:
+                  localVariableTableEntry = new RealLocalVariableTableEntry(_byteReader, attributeNameIndex, length);
+                  entry = (RealLocalVariableTableEntry) localVariableTableEntry;
+                  break;
+               case CONSTANTVALUE_TAG:
+                  entry = new ConstantValueEntry(_byteReader, attributeNameIndex, length);
+                  break;
+               case LINENUMBERTABLE_TAG:
+                  lineNumberTableEntry = new LineNumberTableEntry(_byteReader, attributeNameIndex, length);
+                  entry = lineNumberTableEntry;
+                  break;
+               case SOURCEFILE_TAG:
+                  sourceFileEntry = new SourceFileEntry(_byteReader, attributeNameIndex, length);
+                  entry = sourceFileEntry;
+                  break;
+               case SYNTHETIC_TAG:
+                  syntheticEntry = new SyntheticEntry(_byteReader, attributeNameIndex, length);
+                  entry = syntheticEntry;
+                  break;
+               case EXCEPTIONS_TAG:
+                  exceptionEntry = new ExceptionEntry(_byteReader, attributeNameIndex, length);
+                  entry = exceptionEntry;
+                  break;
+               case INNERCLASSES_TAG:
+                  entry = new InnerClassesEntry(_byteReader, attributeNameIndex, length);
+                  break;
+               case DEPRECATED_TAG:
+                  deprecatedEntry = new DeprecatedEntry(_byteReader, attributeNameIndex, length);
+                  entry = deprecatedEntry;
+                  break;
+               case CODE_TAG:
+                  codeEntry = new CodeEntry(_byteReader, attributeNameIndex, length);
+                  entry = codeEntry;
+                  break;
+               case ENCLOSINGMETHOD_TAG:
+                  enclosingMethodEntry = new EnclosingMethodEntry(_byteReader, attributeNameIndex, length);
+                  entry = enclosingMethodEntry;
+                  break;
+               case SIGNATURE_TAG:
+                  entry = new SignatureEntry(_byteReader, attributeNameIndex, length);
+                  break;
+               case RUNTIMEINVISIBLEANNOTATIONS_TAG:
+                  runtimeInvisibleAnnotationsEntry = new RuntimeAnnotationsEntry(_byteReader, attributeNameIndex, length);
+                  entry = runtimeInvisibleAnnotationsEntry;
+                  break;
+               case RUNTIMEVISIBLEANNOTATIONS_TAG:
+                  runtimeVisibleAnnotationsEntry = new RuntimeAnnotationsEntry(_byteReader, attributeNameIndex, length);
+                  entry = runtimeVisibleAnnotationsEntry;
+                  break;
+               case BOOTSTRAPMETHODS_TAG:
+                  bootstrapMethodsEntry = new BootstrapMethodsEntry(_byteReader, attributeNameIndex, length);
+                  entry = bootstrapMethodsEntry;
+                  // http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.7.21
+                  break;
+               case STACKMAPTABLE_TAG:
+                  // http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.7.4
+
+                  entry = new StackMapTableEntry(_byteReader, attributeNameIndex, length);
+                  break;
+               case LOCALVARIABLETYPETABLE_TAG:
+                  // http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.7.14
+                  entry = new LocalVariableTypeTableEntry(_byteReader, attributeNameIndex, length);
+                  break;
+               default:
+                  logger.warning("Found unexpected Attribute (name = " + attributeName + ")");
+                  entry = new OtherEntry(_byteReader, attributeNameIndex, length);
+                  break;
             }
             attributePoolEntries.add(entry);
 
@@ -2403,12 +2420,12 @@ public class ClassModel {
 
    }
 
-   private static ClassLoader classModelLoader = ClassModel.class.getClassLoader();
+   private static final ClassLoader classModelLoader = ClassModel.class.getClassLoader();
 
    public class ClassModelField {
       private final int fieldAccessFlags;
 
-      AttributePool fieldAttributePool;
+      final AttributePool fieldAttributePool;
 
       private final int descriptorIndex;
 
@@ -2617,12 +2634,12 @@ public class ClassModel {
     * @param _className The name of the class to load (we convert '.' to '/' and append ".class" so you don't have to).
     * @throws ClassParseException
     */
-   private void parse(ClassLoader _classLoader, String _className) throws ClassParseException {
+   private void parse(ClassLoader _classLoader, String _className) {
 
       parse(_classLoader.getResourceAsStream(_className.replace('.', '/') + ".class"));
    }
 
-   void parse(InputStream _inputStream) throws ClassParseException {
+   void parse(InputStream _inputStream) {
 
       ByteReader byteReader = new ByteReader(_inputStream);
       magic = byteReader.u4();
@@ -2758,7 +2775,7 @@ public class ClassModel {
    }
 
    //   private ValueCache<MethodKey, MethodModel, AparapiException> methodModelCache = ValueCache.on(this::computeMethodModel);
-   private ValueCache<MethodKey, MethodModel, AparapiException> methodModelCache = ValueCache
+   private final ValueCache<MethodKey, MethodModel, AparapiException> methodModelCache = ValueCache
          .on(new ThrowingValueComputer<MethodKey, MethodModel, AparapiException>(){
             @Override public MethodModel compute(MethodKey key) throws AparapiException {
                return computeMethodModel(key);
@@ -2788,11 +2805,11 @@ public class ClassModel {
    }
 
    // These fields use for accessor conversion
-   private final ArrayList<FieldEntry> structMembers = new ArrayList<FieldEntry>();
+   private final ArrayList<FieldEntry> structMembers = new ArrayList<>();
 
-   private final ArrayList<Long> structMemberOffsets = new ArrayList<Long>();
+   private final ArrayList<Long> structMemberOffsets = new ArrayList<>();
 
-   private final ArrayList<TypeSpec> structMemberTypes = new ArrayList<TypeSpec>();
+   private final ArrayList<TypeSpec> structMemberTypes = new ArrayList<>();
 
    private int totalStructSize = 0;
 
diff --git a/src/main/java/com/aparapi/internal/model/Entrypoint.java b/src/main/java/com/aparapi/internal/model/Entrypoint.java
index 287b406ded8812584a9d62b450bbe27bd7f2b969..3bfb3e8dcf25172fb59048b6baba3a90aebcecb3 100644
--- a/src/main/java/com/aparapi/internal/model/Entrypoint.java
+++ b/src/main/java/com/aparapi/internal/model/Entrypoint.java
@@ -52,47 +52,54 @@ under those regulations, please refer to the U.S. Bureau of Industry and Securit
 */
 package com.aparapi.internal.model;
 
-import com.aparapi.*;
-import com.aparapi.internal.exception.*;
-import com.aparapi.internal.instruction.*;
+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.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 com.aparapi.internal.model.ClassModel.ClassModelField;
+import com.aparapi.internal.model.ClassModel.ClassModelMethod;
+import com.aparapi.internal.model.ClassModel.ConstantPool.FieldEntry;
+import com.aparapi.internal.model.ClassModel.ConstantPool.MethodEntry;
+import com.aparapi.internal.model.ClassModel.ConstantPool.MethodReferenceEntry.Arg;
+import com.aparapi.internal.util.UnsafeWrapper;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
 import java.util.*;
-import java.util.logging.*;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 public class Entrypoint implements Cloneable {
 
-   private static Logger logger = Logger.getLogger(Config.getLoggerName());
+   private static final Logger logger = Logger.getLogger(Config.getLoggerName());
 
-   private final List<ClassModel.ClassModelField> referencedClassModelFields = new ArrayList<ClassModel.ClassModelField>();
+   private final List<ClassModel.ClassModelField> referencedClassModelFields = new ArrayList<>();
 
-   private final List<Field> referencedFields = new ArrayList<Field>();
+   private final List<Field> referencedFields = new ArrayList<>();
 
-   private ClassModel classModel;
+   private final ClassModel classModel;
 
    private Object kernelInstance = null;
 
-   private final Set<String> referencedFieldNames = new LinkedHashSet<String>();
+   private final Set<String> referencedFieldNames = new LinkedHashSet<>();
 
-   private final Set<String> arrayFieldAssignments = new LinkedHashSet<String>();
+   private final Set<String> arrayFieldAssignments = new LinkedHashSet<>();
 
-   private final Set<String> arrayFieldAccesses = new LinkedHashSet<String>();
+   private final Set<String> arrayFieldAccesses = new LinkedHashSet<>();
 
    // Classes of object array members
-   private final HashMap<String, ClassModel> objectArrayFieldsClasses = new HashMap<String, ClassModel>();
+   private final HashMap<String, ClassModel> objectArrayFieldsClasses = new HashMap<>();
 
    // Supporting classes of object array members like supers
-   private final HashMap<String, ClassModel> allFieldsClasses = new HashMap<String, ClassModel>();
+   private final HashMap<String, ClassModel> allFieldsClasses = new HashMap<>();
 
    // Keep track of arrays whose length is taken via foo.length
-   private final Set<String> arrayFieldArrayLengthUsed = new LinkedHashSet<String>();
+   private final Set<String> arrayFieldArrayLengthUsed = new LinkedHashSet<>();
 
-   private final List<MethodModel> calledMethods = new ArrayList<MethodModel>();
+   private final List<MethodModel> calledMethods = new ArrayList<>();
 
    private final MethodModel methodModel;
 
@@ -411,7 +418,7 @@ public class Entrypoint implements Cloneable {
          }
       }
 
-      ClassModelMethod m = classModel.getMethod(methodEntry, (methodCall instanceof I_INVOKESPECIAL) ? true : false);
+      ClassModelMethod m = classModel.getMethod(methodEntry, (methodCall instanceof I_INVOKESPECIAL));
 
       // Did not find method in this class or supers. Look for data member object arrays
       if (m == null && !isMapped) {
@@ -423,7 +430,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 I_INVOKESPECIAL) ? true : false);
+               m = c.getMethod(methodEntry, (methodCall instanceof I_INVOKESPECIAL));
                assert m != null;
                break;
             }
@@ -454,7 +461,7 @@ public class Entrypoint implements Cloneable {
       methodModel = _methodModel;
       kernelInstance = _k;
 
-      final Map<ClassModelMethod, MethodModel> methodMap = new LinkedHashMap<ClassModelMethod, MethodModel>();
+      final Map<ClassModelMethod, MethodModel> methodMap = new LinkedHashMap<>();
 
       boolean discovered = true;
 
@@ -489,7 +496,7 @@ public class Entrypoint implements Cloneable {
       // Walk the whole graph of called methods and add them to the methodMap
       while (discovered) {
          discovered = false;
-         for (final MethodModel mm : new ArrayList<MethodModel>(methodMap.values())) {
+         for (final MethodModel mm : new ArrayList<>(methodMap.values())) {
             for (final MethodCall methodCall : mm.getMethodCalls()) {
 
                ClassModelMethod m = resolveCalledMethod(methodCall, classModel);
@@ -521,13 +528,13 @@ public class Entrypoint implements Cloneable {
 
       calledMethods.addAll(methodMap.values());
       Collections.reverse(calledMethods);
-      final List<MethodModel> methods = new ArrayList<MethodModel>(calledMethods);
+      final List<MethodModel> methods = new ArrayList<>(calledMethods);
 
       // add method to the calledMethods so we can include in this list
       methods.add(methodModel);
-      final Set<String> fieldAssignments = new HashSet<String>();
+      final Set<String> fieldAssignments = new HashSet<>();
 
-      final Set<String> fieldAccesses = new HashSet<String>();
+      final Set<String> fieldAccesses = new HashSet<>();
 
       for (final MethodModel methodModel : methods) {
 
diff --git a/src/main/java/com/aparapi/internal/model/EntrypointKey.java b/src/main/java/com/aparapi/internal/model/EntrypointKey.java
index 3280f44ea7579e50e6187f3a7655c80f59d6d969..51895daa2e052e1fc1a54f46a046d96a04080b6e 100644
--- a/src/main/java/com/aparapi/internal/model/EntrypointKey.java
+++ b/src/main/java/com/aparapi/internal/model/EntrypointKey.java
@@ -20,9 +20,9 @@ final class EntrypointKey{
       return new EntrypointKey(entrypointName, descriptor);
    }
 
-   private String descriptor;
+   private final String descriptor;
 
-   private String entrypointName;
+   private final String entrypointName;
 
    private EntrypointKey(String entrypointName, String descriptor) {
       this.entrypointName = entrypointName;
diff --git a/src/main/java/com/aparapi/internal/model/Memoizer.java b/src/main/java/com/aparapi/internal/model/Memoizer.java
index b72be234f20a855402a713f03036003876ea0cf6..be0cecd048195df638c777b964c5d36d16751fe0 100644
--- a/src/main/java/com/aparapi/internal/model/Memoizer.java
+++ b/src/main/java/com/aparapi/internal/model/Memoizer.java
@@ -15,14 +15,14 @@
  */
 package com.aparapi.internal.model;
 
-import java.util.*;
-import java.util.concurrent.atomic.*;
+import java.util.NoSuchElementException;
+import java.util.concurrent.atomic.AtomicReference;
 
 interface Optional<E> {
    final class Some<E> implements Optional<E>{
       private final E value;
 
-      static final <E> Optional<E> of(E value) {
+      static <E> Optional<E> of(E value) {
          return new Some<>(value);
       }
 
@@ -65,7 +65,7 @@ interface Optional<E> {
 }
 
 public interface Memoizer<T> extends Supplier<T> {
-   public final class Impl<T> implements Memoizer<T>{
+   final class Impl<T> implements Memoizer<T>{
       private final Supplier<T> supplier;
 
       private final AtomicReference<Optional<T>> valueRef = new AtomicReference<>(Optional.None.<T> none());
diff --git a/src/main/java/com/aparapi/internal/model/MethodModel.java b/src/main/java/com/aparapi/internal/model/MethodModel.java
index d46e98a4e19b13b2c3f9f2b16fd85a5cdd3acd95..d29a1189974634ac01c3ba58d9b301d41a42cf3f 100644
--- a/src/main/java/com/aparapi/internal/model/MethodModel.java
+++ b/src/main/java/com/aparapi/internal/model/MethodModel.java
@@ -52,23 +52,27 @@ under those regulations, please refer to the U.S. Bureau of Industry and Securit
  */
 package com.aparapi.internal.model;
 
-import com.aparapi.*;
-import com.aparapi.internal.exception.*;
+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.instruction.InstructionPattern.*;
+import com.aparapi.internal.instruction.InstructionPattern.InstructionMatch;
 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 com.aparapi.internal.model.ClassModel.ConstantPool.FieldEntry;
+import com.aparapi.internal.model.ClassModel.ConstantPool.MethodReferenceEntry;
+import com.aparapi.internal.model.ClassModel.ConstantPool.MethodReferenceEntry.Arg;
+import com.aparapi.internal.reader.ByteReader;
 
 import java.util.*;
 import java.util.Map.Entry;
-import java.util.logging.*;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 public class MethodModel{
 
-   private static Logger logger = Logger.getLogger(Config.getLoggerName());
+   private static final Logger logger = Logger.getLogger(Config.getLoggerName());
 
    private ExpressionList expressionList;
 
@@ -125,7 +129,7 @@ public class MethodModel{
       return accessorVariableFieldEntry;
    }
 
-   private final Set<MethodModel> calledMethods = new HashSet<MethodModel>();
+   private final Set<MethodModel> calledMethods = new HashSet<>();
 
    public Set<MethodModel> getCalledMethods() {
       return calledMethods;
@@ -141,11 +145,9 @@ public class MethodModel{
       transitiveCalledMethods.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.checkForRecursion(transitiveCalledMethods);
-      }
+       for (MethodModel next : getCalledMethods()) {
+           next.checkForRecursion(transitiveCalledMethods);
+       }
 
       // Done examining this call path, remove myself
       transitiveCalledMethods.remove(this);
@@ -202,7 +204,7 @@ public class MethodModel{
     * @return Map<Integer, Instruction> the returned pc to Instruction map
     */
    public Map<Integer, Instruction> createListOfInstructions() throws ClassParseException {
-      final Map<Integer, Instruction> pcMap = new LinkedHashMap<Integer, Instruction>();
+      final Map<Integer, Instruction> pcMap = new LinkedHashMap<>();
       final byte[] code = method.getCode();
 
       // We create a byteReader for reading the bytes from the code array
@@ -597,7 +599,7 @@ public class MethodModel{
       }
    }
 
-   InstructionTransformer[] transformers = new InstructionTransformer[] {
+   final InstructionTransformer[] transformers = new InstructionTransformer[] {
 
          new InstructionTransformer("long hand post increment of field"){
 
@@ -927,7 +929,7 @@ public class MethodModel{
                   final AssignToLocalVariable assign = (AssignToLocalVariable) i.getNextExpr();
 
                   final InlineAssignInstruction inlineAssign = new InlineAssignInstruction(MethodModel.this, assign, cast);
-                  _expressionList.replaceInclusive((Instruction) cast, (Instruction) assign, inlineAssign);
+                  _expressionList.replaceInclusive(cast, (Instruction) assign, inlineAssign);
                   return (inlineAssign);
 
                }
@@ -1524,7 +1526,7 @@ public class MethodModel{
          }
       }
 
-      List<LocalVariableInfo> list = new ArrayList<LocalVariableInfo>();
+      final List<LocalVariableInfo> list = new ArrayList<>();
 
       public FakeLocalVariableTableEntry(Map<Integer, Instruction> _pcMap, ClassModelMethod _method) {
          int numberOfSlots = _method.getCodeEntry().getMaxLocals();
@@ -1723,7 +1725,7 @@ public class MethodModel{
    }
 
    public List<MethodCall> getMethodCalls() {
-      final List<MethodCall> methodCalls = new ArrayList<MethodCall>();
+      final List<MethodCall> methodCalls = new ArrayList<>();
 
       for (Instruction i = getPCHead(); i != null; i = i.getNextPC()) {
          if (i instanceof MethodCall) {
diff --git a/src/main/java/com/aparapi/internal/model/ValueCache.java b/src/main/java/com/aparapi/internal/model/ValueCache.java
index 12bd227b448fd3bb67fb85cff1fdbeefc23456d5..557440a11717819bd9307a54db85c71f460d6ecf 100644
--- a/src/main/java/com/aparapi/internal/model/ValueCache.java
+++ b/src/main/java/com/aparapi/internal/model/ValueCache.java
@@ -15,8 +15,10 @@
  */
 package com.aparapi.internal.model;
 
-import java.lang.ref.*;
-import java.util.concurrent.*;
+import java.lang.ref.Reference;
+import java.lang.ref.SoftReference;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
 
 //import java.util.function.Supplier;
 
@@ -32,7 +34,7 @@ public final class ValueCache<K, V, T extends Throwable> {
    }
 
    public static <K, V, T extends Throwable> ValueCache<K, V, T> on(ThrowingValueComputer<K, V, T> computer) {
-      return new ValueCache<K, V, T>(computer);
+      return new ValueCache<>(computer);
    }
 
    private final ConcurrentMap<K, SoftReference<V>> map = new ConcurrentHashMap<>();
diff --git a/src/main/java/com/aparapi/internal/opencl/OpenCLArgDescriptor.java b/src/main/java/com/aparapi/internal/opencl/OpenCLArgDescriptor.java
index d1fda9fc2de2a5790e056c1fa0a8797a1b650059..252e8346bae52290cfb03dba5a8a506864d8b7b5 100644
--- a/src/main/java/com/aparapi/internal/opencl/OpenCLArgDescriptor.java
+++ b/src/main/java/com/aparapi/internal/opencl/OpenCLArgDescriptor.java
@@ -54,7 +54,7 @@ public class OpenCLArgDescriptor{
 
    private final String name;
 
-   public long bits;
+   public final long bits;
 
    public OpenCLKernel kernel;
 
diff --git a/src/main/java/com/aparapi/internal/opencl/OpenCLKernel.java b/src/main/java/com/aparapi/internal/opencl/OpenCLKernel.java
index 10ce52eaf439bb943f429a96c5f4db7f6d2db500..be0a6d2be1cbb6b13f6908e7815c01cc550e4e56 100644
--- a/src/main/java/com/aparapi/internal/opencl/OpenCLKernel.java
+++ b/src/main/java/com/aparapi/internal/opencl/OpenCLKernel.java
@@ -15,10 +15,10 @@
  */
 package com.aparapi.internal.opencl;
 
-import java.util.List;
-
 import com.aparapi.internal.jni.OpenCLJNI;
 
+import java.util.List;
+
 public class OpenCLKernel extends OpenCLJNI{
 
    private OpenCLArgDescriptor[] args = null;
diff --git a/src/main/java/com/aparapi/internal/opencl/OpenCLLoader.java b/src/main/java/com/aparapi/internal/opencl/OpenCLLoader.java
index 4e9f0a6f49be235b9a7263001c8363028f94e948..c417d9055e4bd1a47d721deed79d530db512494d 100644
--- a/src/main/java/com/aparapi/internal/opencl/OpenCLLoader.java
+++ b/src/main/java/com/aparapi/internal/opencl/OpenCLLoader.java
@@ -1,12 +1,12 @@
 /**
  * Copyright (c) 2016 - 2017 Syncleus, Inc.
- *
+ * <p>
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -15,58 +15,60 @@
  */
 package com.aparapi.internal.opencl;
 
-import java.io.IOException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
 import com.aparapi.Config;
 import com.aparapi.internal.jni.OpenCLJNI;
 import com.aparapi.natives.NativeLoader;
 
+import java.io.IOException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
 /**
  * This class is intended to be a singleton which determines if OpenCL is available upon startup of Aparapi
  */
-public class OpenCLLoader extends OpenCLJNI{
-
-   private static final Logger logger = Logger.getLogger(Config.getLoggerName());
+public class OpenCLLoader extends OpenCLJNI {
 
-   private static boolean openCLAvailable = false;
+    private static final Logger logger = Logger.getLogger(Config.getLoggerName());
 
-   private static final OpenCLLoader instance = new OpenCLLoader();
+    private static final boolean openCLAvailable;
 
-   static {
-      if (Config.useAgent) {
-         logger.fine("Using agent!");
-         openCLAvailable = true;
-      } else {
+    static {
+        boolean openCLAvail = false;
+        if (Config.useAgent) {
+            logger.fine("Using agent!");
+            openCLAvail = true;
+        } else {
             try {
-               NativeLoader.load();
-               System.out.println("Aparapi JNI loaded successfully.");
-               openCLAvailable = true;
+                NativeLoader.load();
+                System.out.println("Aparapi JNI loaded successfully.");
+                openCLAvail = true;
+            } catch (final IOException e) {
+                logger.log(Level.SEVERE, "Check your environment. Failed to load aparapi native library "
+                        + " or possibly failed to locate opencl native library (opencl.dll/opencl.so)."
+                        + " Ensure that OpenCL is in your PATH (windows) or in LD_LIBRARY_PATH (linux).");
             }
-            catch (final IOException e) {
-               logger.log(Level.SEVERE, "Check your environment. Failed to load aparapi native library "
-                     + " or possibly failed to locate opencl native library (opencl.dll/opencl.so)."
-                     + " Ensure that OpenCL is in your PATH (windows) or in LD_LIBRARY_PATH (linux).");
-            }
-      }
-   }
+        }
+        openCLAvailable = openCLAvail;
+    }
+
+    private static final OpenCLLoader instance = new OpenCLLoader();
+
 
-   /**
-    * Retrieve a singleton instance of OpenCLLoader
-    * 
-    * @return A singleton instance of OpenCLLoader
-    */
-   protected static OpenCLLoader getInstance() {
-      return instance;
-   }
+    /**
+     * Retrieve a singleton instance of OpenCLLoader
+     *
+     * @return A singleton instance of OpenCLLoader
+     */
+    protected static OpenCLLoader getInstance() {
+        return instance;
+    }
 
-   /**
-    * Retrieve the status of whether OpenCL was successfully loaded
-    * 
-    * @return The status of whether OpenCL was successfully loaded
-    */
-   public static boolean isOpenCLAvailable() {
-      return openCLAvailable;
-   }
+    /**
+     * Retrieve the status of whether OpenCL was successfully loaded
+     *
+     * @return The status of whether OpenCL was successfully loaded
+     */
+    public static boolean isOpenCLAvailable() {
+        return openCLAvailable;
+    }
 }
diff --git a/src/main/java/com/aparapi/internal/opencl/OpenCLPlatform.java b/src/main/java/com/aparapi/internal/opencl/OpenCLPlatform.java
index ac2b5201182b3e2e7081d5730c8c86ace32b77ba..75328f688b04f0263384d110d4845636457a0c32 100644
--- a/src/main/java/com/aparapi/internal/opencl/OpenCLPlatform.java
+++ b/src/main/java/com/aparapi/internal/opencl/OpenCLPlatform.java
@@ -15,13 +15,13 @@
  */
 package com.aparapi.internal.opencl;
 
+import com.aparapi.device.OpenCLDevice;
+import com.aparapi.internal.jni.OpenCLJNI;
+
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
-import com.aparapi.device.OpenCLDevice;
-import com.aparapi.internal.jni.OpenCLJNI;
-
 public class OpenCLPlatform extends OpenCLJNI{
 
    private long platformId;
@@ -32,7 +32,7 @@ public class OpenCLPlatform extends OpenCLJNI{
 
    private final String name;
 
-   private final List<OpenCLDevice> devices = new ArrayList<OpenCLDevice>();
+   private final List<OpenCLDevice> devices = new ArrayList<>();
 
    private static List<OpenCLPlatform> platforms;
 
diff --git a/src/main/java/com/aparapi/internal/opencl/OpenCLProgram.java b/src/main/java/com/aparapi/internal/opencl/OpenCLProgram.java
index dfd417f83869dd534b945197d7675c1c4e1c38c5..4fe943247ebfca35a499b02abdc4e44cbfc89b99 100644
--- a/src/main/java/com/aparapi/internal/opencl/OpenCLProgram.java
+++ b/src/main/java/com/aparapi/internal/opencl/OpenCLProgram.java
@@ -16,13 +16,13 @@
 package com.aparapi.internal.opencl;
 
 import com.aparapi.ProfileInfo;
+import com.aparapi.device.OpenCLDevice;
+import com.aparapi.internal.jni.OpenCLJNI;
+
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import com.aparapi.device.OpenCLDevice;
-import com.aparapi.internal.jni.OpenCLJNI;
-
 public class OpenCLProgram extends OpenCLJNI{
 
    private final long programId;
@@ -40,9 +40,9 @@ public class OpenCLProgram extends OpenCLJNI{
    /**
     * FIXME Why are these not ConcurrentHashMaps or at least synchronized at a finer grain?
     */
-   private final Map<Object, OpenCLMem> instanceToMem = new HashMap<Object, OpenCLMem>();
+   private final Map<Object, OpenCLMem> instanceToMem = new HashMap<>();
 
-   private final Map<Long, OpenCLMem> addressToMem = new HashMap<Long, OpenCLMem>();
+   private final Map<Long, OpenCLMem> addressToMem = new HashMap<>();
 
    /**
     * Minimal constructor
diff --git a/src/main/java/com/aparapi/internal/tool/InstructionHelper.java b/src/main/java/com/aparapi/internal/tool/InstructionHelper.java
index 243d644d377d56fac61e5662cd39a7267e543f0c..71b6e3fa4a965ffbe24bf78265b271869a694206 100644
--- a/src/main/java/com/aparapi/internal/tool/InstructionHelper.java
+++ b/src/main/java/com/aparapi/internal/tool/InstructionHelper.java
@@ -15,46 +15,34 @@
  */
 package com.aparapi.internal.tool;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
 import com.aparapi.internal.exception.CodeGenException;
 import com.aparapi.internal.instruction.Instruction;
-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.CloneInstruction;
-import com.aparapi.internal.instruction.InstructionSet.CompositeInstruction;
-import com.aparapi.internal.instruction.InstructionSet.ConditionalBranch16;
-import com.aparapi.internal.instruction.InstructionSet.Constant;
-import com.aparapi.internal.instruction.InstructionSet.FieldReference;
-import com.aparapi.internal.instruction.InstructionSet.I_ACONST_NULL;
-import com.aparapi.internal.instruction.InstructionSet.I_IINC;
-import com.aparapi.internal.instruction.InstructionSet.LocalVariableTableIndexAccessor;
-import com.aparapi.internal.instruction.InstructionSet.MethodCall;
-import com.aparapi.internal.instruction.InstructionSet.OperatorInstruction;
+import com.aparapi.internal.instruction.InstructionSet.*;
 import com.aparapi.internal.model.ClassModel;
+import com.aparapi.internal.model.ClassModel.LocalVariableInfo;
 import com.aparapi.internal.model.Entrypoint;
 import com.aparapi.internal.model.MethodModel;
-import com.aparapi.internal.model.ClassModel.LocalVariableInfo;
 import com.aparapi.internal.writer.BlockWriter;
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
 public class InstructionHelper{
 
    public static class Table{
 
       final static String spaces = "                                                                                                                        ";
 
-      private final List<Table.Col> cols = new ArrayList<Table.Col>();
+      private final List<Table.Col> cols = new ArrayList<>();
 
       private int size = 0;
 
       private int col = 0;
 
       public static class Col{
-         private final List<String> text = new ArrayList<String>();
+         private final List<String> text = new ArrayList<>();
 
          private int width;
 
@@ -173,13 +161,13 @@ public class InstructionHelper{
    }
 
    public static class BranchVector{
-      protected Instruction from;
+      protected final Instruction from;
 
-      protected Instruction to;
+      protected final Instruction to;
 
-      protected Instruction start;
+      protected final Instruction start;
 
-      protected Instruction end;
+      protected final Instruction end;
 
       private boolean forward = false;
 
@@ -349,7 +337,7 @@ public class InstructionHelper{
                label.append(methodCall.getConstantPoolMethodEntry().getNameAndTypeEntry().getDescriptorUTF8Entry().getUTF8());
             } else if (instruction instanceof OperatorInstruction) {
                final OperatorInstruction operatorInstruction = (OperatorInstruction) instruction;
-               label.append(operatorInstruction.getOperator().getText() + "(" + byteCodeName + ")");
+               label.append(operatorInstruction.getOperator().getText()).append("(").append(byteCodeName).append(")");
             } else if (instruction instanceof FieldReference) {
                final FieldReference field = (FieldReference) instruction;
                label.append(field.getConstantPoolFieldEntry().getNameAndTypeEntry().getNameUTF8Entry().getUTF8());
@@ -386,8 +374,8 @@ public class InstructionHelper{
             } else if (instruction instanceof I_IINC) {
 
                label.append(instruction.getByteCode());
-               label.append(" " + ((I_IINC) instruction).getDelta());
-               label.append(" " + ((I_IINC) instruction).getLocalVariableInfo().getVariableName());
+               label.append(" ").append(((I_IINC) instruction).getDelta());
+               label.append(" ").append(((I_IINC) instruction).getLocalVariableInfo().getVariableName());
             } else if (instruction instanceof CompositeInstruction) {
                label.append("composite ");
                label.append(instruction.getByteCode());
@@ -505,7 +493,7 @@ public class InstructionHelper{
       return (table.toString());
    }
 
-   private static Comparator<BranchVector> branchInfoComparator = new Comparator<BranchVector>(){
+   private static final Comparator<BranchVector> branchInfoComparator = new Comparator<BranchVector>(){
       @Override public int compare(BranchVector left, BranchVector right) {
          final int value = left.getFrom().compareTo(right.getFrom());
          return (value);
@@ -514,7 +502,7 @@ public class InstructionHelper{
    };
 
    static List<BranchVector> getBranches(MethodModel _methodModel) {
-      final List<BranchVector> branchVectors = new ArrayList<BranchVector>();
+      final List<BranchVector> branchVectors = new ArrayList<>();
 
       for (Instruction instruction = _methodModel.getPCHead(); instruction != null; instruction = instruction.getNextPC()) {
          if (instruction.isBranch()) {
@@ -533,7 +521,7 @@ public class InstructionHelper{
       final String label = InstructionHelper.getLabel(i, false, true, true);
 
       if (i instanceof CloneInstruction) {
-         edump(_sb, ((CloneInstruction) i).getReal(), true);
+         edump(_sb, i.getReal(), true);
       } else {
 
          if (i.producesStack()) {
@@ -547,7 +535,7 @@ public class InstructionHelper{
          } else {
             _sb.append(" ");
          }
-         _sb.append(i.getThisPC() + ":" + label);
+         _sb.append(i.getThisPC()).append(":").append(label);
       }
 
    }
@@ -556,7 +544,7 @@ public class InstructionHelper{
       final String label = i.getByteCode().getName();// InstructionHelper.getLabel(i, false, false, false);
 
       if (i instanceof CloneInstruction) {
-         fdump(_depth, ((CloneInstruction) i).getReal(), true);
+         fdump(_depth, i.getReal(), true);
       } else {
          if (_depth == 0) {
             if (i.producesStack()) {
@@ -594,7 +582,7 @@ public class InstructionHelper{
       final String label = InstructionHelper.getLabel(i, true, false, false);
 
       if (i instanceof CloneInstruction) {
-         dump(_indent, ((CloneInstruction) i).getReal(), true);
+         dump(_indent, i.getReal(), true);
       } else {
          System.out.println(_indent + (clone ? "*" : " ") + label);
       }
diff --git a/src/main/java/com/aparapi/internal/tool/InstructionViewer.java b/src/main/java/com/aparapi/internal/tool/InstructionViewer.java
index 711540ad9ec15fb621f08087f0da4bf656b826c0..1328ae22607b980fc817ecd9edcf09c2a175d4ef 100644
--- a/src/main/java/com/aparapi/internal/tool/InstructionViewer.java
+++ b/src/main/java/com/aparapi/internal/tool/InstructionViewer.java
@@ -15,55 +15,6 @@
  */
 package com.aparapi.internal.tool;
 
-import java.awt.BasicStroke;
-import java.awt.BorderLayout;
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.FontMetrics;
-import java.awt.Graphics;
-import java.awt.Graphics2D;
-import java.awt.Polygon;
-import java.awt.Rectangle;
-import java.awt.RenderingHints;
-import java.awt.Shape;
-import java.awt.Stroke;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.KeyAdapter;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseWheelEvent;
-import java.awt.geom.AffineTransform;
-import java.awt.geom.CubicCurve2D;
-import java.awt.image.BufferedImage;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.swing.JButton;
-import javax.swing.JCheckBox;
-import javax.swing.JComponent;
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-import javax.swing.JMenu;
-import javax.swing.JMenuBar;
-import javax.swing.JMenuItem;
-import javax.swing.JPanel;
-import javax.swing.JToggleButton;
-import javax.swing.JToolBar;
-import javax.swing.SpringLayout;
-import javax.swing.UIManager;
-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;
@@ -76,6 +27,20 @@ import com.aparapi.internal.tool.InstructionViewer.Form.Check;
 import com.aparapi.internal.tool.InstructionViewer.Form.Template;
 import com.aparapi.internal.tool.InstructionViewer.Form.Toggle;
 
+import javax.swing.*;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import java.awt.*;
+import java.awt.event.*;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.CubicCurve2D;
+import java.awt.image.BufferedImage;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.reflect.Field;
+import java.util.*;
+import java.util.List;
+
 public class InstructionViewer implements Config.InstructionListener{
 
    public static abstract class Form<T extends Form.Template> {
@@ -109,17 +74,14 @@ public class InstructionViewer implements Config.InstructionListener{
 
       private final T template;
 
-      JPanel panel;
+      final JPanel panel;
 
       private final SpringLayout layout = new SpringLayout();
 
       void setBoolean(Field _field, boolean _value) {
          try {
             _field.setBoolean(template, _value);
-         } catch (final IllegalArgumentException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-         } catch (final IllegalAccessException e) {
+         } catch (final IllegalArgumentException | IllegalAccessException e) {
             // TODO Auto-generated catch block
             e.printStackTrace();
          }
@@ -128,34 +90,28 @@ public class InstructionViewer implements Config.InstructionListener{
       boolean getBoolean(Field _field) {
          try {
             return (_field.getBoolean(template));
-         } catch (final IllegalArgumentException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-         } catch (final IllegalAccessException e) {
+         } catch (final IllegalArgumentException | IllegalAccessException e) {
             // TODO Auto-generated catch block
             e.printStackTrace();
          }
-         return (false);
+          return (false);
       }
 
       Object get(Field _field) {
          try {
             return (_field.get(template));
-         } catch (final IllegalArgumentException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-         } catch (final IllegalAccessException e) {
+         } catch (final IllegalArgumentException | IllegalAccessException e) {
             // TODO Auto-generated catch block
             e.printStackTrace();
          }
-         return (null);
+          return (null);
       }
 
       public Form(T _template) {
          template = _template;
          panel = new JPanel(layout);
          JComponent last = panel;
-         final Map<Field, JLabel> fieldToLabelMap = new LinkedHashMap<Field, JLabel>();
+         final Map<Field, JLabel> fieldToLabelMap = new LinkedHashMap<>();
          Field fieldWithWidestLabel = null;
          int fieldWithWidestLabelWidth = 0;
 
@@ -277,19 +233,19 @@ public class InstructionViewer implements Config.InstructionListener{
 
    public static class Options implements Template{
 
-      @Toggle(label = "Fold", on = "On", off = "Off") public boolean fold = true;
+      @Toggle(label = "Fold", on = "On", off = "Off") public final boolean fold = true;
 
-      @Check(label = "Fan Edges") public boolean edgeFan = true;
+      @Check(label = "Fan Edges") public final boolean edgeFan = true;
 
-      @Check(label = "Curves") public boolean edgeCurve = false;
+      @Check(label = "Curves") public final boolean edgeCurve = false;
 
-      @Check(label = "PC") public boolean showPc = true;
+      @Check(label = "PC") public final boolean showPc = true;
 
-      @Check(label = "Bytecode Labels") public boolean verboseBytecodeLabels = false;
+      @Check(label = "Bytecode Labels") public final boolean verboseBytecodeLabels = false;
 
-      @Check(label = "Collapse All") public boolean collapseAll = false;
+      @Check(label = "Collapse All") public final boolean collapseAll = false;
 
-      /* @Check(label = "Show expressions")*/public boolean showExpressions = false;
+      /* @Check(label = "Show expressions")*/public final boolean showExpressions = false;
 
    }
 
@@ -299,7 +255,8 @@ public class InstructionViewer implements Config.InstructionListener{
          y = _y;
       }
 
-      double x, y;
+      final double x;
+       final double y;
    }
 
    private static class View{
@@ -447,7 +404,7 @@ public class InstructionViewer implements Config.InstructionListener{
       _g.fill(_rectangle);
    }
 
-   public Options config = new Options();
+   public final Options config = new Options();
 
    final private Color unselectedColor = Color.WHITE;
 
@@ -459,7 +416,7 @@ public class InstructionViewer implements Config.InstructionListener{
 
    private final Stroke outlineStroke = new BasicStroke((float) 0.5);
 
-   public Polygon arrowHeadOut = new Polygon();
+   public final Polygon arrowHeadOut = new Polygon();
    {
       arrowHeadOut.addPoint(8, -4);
       arrowHeadOut.addPoint(0, 0);
@@ -467,7 +424,7 @@ public class InstructionViewer implements Config.InstructionListener{
       arrowHeadOut.addPoint(8, -4);
    }
 
-   Polygon arrowHeadIn = new Polygon();
+   final Polygon arrowHeadIn = new Polygon();
    {
       arrowHeadIn.addPoint(0, -4);
       arrowHeadIn.addPoint(8, 0);
@@ -495,7 +452,7 @@ public class InstructionViewer implements Config.InstructionListener{
 
    }
 
-   private final Map<Instruction, InstructionView> locationToInstructionViewMap = new HashMap<Instruction, InstructionView>();
+   private final Map<Instruction, InstructionView> locationToInstructionViewMap = new HashMap<>();
 
    InstructionView getInstructionView(Instruction _instruction) {
 
@@ -641,14 +598,11 @@ public class InstructionViewer implements Config.InstructionListener{
 
       try {
          classModel = ClassModel.createClassModel(Class.forName(_name));
-      } catch (final ClassParseException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final ClassNotFoundException e) {
+      } catch (final ClassParseException | ClassNotFoundException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
       }
-      container = new JPanel(){
+       container = new JPanel(){
          /**
           * 
           */
@@ -879,7 +833,7 @@ public class InstructionViewer implements Config.InstructionListener{
          if (config.fold) {
             double y = 100;
             final Instruction firstRoot = first.getRootExpr();
-            final List<InstructionView> instructionViews = new ArrayList<InstructionView>();
+            final List<InstructionView> instructionViews = new ArrayList<>();
 
             Instruction lastInstruction = null;
             for (Instruction instruction = firstRoot; instruction != null; instruction = instruction.getNextExpr()) {
@@ -1039,7 +993,7 @@ public class InstructionViewer implements Config.InstructionListener{
 
    }
 
-   public static DoorBell doorbell = new DoorBell();
+   public static final DoorBell doorbell = new DoorBell();
 
    public static void main(String[] _args) throws ClassNotFoundException, InstantiationException, IllegalAccessException,
          UnsupportedLookAndFeelException, AparapiException {
diff --git a/src/main/java/com/aparapi/internal/util/OpenCLUtil.java b/src/main/java/com/aparapi/internal/util/OpenCLUtil.java
index f4f813979c208b6a6e788781a09b7d3482610be2..c9fd7859f33fc2bdfcb124109f7b3422fd5060d8 100644
--- a/src/main/java/com/aparapi/internal/util/OpenCLUtil.java
+++ b/src/main/java/com/aparapi/internal/util/OpenCLUtil.java
@@ -15,10 +15,10 @@
  */
 package com.aparapi.internal.util;
 
-import java.util.List;
-
 import com.aparapi.internal.opencl.OpenCLPlatform;
 
+import java.util.List;
+
 /**
  * This utility class encapsulates the necessary actions required to query underlying OpenCL information
  */
diff --git a/src/main/java/com/aparapi/internal/util/UnsafeWrapper.java b/src/main/java/com/aparapi/internal/util/UnsafeWrapper.java
index 670c13610f6725bbd403e4eefbf6179d4033eb95..4748a2e3bbc04fc4af469a12161cc36f9ae11531 100644
--- a/src/main/java/com/aparapi/internal/util/UnsafeWrapper.java
+++ b/src/main/java/com/aparapi/internal/util/UnsafeWrapper.java
@@ -129,22 +129,7 @@ public class UnsafeWrapper{
          putLongMethod = uc.getDeclaredMethod("putLong", Object.class, long.class, long.class);
          putByteMethod = uc.getDeclaredMethod("putByte", Object.class, long.class, byte.class);
          compareAndSwapIntMethod = uc.getDeclaredMethod("compareAndSwapInt", Object.class, long.class, int.class, int.class);
-      } catch (final SecurityException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final NoSuchFieldException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final IllegalArgumentException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final IllegalAccessException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final ClassNotFoundException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final NoSuchMethodException e) {
+      } catch (final SecurityException | NoSuchMethodException | ClassNotFoundException | IllegalAccessException | IllegalArgumentException | NoSuchFieldException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
       }
@@ -164,13 +149,7 @@ public class UnsafeWrapper{
             if ((Boolean) compareAndSwapIntMethod.invoke(unsafe, _arr, rawIndex, current, next)) {
                return current;
             }
-         } catch (final IllegalArgumentException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-         } catch (final IllegalAccessException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-         } catch (final InvocationTargetException e) {
+         } catch (final IllegalArgumentException | InvocationTargetException | IllegalAccessException e) {
             // TODO Auto-generated catch block
             e.printStackTrace();
          }
@@ -182,35 +161,23 @@ public class UnsafeWrapper{
 
       try {
          offset = (Integer) (arrayBaseOffsetMethod.invoke(unsafe, _arrayClass));
-      } catch (final IllegalArgumentException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final IllegalAccessException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final InvocationTargetException e) {
+      } catch (final IllegalArgumentException | InvocationTargetException | IllegalAccessException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
       }
 
-      return (offset);
+       return (offset);
    }
 
    public static int arrayIndexScale(Class<?> _arrayClass) {
       int scale = 0;
       try {
          scale = (Integer) (arrayIndexScaleMethod.invoke(unsafe, _arrayClass));
-      } catch (final IllegalArgumentException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final IllegalAccessException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final InvocationTargetException e) {
+      } catch (final IllegalArgumentException | InvocationTargetException | IllegalAccessException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
       }
-      return scale;
+       return scale;
    }
 
    private static int intArrayBase = arrayBaseOffset(int[].class);
@@ -221,114 +188,72 @@ public class UnsafeWrapper{
       Object object = null;
       try {
          object = getObjectMethod.invoke(unsafe, _object, _offset);
-      } catch (final IllegalArgumentException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final IllegalAccessException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final InvocationTargetException e) {
+      } catch (final IllegalArgumentException | InvocationTargetException | IllegalAccessException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
       }
-      return (object);
+       return (object);
    }
 
    public static int getInt(Object _object, long _offset) {
       int value = 0;
       try {
          value = (Integer) getIntMethod.invoke(unsafe, _object, _offset);
-      } catch (final IllegalArgumentException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final IllegalAccessException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final InvocationTargetException e) {
+      } catch (final IllegalArgumentException | InvocationTargetException | IllegalAccessException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
       }
-      return value;
+       return value;
    }
 
    public static float getFloat(Object _object, long _offset) {
       float value = 0;
       try {
          value = (Float) getFloatMethod.invoke(unsafe, _object, _offset);
-      } catch (final IllegalArgumentException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final IllegalAccessException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final InvocationTargetException e) {
+      } catch (final IllegalArgumentException | InvocationTargetException | IllegalAccessException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
       }
-      return value;
+       return value;
    }
 
    public static byte getByte(Object _object, long _offset) {
       byte value = 0;
       try {
          value = (Byte) getByteMethod.invoke(unsafe, _object, _offset);
-      } catch (final IllegalArgumentException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final IllegalAccessException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final InvocationTargetException e) {
+      } catch (final IllegalArgumentException | InvocationTargetException | IllegalAccessException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
       }
-      return value;
+       return value;
    }
 
    public static boolean getBoolean(Object _object, long _offset) {
       boolean value = false;
       try {
          value = (Boolean) getBooleanMethod.invoke(unsafe, _object, _offset);
-      } catch (final IllegalArgumentException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final IllegalAccessException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final InvocationTargetException e) {
+      } catch (final IllegalArgumentException | InvocationTargetException | IllegalAccessException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
       }
-      return value;
+       return value;
    }
 
    public static long getLong(Object _object, long _offset) {
       long value = 0;
       try {
          value = (Long) getLongMethod.invoke(unsafe, _object, _offset);
-      } catch (final IllegalArgumentException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final IllegalAccessException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final InvocationTargetException e) {
+      } catch (final IllegalArgumentException | InvocationTargetException | IllegalAccessException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
       }
-      return value;
+       return value;
    }
 
    public static void putBoolean(Object _object, long _offset, boolean _boolean) {
       try {
          putBooleanMethod.invoke(unsafe, _object, _offset, _boolean);
-      } catch (final IllegalArgumentException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final IllegalAccessException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final InvocationTargetException e) {
+      } catch (final IllegalArgumentException | InvocationTargetException | IllegalAccessException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
       }
@@ -337,13 +262,7 @@ public class UnsafeWrapper{
    public static void putFloat(Object _object, long _offset, float _float) {
       try {
          putFloatMethod.invoke(unsafe, _object, _offset, _float);
-      } catch (final IllegalArgumentException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final IllegalAccessException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final InvocationTargetException e) {
+      } catch (final IllegalArgumentException | InvocationTargetException | IllegalAccessException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
       }
@@ -352,13 +271,7 @@ public class UnsafeWrapper{
    public static void putInt(Object _object, long _offset, int _int) {
       try {
          putIntMethod.invoke(unsafe, _object, _offset, _int);
-      } catch (final IllegalArgumentException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final IllegalAccessException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final InvocationTargetException e) {
+      } catch (final IllegalArgumentException | InvocationTargetException | IllegalAccessException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
       }
@@ -367,13 +280,7 @@ public class UnsafeWrapper{
    public static void putDouble(Object _object, long _offset, double _double) {
       try {
          putDoubleMethod.invoke(unsafe, _object, _offset, _double);
-      } catch (final IllegalArgumentException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final IllegalAccessException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final InvocationTargetException e) {
+      } catch (final IllegalArgumentException | InvocationTargetException | IllegalAccessException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
       }
@@ -382,13 +289,7 @@ public class UnsafeWrapper{
    public static void putByte(Object _object, long _offset, byte _byte) {
       try {
          putByteMethod.invoke(unsafe, _object, _offset, _byte);
-      } catch (final IllegalArgumentException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final IllegalAccessException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final InvocationTargetException e) {
+      } catch (final IllegalArgumentException | InvocationTargetException | IllegalAccessException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
       }
@@ -397,32 +298,20 @@ public class UnsafeWrapper{
    public static void putLong(Object _object, long _offset, long _long) {
       try {
          putLongMethod.invoke(unsafe, _object, _offset, _long);
-      } catch (final IllegalArgumentException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final IllegalAccessException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final InvocationTargetException e) {
+      } catch (final IllegalArgumentException | InvocationTargetException | IllegalAccessException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
       }
    }
 
    public static long objectFieldOffset(Field _field) {
-      long offset = 0l;
+      long offset = 0L;
       try {
          offset = (Long) objectFieldOffsetMethod.invoke(unsafe, _field);
-      } catch (final IllegalArgumentException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final IllegalAccessException e) {
-         // TODO Auto-generated catch block
-         e.printStackTrace();
-      } catch (final InvocationTargetException e) {
+      } catch (final IllegalArgumentException | InvocationTargetException | IllegalAccessException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
       }
-      return offset;
+       return offset;
    }
 }
diff --git a/src/main/java/com/aparapi/internal/writer/BlockWriter.java b/src/main/java/com/aparapi/internal/writer/BlockWriter.java
index b43fa98a7320903f6d13741ad9ba1fbc16eb7ba3..992651c5c8313c04ea40327f2ede74814919fe03 100644
--- a/src/main/java/com/aparapi/internal/writer/BlockWriter.java
+++ b/src/main/java/com/aparapi/internal/writer/BlockWriter.java
@@ -52,19 +52,22 @@ under those regulations, please refer to the U.S. Bureau of Industry and Securit
 */
 package com.aparapi.internal.writer;
 
-import com.aparapi.*;
-import com.aparapi.internal.exception.*;
-import com.aparapi.internal.instruction.*;
+import com.aparapi.Config;
+import com.aparapi.internal.exception.CodeGenException;
+import com.aparapi.internal.instruction.BranchSet;
+import com.aparapi.internal.instruction.BranchSet.CompoundLogicalExpressionNode;
 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.BranchSet.SimpleLogicalExpressionNode;
+import com.aparapi.internal.instruction.Instruction;
 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.FieldEntry;
+import com.aparapi.internal.model.ClassModel.ConstantPool.MethodEntry;
 import com.aparapi.internal.model.ClassModel.ConstantPool.NameAndTypeEntry;
+import com.aparapi.internal.model.ClassModel.LocalVariableInfo;
+import com.aparapi.internal.model.Entrypoint;
+import com.aparapi.internal.model.MethodModel;
 
-import java.util.*;
+import java.util.Stack;
 
 /**
  * Base abstract class for converting <code>Aparapi</code> IR to text.<br/>
@@ -283,7 +286,7 @@ public abstract class BlockWriter{
          Instruction blockEnd = instruction.getLastChild();
          writeBlock(blockStart, blockEnd);
          write("while(");
-         writeConditional(((CompositeInstruction) instruction).getBranchSet(), true);
+         writeConditional(instruction.getBranchSet(), true);
          write(");");
          newLine();
       }
@@ -475,7 +478,7 @@ public abstract class BlockWriter{
          if (accessField instanceof AccessInstanceField) {
             Instruction accessInstanceField = ((AccessInstanceField) accessField).getInstance();
             if (accessInstanceField instanceof CloneInstruction) {
-               accessInstanceField = ((CloneInstruction) accessInstanceField).getReal();
+               accessInstanceField = accessInstanceField.getReal();
             }
             if (!(accessInstanceField instanceof I_ALOAD_0)) {
                writeInstruction(accessInstanceField);
@@ -650,7 +653,7 @@ public abstract class BlockWriter{
          AssignToLocalVariable from = (AssignToLocalVariable) multiAssignInstruction.getFrom();
          final AssignToLocalVariable last = (AssignToLocalVariable) multiAssignInstruction.getTo();
          final Instruction common = multiAssignInstruction.getCommon();
-         final Stack<AssignToLocalVariable> stack = new Stack<AssignToLocalVariable>();
+         final Stack<AssignToLocalVariable> stack = new Stack<>();
 
          while (from != last) {
             stack.push(from);
diff --git a/src/main/java/com/aparapi/internal/writer/KernelWriter.java b/src/main/java/com/aparapi/internal/writer/KernelWriter.java
index 9de60797fe910db5286496dfa8984c9b8095b138..8e8b21c46b09186750d9934d1a20b94f3b1a3fdd 100644
--- a/src/main/java/com/aparapi/internal/writer/KernelWriter.java
+++ b/src/main/java/com/aparapi/internal/writer/KernelWriter.java
@@ -52,17 +52,27 @@ under those regulations, please refer to the U.S. Bureau of Industry and Securit
  */
 package com.aparapi.internal.writer;
 
-import com.aparapi.*;
-import com.aparapi.internal.exception.*;
-import com.aparapi.internal.instruction.*;
+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.*;
-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.*;
+import com.aparapi.internal.model.ClassModel;
+import com.aparapi.internal.model.ClassModel.AttributePool.RuntimeAnnotationsEntry;
+import com.aparapi.internal.model.ClassModel.AttributePool.RuntimeAnnotationsEntry.AnnotationInfo;
+import com.aparapi.internal.model.ClassModel.ClassModelField;
+import com.aparapi.internal.model.ClassModel.ConstantPool.FieldEntry;
+import com.aparapi.internal.model.ClassModel.ConstantPool.MethodEntry;
+import com.aparapi.internal.model.ClassModel.LocalVariableInfo;
+import com.aparapi.internal.model.ClassModel.LocalVariableTableEntry;
+import com.aparapi.internal.model.Entrypoint;
+import com.aparapi.internal.model.MethodModel;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 public abstract class KernelWriter extends BlockWriter{
 
@@ -97,8 +107,8 @@ public abstract class KernelWriter extends BlockWriter{
 
    private Entrypoint entryPoint = null;
 
-   public final static Map<String, String> javaToCLIdentifierMap = new HashMap<String, String>();
-   {
+   public final static Map<String, String> javaToCLIdentifierMap = new HashMap<>();
+   static {
       javaToCLIdentifierMap.put("getGlobalId()I", "get_global_id(0)");
       javaToCLIdentifierMap.put("getGlobalId(I)I", "get_global_id"); // no parenthesis if we are conveying args
       javaToCLIdentifierMap.put("getGlobalX()I", "get_global_id(0)");
@@ -152,28 +162,40 @@ public abstract class KernelWriter extends BlockWriter{
     * @return Suitably converted string, "char*", etc
     */
    @Override public String convertType(String _typeDesc, boolean useClassModel) {
-      if (_typeDesc.equals("Z") || _typeDesc.equals("boolean")) {
-         return (cvtBooleanToChar);
-      } else if (_typeDesc.equals("[Z") || _typeDesc.equals("boolean[]")) {
-         return (cvtBooleanArrayToCharStar);
-      } else if (_typeDesc.equals("B") || _typeDesc.equals("byte")) {
-         return (cvtByteToChar);
-      } else if (_typeDesc.equals("[B") || _typeDesc.equals("byte[]")) {
-         return (cvtByteArrayToCharStar);
-      } else if (_typeDesc.equals("C") || _typeDesc.equals("char")) {
-         return (cvtCharToShort);
-      } else if (_typeDesc.equals("[C") || _typeDesc.equals("char[]")) {
-         return (cvtCharArrayToShortStar);
-      } else if (_typeDesc.equals("[I") || _typeDesc.equals("int[]")) {
-         return (cvtIntArrayToIntStar);
-      } else if (_typeDesc.equals("[F") || _typeDesc.equals("float[]")) {
-         return (cvtFloatArrayToFloatStar);
-      } else if (_typeDesc.equals("[D") || _typeDesc.equals("double[]")) {
-         return (cvtDoubleArrayToDoubleStar);
-      } else if (_typeDesc.equals("[J") || _typeDesc.equals("long[]")) {
-         return (cvtLongArrayToLongStar);
-      } else if (_typeDesc.equals("[S") || _typeDesc.equals("short[]")) {
-         return (cvtShortArrayToShortStar);
+      switch (_typeDesc) {
+         case "Z":
+         case "boolean":
+            return (cvtBooleanToChar);
+         case "[Z":
+         case "boolean[]":
+            return (cvtBooleanArrayToCharStar);
+         case "B":
+         case "byte":
+            return (cvtByteToChar);
+         case "[B":
+         case "byte[]":
+            return (cvtByteArrayToCharStar);
+         case "C":
+         case "char":
+            return (cvtCharToShort);
+         case "[C":
+         case "char[]":
+            return (cvtCharArrayToShortStar);
+         case "[I":
+         case "int[]":
+            return (cvtIntArrayToIntStar);
+         case "[F":
+         case "float[]":
+            return (cvtFloatArrayToFloatStar);
+         case "[D":
+         case "double[]":
+            return (cvtDoubleArrayToDoubleStar);
+         case "[J":
+         case "long[]":
+            return (cvtLongArrayToLongStar);
+         case "[S":
+         case "short[]":
+            return (cvtShortArrayToShortStar);
       }
       // if we get this far, we haven't matched anything yet
       if (useClassModel) {
@@ -301,9 +323,9 @@ public abstract class KernelWriter extends BlockWriter{
          + ";";
 
    @Override public void write(Entrypoint _entryPoint) throws CodeGenException {
-      final List<String> thisStruct = new ArrayList<String>();
-      final List<String> argLines = new ArrayList<String>();
-      final List<String> assigns = new ArrayList<String>();
+      final List<String> thisStruct = new ArrayList<>();
+      final List<String> argLines = new ArrayList<>();
+      final List<String> assigns = new ArrayList<>();
 
       entryPoint = _entryPoint;
 
@@ -352,9 +374,9 @@ public abstract class KernelWriter extends BlockWriter{
          //if we have a multiple dimensional array we want to remember the number of dimensions
          while (signature.startsWith("[")) {
             if (isPointer == false) {
-               argLine.append(argType + " ");
+               argLine.append(argType).append(" ");
                if (!(type.equals(__private) && IMPLICIT_PRIVATE_FIELDS)) {
-                  thisStructLine.append(type + " ");
+                  thisStructLine.append(type).append(" ");
                }
             }
             isPointer = true;
@@ -417,14 +439,14 @@ public abstract class KernelWriter extends BlockWriter{
                String suffix = numDimensions == 1 ? "" : Integer.toString(i);
                String lenName = field.getName() + BlockWriter.arrayLengthMangleSuffix + suffix;
 
-               lenStructLine.append("int " + lenName);
+               lenStructLine.append("int ").append(lenName);
 
                lenAssignLine.append("this->");
                lenAssignLine.append(lenName);
                lenAssignLine.append(" = ");
                lenAssignLine.append(lenName);
 
-               lenArgLine.append("int " + lenName);
+               lenArgLine.append("int ").append(lenName);
 
                assigns.add(lenAssignLine.toString());
                argLines.add(lenArgLine.toString());
@@ -436,14 +458,14 @@ public abstract class KernelWriter extends BlockWriter{
                   final StringBuilder dimAssignLine = new StringBuilder();
                   String dimName = field.getName() + BlockWriter.arrayDimMangleSuffix + suffix;
 
-                  dimStructLine.append("int " + dimName);
+                  dimStructLine.append("int ").append(dimName);
 
                   dimAssignLine.append("this->");
                   dimAssignLine.append(dimName);
                   dimAssignLine.append(" = ");
                   dimAssignLine.append(dimName);
 
-                  dimArgLine.append("int " + dimName);
+                  dimArgLine.append("int ").append(dimName);
 
                   assigns.add(dimAssignLine.toString());
                   argLines.add(dimArgLine.toString());
@@ -509,11 +531,9 @@ public abstract class KernelWriter extends BlockWriter{
             int totalSize = 0;
             int alignTo = 0;
 
-            final Iterator<FieldEntry> it = fieldSet.iterator();
-            while (it.hasNext()) {
-               final FieldEntry field = it.next();
+            for (FieldEntry field : fieldSet) {
                final String fType = field.getNameAndTypeEntry().getDescriptorUTF8Entry().getUTF8();
-               final int fSize = InstructionSet.TypeSpec.valueOf(fType.equals("Z") ? "B" : fType).getSize();
+               final int fSize = TypeSpec.valueOf(fType.equals("Z") ? "B" : fType).getSize();
 
                if (fSize > alignTo) {
                   alignTo = fSize;
@@ -723,13 +743,7 @@ public abstract class KernelWriter extends BlockWriter{
             openCLStringBuilder.append(_string);
          }
       };
-      try {
-         openCLWriter.write(_entrypoint);
-      } catch (final CodeGenException codeGenException) {
-         throw codeGenException;
-      }/* catch (final Throwable t) {
-         throw new CodeGenException(t);
-       }*/
+      openCLWriter.write(_entrypoint);
 
       return (openCLStringBuilder.toString());
    }
diff --git a/src/main/java/com/aparapi/opencl/OpenCL.java b/src/main/java/com/aparapi/opencl/OpenCL.java
index f15e0d2a0b1db8f48de6d1e23dfba27960f2b2dd..b3c7e8e35df43bc4e2d3cfedb7449abf0f07b7e8 100644
--- a/src/main/java/com/aparapi/opencl/OpenCL.java
+++ b/src/main/java/com/aparapi/opencl/OpenCL.java
@@ -16,6 +16,7 @@
 package com.aparapi.opencl;
 
 import com.aparapi.ProfileInfo;
+
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
@@ -24,105 +25,116 @@ import java.util.List;
 
 public interface OpenCL<T> {
 
-   public static final String CL_KHR_FP64 = "cl_khr_fp64";
+   String CL_KHR_FP64 = "cl_khr_fp64";
 
-   public static final String CL_KHR_SELECT_FPROUNDING_MODE = "cl_khr_select_fprounding_mode";
+   String CL_KHR_SELECT_FPROUNDING_MODE = "cl_khr_select_fprounding_mode";
 
-   public static final String CL_KHR_GLOBAL_INT32_BASE_ATOMICS = "cl_khr_global_int32_base_atomics";
+   String CL_KHR_GLOBAL_INT32_BASE_ATOMICS = "cl_khr_global_int32_base_atomics";
 
-   public static final String CL_KHR_GLOBAL_INT32_EXTENDED_ATOMICS = "cl_khr_global_int32_extended_atomics";
+   String CL_KHR_GLOBAL_INT32_EXTENDED_ATOMICS = "cl_khr_global_int32_extended_atomics";
 
-   public static final String CL_KHR_LOCAL_INT32_BASE_ATOMICS = "cl_khr_local_int32_base_atomics";
+   String CL_KHR_LOCAL_INT32_BASE_ATOMICS = "cl_khr_local_int32_base_atomics";
 
-   public static final String CL_KHR_LOCAL_INT32_EXTENDED_ATOMICS = "cl_khr_local_int32_extended_atomics";
+   String CL_KHR_LOCAL_INT32_EXTENDED_ATOMICS = "cl_khr_local_int32_extended_atomics";
 
-   public static final String CL_KHR_INT64_BASE_ATOMICS = "cl_khr_int64_base_atomics";
+   String CL_KHR_INT64_BASE_ATOMICS = "cl_khr_int64_base_atomics";
 
-   public static final String CL_KHR_INT64_EXTENDED_ATOMICS = "cl_khr_int64_extended_atomics";
+   String CL_KHR_INT64_EXTENDED_ATOMICS = "cl_khr_int64_extended_atomics";
 
-   public static final String CL_KHR_3D_IMAGE_WRITES = "cl_khr_3d_image_writes";
+   String CL_KHR_3D_IMAGE_WRITES = "cl_khr_3d_image_writes";
 
-   public static final String CL_KHR_BYTE_ADDRESSABLE_SUPPORT = "cl_khr_byte_addressable_store";
+   String CL_KHR_BYTE_ADDRESSABLE_SUPPORT = "cl_khr_byte_addressable_store";
 
-   public static final String CL_KHR_FP16 = "cl_khr_fp16";
+   String CL_KHR_FP16 = "cl_khr_fp16";
 
-   public static final String CL_KHR_GL_SHARING = "cl_khr_gl_sharing";
+   String CL_KHR_GL_SHARING = "cl_khr_gl_sharing";
 
-   @Target(ElementType.PARAMETER) @Retention(RetentionPolicy.RUNTIME) public @interface Put {
+   @Target(ElementType.PARAMETER) @Retention(RetentionPolicy.RUNTIME)
+   @interface Put {
    }
 
-   @Target(ElementType.PARAMETER) @Retention(RetentionPolicy.RUNTIME) public @interface Get {
+   @Target(ElementType.PARAMETER) @Retention(RetentionPolicy.RUNTIME)
+   @interface Get {
    }
 
-   @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface Source {
+   @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME)
+   @interface Source {
       String value();
    }
 
-   @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface Resource {
+   @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME)
+   @interface Resource {
       String value();
    }
 
-   @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) public @interface Kernel {
+   @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME)
+   @interface Kernel {
       String value();
    }
 
-   @Target(ElementType.PARAMETER) @Retention(RetentionPolicy.RUNTIME) public @interface Arg {
+   @Target(ElementType.PARAMETER) @Retention(RetentionPolicy.RUNTIME)
+   @interface Arg {
       String value();
    }
 
-   @Target(ElementType.PARAMETER) @Retention(RetentionPolicy.RUNTIME) public @interface GlobalReadWrite {
+   @Target(ElementType.PARAMETER) @Retention(RetentionPolicy.RUNTIME)
+   @interface GlobalReadWrite {
       String value();
    }
 
-   @Target(ElementType.PARAMETER) @Retention(RetentionPolicy.RUNTIME) public @interface GlobalReadOnly {
+   @Target(ElementType.PARAMETER) @Retention(RetentionPolicy.RUNTIME)
+   @interface GlobalReadOnly {
       String value();
    }
 
-   @Target(ElementType.PARAMETER) @Retention(RetentionPolicy.RUNTIME) public @interface GlobalWriteOnly {
+   @Target(ElementType.PARAMETER) @Retention(RetentionPolicy.RUNTIME)
+   @interface GlobalWriteOnly {
       String value();
    }
 
-   @Target(ElementType.PARAMETER) @Retention(RetentionPolicy.RUNTIME) public @interface Local {
+   @Target(ElementType.PARAMETER) @Retention(RetentionPolicy.RUNTIME)
+   @interface Local {
       String value();
    }
 
-   @Target(ElementType.PARAMETER) @Retention(RetentionPolicy.RUNTIME) public @interface Constant {
+   @Target(ElementType.PARAMETER) @Retention(RetentionPolicy.RUNTIME)
+   @interface Constant {
       String value();
    }
 
-   public T put(float[] array);
+   T put(float[] array);
 
-   public T put(int[] array);
+   T put(int[] array);
 
-   public T put(short[] array);
+   T put(short[] array);
 
-   public T put(byte[] array);
+   T put(byte[] array);
 
-   public T put(char[] array);
+   T put(char[] array);
 
-   public T put(boolean[] array);
+   T put(boolean[] array);
 
-   public T put(double[] array);
+   T put(double[] array);
 
-   public T get(float[] array);
+   T get(float[] array);
 
-   public T get(int[] array);
+   T get(int[] array);
 
-   public T get(short[] array);
+   T get(short[] array);
 
-   public T get(char[] array);
+   T get(char[] array);
 
-   public T get(boolean[] array);
+   T get(boolean[] array);
 
-   public T get(double[] array);
+   T get(double[] array);
 
-   public T get(byte[] array);
+   T get(byte[] array);
 
-   public T begin();
+   T begin();
 
-   public T end();
+   T end();
 
-   public T dispose();
+   T dispose();
 
-   public List<ProfileInfo> getProfileInfo();
+   List<ProfileInfo> getProfileInfo();
 }
diff --git a/src/main/java/com/aparapi/opencl/OpenCLAdapter.java b/src/main/java/com/aparapi/opencl/OpenCLAdapter.java
index 50695c344ca77b891c2e94618b0ab15ce588d3e7..07226ab1a1e28b0acbeb832dc4c1c6eadd8096ac 100644
--- a/src/main/java/com/aparapi/opencl/OpenCLAdapter.java
+++ b/src/main/java/com/aparapi/opencl/OpenCLAdapter.java
@@ -16,6 +16,7 @@
 package com.aparapi.opencl;
 
 import com.aparapi.ProfileInfo;
+
 import java.util.ArrayList;
 import java.util.List;
 
@@ -90,7 +91,7 @@ public class OpenCLAdapter<T> implements OpenCL<T>{
    }
 
    public List<ProfileInfo> getProfileInfo(){
-       return(new ArrayList<ProfileInfo>());
+       return(new ArrayList<>());
    }
 
 }
diff --git a/src/main/java/com/aparapi/util/swing/MultiPassKernelSwingWorker.java b/src/main/java/com/aparapi/util/swing/MultiPassKernelSwingWorker.java
index 96bbafd8a46103f668de70227247d50b0c9a68d7..a67dca736fd9b9ecf3c28ae1f8d3d4ff595172b4 100644
--- a/src/main/java/com/aparapi/util/swing/MultiPassKernelSwingWorker.java
+++ b/src/main/java/com/aparapi/util/swing/MultiPassKernelSwingWorker.java
@@ -29,7 +29,7 @@ public abstract class MultiPassKernelSwingWorker extends SwingWorker<Void, Void>
 
    public static final int DEFAULT_POLL_INTERVAL = 50;
 
-   private Kernel kernel;
+   private final Kernel kernel;
    private Timer timer;
 
    protected MultiPassKernelSwingWorker(Kernel kernel) {
diff --git a/src/test/java/ConvolutionLargeTest.java b/src/test/java/ConvolutionLargeTest.java
index 8056314c4ea8740ccce3e9149215c7ce0d966d93..6854d764e8c092632b04a8b170be14449dfa4bfc 100644
--- a/src/test/java/ConvolutionLargeTest.java
+++ b/src/test/java/ConvolutionLargeTest.java
@@ -51,14 +51,14 @@ under those regulations, please refer to the U.S. Bureau of Industry and Securit
 
  */
 
-import java.io.IOException;
-import java.text.MessageFormat;
-import java.util.concurrent.TimeUnit;
-
 import com.aparapi.Kernel;
 import com.aparapi.internal.model.CacheEnabler;
 import com.aparapi.internal.model.Supplier;
 
+import java.io.IOException;
+import java.text.MessageFormat;
+import java.util.concurrent.TimeUnit;
+
 public class ConvolutionLargeTest{
 
    private byte[] inBytes;
@@ -69,9 +69,9 @@ public class ConvolutionLargeTest{
 
    private int height;
 
-   private float _convMatrix3x3[];
+   private final float[] _convMatrix3x3;
 
-   public ConvolutionLargeTest(String[] _args) throws IOException {
+   public ConvolutionLargeTest(String[] _args) {
       //      final File _file = new File(_args.length == 1 ? _args[0] : "testcard.jpg");
 
       _convMatrix3x3 = new float[] {
@@ -124,7 +124,7 @@ public class ConvolutionLargeTest{
          System.out.println("-----------------------------");
          System.out.println();
          testWithSupplier(new ImageConvolutionCreationContext(){
-            private ImageConvolution convolution = new ImageConvolution();
+            private final ImageConvolution convolution = new ImageConvolution();
 
             @Override public Supplier<ImageConvolution> getSupplier() {
                return new Supplier<ImageConvolution>(){