diff --git a/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ApexDeploymentRestResource.java b/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ApexDeploymentRestResource.java
index 13192aa..18aae50 100644
--- a/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ApexDeploymentRestResource.java
+++ b/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ApexDeploymentRestResource.java
@@ -88,9 +88,9 @@
         final JsonObject responseObject = new JsonObject();
 
         // Engine Service data
-        responseObject.addProperty("engine_id", engineServiceFacade.getKey().getID());
+        responseObject.addProperty("engine_id", engineServiceFacade.getKey().getId());
         responseObject.addProperty("model_id",
-                engineServiceFacade.getApexModelKey() != null ? engineServiceFacade.getApexModelKey().getID()
+                engineServiceFacade.getApexModelKey() != null ? engineServiceFacade.getApexModelKey().getId()
                         : "Not Set");
         responseObject.addProperty("server", hostName);
         responseObject.addProperty("port", Integer.toString(port));
@@ -132,16 +132,16 @@
             engineServiceFacade.deployModel(fileDetail.getFileName(), uploadedInputStream, ignoreConflicts,
                     forceUpdate);
         } catch (final Exception e) {
-            LOGGER.warn("Error updating model on engine service " + engineServiceFacade.getKey().getID(), e);
+            LOGGER.warn("Error updating model on engine service " + engineServiceFacade.getKey().getId(), e);
             final String errorMessage =
-                    "Error updating model on engine service " + engineServiceFacade.getKey().getID();
+                    "Error updating model on engine service " + engineServiceFacade.getKey().getId();
             LOGGER.warn(errorMessage + "<br>", e);
             return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errorMessage + "\n" + e.getMessage())
                     .build();
         }
 
         return Response.ok("Model " + fileDetail.getFileName() + " deployed on engine service "
-                + engineServiceFacade.getKey().getID()).build();
+                + engineServiceFacade.getKey().getId()).build();
     }
 
 }
diff --git a/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ParameterCheck.java b/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ParameterCheck.java
index 50117e5..b68ffeb 100644
--- a/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ParameterCheck.java
+++ b/client/client-deployment/src/main/java/org/onap/policy/apex/client/deployment/rest/ParameterCheck.java
@@ -154,7 +154,7 @@
      */
     public static ParameterCheck.StartStop getStartStop(final Map<String, String[]> parameterMap,
             final AxArtifactKey engineKey) {
-        final String startStopPar = AXARTIFACTKEY_PAR + '#' + engineKey.getID();
+        final String startStopPar = AXARTIFACTKEY_PAR + '#' + engineKey.getId();
         if (!parameterMap.containsKey(startStopPar)) {
             LOGGER.warn("parameter \"" + startStopPar + "\" not found");
             return null;
diff --git a/client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/RestInterfaceTest.java b/client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/RestInterfaceTest.java
index 4893775..012167b 100644
--- a/client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/RestInterfaceTest.java
+++ b/client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/RestInterfaceTest.java
@@ -108,7 +108,7 @@
         localmodel = new ApexModelReader<>(AxPolicyModel.class, false)
                 .read(ResourceUtils.getResourceAsStream(TESTMODELFILE));
         localmodelString =
-                new ApexModelStringWriter<AxPolicyModel>(false).writeJSONString(localmodel, AxPolicyModel.class);
+                new ApexModelStringWriter<AxPolicyModel>(false).writeJsonString(localmodel, AxPolicyModel.class);
 
         // initialize a session ID
         createNewSession();
@@ -195,7 +195,7 @@
 
         // Write that local copy of the AxPolicy object to a Json String, ten parse it again
         final ApexModelStringWriter<AxPolicy> apexModelWriter = new ApexModelStringWriter<>(false);
-        final String localPolicyString = apexModelWriter.writeJSONString(localpolicy, AxPolicy.class);
+        final String localPolicyString = apexModelWriter.writeJsonString(localpolicy, AxPolicy.class);
         apexPolicyReader = new ApexModelReader<>(AxPolicy.class, false);
         final AxPolicy localpolicyReparsed = apexPolicyReader.read(localPolicyString);
         // AxPolicy localpolicy_reparsed = RestUtils.getConceptFromJSON(returnedPolicyAsString, AxPolicy.class);
diff --git a/client/client-full/src/main/java/org/onap/policy/apex/client/full/rest/ParameterCheck.java b/client/client-full/src/main/java/org/onap/policy/apex/client/full/rest/ParameterCheck.java
index 8e7cbea..d7b7229 100644
--- a/client/client-full/src/main/java/org/onap/policy/apex/client/full/rest/ParameterCheck.java
+++ b/client/client-full/src/main/java/org/onap/policy/apex/client/full/rest/ParameterCheck.java
@@ -154,7 +154,7 @@
      */
     public static ParameterCheck.StartStop getStartStop(final Map<String, String[]> parameterMap,
             final AxArtifactKey engineKey) {
-        final String startStopPar = AXARTIFACTKEY_PAR + '#' + engineKey.getID();
+        final String startStopPar = AXARTIFACTKEY_PAR + '#' + engineKey.getId();
         if (!parameterMap.containsKey(startStopPar)) {
             LOGGER.warn("parameter \"" + startStopPar + "\" not found");
             return null;
diff --git a/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRestResource.java b/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRestResource.java
index 6a614f3..85465a1 100644
--- a/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRestResource.java
+++ b/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ApexMonitoringRestResource.java
@@ -105,9 +105,9 @@
         final JsonObject responseObject = new JsonObject();
 
         // Engine Service data
-        responseObject.addProperty("engine_id", engineServiceFacade.getKey().getID());
+        responseObject.addProperty("engine_id", engineServiceFacade.getKey().getId());
         responseObject.addProperty("model_id",
-                engineServiceFacade.getApexModelKey() != null ? engineServiceFacade.getApexModelKey().getID()
+                engineServiceFacade.getApexModelKey() != null ? engineServiceFacade.getApexModelKey().getId()
                         : "Not Set");
         responseObject.addProperty("server", hostName);
         responseObject.addProperty("port", Integer.toString(port));
@@ -121,23 +121,23 @@
                 final JsonObject engineStatusObject = new JsonObject();
                 final AxEngineModel axEngineModel = engineServiceFacade.getEngineStatus(engineKey);
                 engineStatusObject.addProperty("timestamp", axEngineModel.getTimeStampString());
-                engineStatusObject.addProperty("id", engineKey.getID());
+                engineStatusObject.addProperty("id", engineKey.getId());
                 engineStatusObject.addProperty("status", axEngineModel.getState().toString());
                 engineStatusObject.addProperty("last_message", axEngineModel.getStats().getTimeStampString());
                 engineStatusObject.addProperty("up_time", axEngineModel.getStats().getUpTime() / 1000L);
                 engineStatusObject.addProperty("policy_executions", axEngineModel.getStats().getEventCount());
                 engineStatusObject.addProperty("last_policy_duration",
                         gson.toJson(
-                                getValuesFromCache(host, engineKey.getID() + "_last_policy_duration",
+                                getValuesFromCache(host, engineKey.getId() + "_last_policy_duration",
                                         axEngineModel.getTimestamp(), axEngineModel.getStats().getLastExecutionTime()),
                                 List.class));
                 engineStatusObject.addProperty("average_policy_duration",
-                        gson.toJson(getValuesFromCache(host, engineKey.getID() + "_average_policy_duration",
+                        gson.toJson(getValuesFromCache(host, engineKey.getId() + "_average_policy_duration",
                                 axEngineModel.getTimestamp(),
                                 (long) axEngineModel.getStats().getAverageExecutionTime()), List.class));
                 engineStatusList.add(engineStatusObject);
             } catch (final ApexException e) {
-                LOGGER.warn("Error getting status of engine with ID " + engineKey.getID() + "<br>", e);
+                LOGGER.warn("Error getting status of engine with ID " + engineKey.getId() + "<br>", e);
             }
         }
         responseObject.add("status", engineStatusList);
@@ -149,12 +149,12 @@
                 final String engineInfo = engineServiceFacade.getEngineInfo(engineKey);
                 if (engineInfo != null && !engineInfo.trim().isEmpty()) {
                     final JsonObject engineContextObject = new JsonObject();
-                    engineContextObject.addProperty("id", engineKey.getID());
+                    engineContextObject.addProperty("id", engineKey.getId());
                     engineContextObject.addProperty("engine_info", engineInfo);
                     engineContextList.add(engineContextObject);
                 }
             } catch (final ApexException e) {
-                LOGGER.warn("Error getting runtime information of engine with ID " + engineKey.getID() + "<br>", e);
+                LOGGER.warn("Error getting runtime information of engine with ID " + engineKey.getId() + "<br>", e);
             }
         }
         responseObject.add("context", engineContextList);
diff --git a/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ParameterCheck.java b/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ParameterCheck.java
index 5bc40c8..c8eb5ad 100644
--- a/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ParameterCheck.java
+++ b/client/client-monitoring/src/main/java/org/onap/policy/apex/client/monitoring/rest/ParameterCheck.java
@@ -154,7 +154,7 @@
      */
     public static ParameterCheck.StartStop getStartStop(final Map<String, String[]> parameterMap,
             final AxArtifactKey engineKey) {
-        final String startStopPar = AXARTIFACTKEY_PAR + '#' + engineKey.getID();
+        final String startStopPar = AXARTIFACTKEY_PAR + '#' + engineKey.getId();
         if (!parameterMap.containsKey(startStopPar)) {
             LOGGER.warn("parameter \"" + startStopPar + "\" not found");
             return null;
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/ContextAlbumImpl.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/ContextAlbumImpl.java
index fbaeb2c..305f14c 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/ContextAlbumImpl.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/ContextAlbumImpl.java
@@ -290,7 +290,7 @@
     public Object get(final Object key) {
         if (key == null) {
             final String returnString =
-                    "album \"" + albumDefinition.getID() + "\" null keys are illegal on keys for get()";
+                    "album \"" + albumDefinition.getId() + "\" null keys are illegal on keys for get()";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
         }
@@ -365,20 +365,20 @@
     public Object put(final String key, final Object incomingValue) {
         if (key == null) {
             final String returnString =
-                    "album \"" + albumDefinition.getID() + "\" null keys are illegal on keys for put()";
+                    "album \"" + albumDefinition.getId() + "\" null keys are illegal on keys for put()";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
         }
 
         if (incomingValue == null) {
-            final String returnString = "album \"" + albumDefinition.getID() + "\" null values are illegal on key \""
+            final String returnString = "album \"" + albumDefinition.getId() + "\" null values are illegal on key \""
                     + key + "\" for put()";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
         }
 
         if (!albumDefinition.isWritable()) {
-            final String returnString = "album \"" + albumDefinition.getID()
+            final String returnString = "album \"" + albumDefinition.getId()
                     + "\" put() not allowed on read only albums for key=\"" + key + "\", value=\"" + incomingValue;
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
@@ -403,7 +403,7 @@
             return albumMap.put(key, valueToPut);
         } catch (final ContextRuntimeException e) {
             final String returnString = "Failed to set context value for key \"" + key + "\" in album \""
-                    + albumDefinition.getID() + "\": " + e.getMessage();
+                    + albumDefinition.getId() + "\": " + e.getMessage();
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString, e);
         }
@@ -418,7 +418,7 @@
     public void putAll(final Map<? extends String, ? extends Object> incomingContextAlbum) {
         if (!albumDefinition.isWritable()) {
             final String returnString =
-                    "album \"" + albumDefinition.getID() + "\" putAll() not allowed on read only albums";
+                    "album \"" + albumDefinition.getId() + "\" putAll() not allowed on read only albums";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
         }
@@ -454,7 +454,7 @@
     @Override
     public Object remove(final Object key) {
         if (!albumDefinition.isWritable()) {
-            final String returnString = "album \"" + albumDefinition.getID()
+            final String returnString = "album \"" + albumDefinition.getId()
                     + "\" remove() not allowed on read only albums for key=\"" + key + "\"";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
@@ -483,7 +483,7 @@
     public void clear() {
         if (!albumDefinition.isWritable()) {
             final String returnString =
-                    "album \"" + albumDefinition.getID() + "\" clear() not allowed on read only albums";
+                    "album \"" + albumDefinition.getId() + "\" clear() not allowed on read only albums";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
         }
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/AbstractDistributor.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/AbstractDistributor.java
index e5a45b2..e40646d 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/AbstractDistributor.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/AbstractDistributor.java
@@ -159,7 +159,7 @@
         // Get the context album definition
         final AxContextAlbum album = ModelService.getModel(AxContextAlbums.class).get(axContextAlbumKey);
         if (album == null) {
-            final String resultString = "context album " + axContextAlbumKey.getID() + " does not exist";
+            final String resultString = "context album " + axContextAlbumKey.getId() + " does not exist";
             LOGGER.warn(resultString);
             throw new ContextException(resultString);
         }
@@ -168,7 +168,7 @@
         final AxValidationResult result = album.validate(new AxValidationResult());
         if (!result.isValid()) {
             final String resultString =
-                    "context album definition for " + album.getKey().getID() + " is invalid" + result;
+                    "context album definition for " + album.getKey().getId() + " is invalid" + result;
             LOGGER.warn(resultString);
             throw new ContextException(resultString);
         }
@@ -176,8 +176,8 @@
         // Get the schema of the context album
         final AxContextSchema schema = ModelService.getModel(AxContextSchemas.class).get(album.getItemSchema());
         if (schema == null) {
-            final String resultString = "schema \"" + album.getItemSchema().getID() + "\" for context album "
-                    + album.getKey().getID() + " does not exist";
+            final String resultString = "schema \"" + album.getItemSchema().getId() + "\" for context album "
+                    + album.getKey().getId() + " does not exist";
             LOGGER.warn(resultString);
             throw new ContextException(resultString);
         }
@@ -266,7 +266,7 @@
     @Override
     public synchronized void lockForReading(final AxArtifactKey mapKey, final String itemKey) throws ContextException {
         // Lock using the lock manager
-        lockManager.lockForReading(mapKey.getID(), itemKey);
+        lockManager.lockForReading(mapKey.getId(), itemKey);
     }
 
     /*
@@ -277,7 +277,7 @@
     @Override
     public synchronized void lockForWriting(final AxArtifactKey mapKey, final String itemKey) throws ContextException {
         // Lock using the lock manager
-        lockManager.lockForWriting(mapKey.getID(), itemKey);
+        lockManager.lockForWriting(mapKey.getId(), itemKey);
     }
 
     /*
@@ -288,7 +288,7 @@
     @Override
     public void unlockForReading(final AxArtifactKey mapKey, final String itemKey) throws ContextException {
         // Unlock using the lock manager
-        lockManager.unlockForReading(mapKey.getID(), itemKey);
+        lockManager.unlockForReading(mapKey.getId(), itemKey);
     }
 
     /*
@@ -299,7 +299,7 @@
     @Override
     public void unlockForWriting(final AxArtifactKey mapKey, final String itemKey) throws ContextException {
         // Unlock using the lock manager
-        lockManager.unlockForWriting(mapKey.getID(), itemKey);
+        lockManager.unlockForWriting(mapKey.getId(), itemKey);
     }
 
     /*
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/DistributorFlushTimerTask.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/DistributorFlushTimerTask.java
index 19bb360..2c36618 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/DistributorFlushTimerTask.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/DistributorFlushTimerTask.java
@@ -68,7 +68,7 @@
         timer = new Timer(DistributorFlushTimerTask.class.getSimpleName(), true);
         timer.schedule(this, period, period);
 
-        LOGGER.debug("context distributor " + contextDistributor.getKey().getID() + " flushing set up with interval: "
+        LOGGER.debug("context distributor " + contextDistributor.getKey().getId() + " flushing set up with interval: "
                         + period + "ms");
     }
 
@@ -80,14 +80,14 @@
         // Increment the flush counter
         flushCount++;
 
-        LOGGER.debug("context distributor " + contextDistributor.getKey().getID() + " flushing: period=" + period
+        LOGGER.debug("context distributor " + contextDistributor.getKey().getId() + " flushing: period=" + period
                         + ": count=" + flushCount);
         try {
             contextDistributor.flush();
-            LOGGER.debug("context distributor " + contextDistributor.getKey().getID() + " flushed: period=" + period
+            LOGGER.debug("context distributor " + contextDistributor.getKey().getId() + " flushed: period=" + period
                             + ": count=" + flushCount);
         } catch (final ContextException e) {
-            LOGGER.error("flush error on context distributor " + contextDistributor.getKey().getID() + ": period="
+            LOGGER.error("flush error on context distributor " + contextDistributor.getKey().getId() + ": period="
                             + period + ": count=" + flushCount, e);
         }
     }
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/jvmlocal/JVMLocalDistributor.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/jvmlocal/JVMLocalDistributor.java
index dc66372..cb9a778 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/jvmlocal/JVMLocalDistributor.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/distribution/jvmlocal/JVMLocalDistributor.java
@@ -54,7 +54,7 @@
      */
     @Override
     public Map<String, Object> getContextAlbumMap(final AxArtifactKey contextMapKey) {
-        LOGGER.debug("create map: " + contextMapKey.getID());
+        LOGGER.debug("create map: " + contextMapKey.getId());
         return Collections.synchronizedMap(new HashMap<String, Object>());
     }
 
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/AbstractSchemaHelper.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/AbstractSchemaHelper.java
index 6ce924b..5513cc7 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/AbstractSchemaHelper.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/AbstractSchemaHelper.java
@@ -124,7 +124,7 @@
     public Object createNewInstance() {
         if (schemaClass == null) {
             final String returnString =
-                    userKey.getID() + ": could not create an instance, schema class for the schema is null";
+                    userKey.getId() + ": could not create an instance, schema class for the schema is null";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
         }
@@ -133,7 +133,7 @@
             return schemaClass.newInstance();
         } catch (final Exception e) {
             final String returnString =
-                    userKey.getID() + ": could not create an instance of class \"" + schemaClass.getCanonicalName()
+                    userKey.getId() + ": could not create an instance of class \"" + schemaClass.getCanonicalName()
                             + "\" using the default constructor \"" + schemaClass.getSimpleName() + "()\"";
             LOGGER.warn(returnString, e);
             throw new ContextRuntimeException(returnString, e);
@@ -149,7 +149,7 @@
     public Object createNewInstance(final String stringValue) {
         if (schemaClass == null) {
             final String returnString =
-                    userKey.getID() + ": could not create an instance, schema class for the schema is null";
+                    userKey.getId() + ": could not create an instance, schema class for the schema is null";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
         }
@@ -162,7 +162,7 @@
             return stringConstructor.newInstance(stringValue);
         } catch (final Exception e) {
             final String returnString =
-                    userKey.getID() + ": could not create an instance of class \"" + schemaClass.getCanonicalName()
+                    userKey.getId() + ": could not create an instance of class \"" + schemaClass.getCanonicalName()
                             + "\" using the string constructor \"" + schemaClass.getSimpleName() + "(String)\"";
             LOGGER.warn(returnString, e);
             throw new ContextRuntimeException(returnString);
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/SchemaHelperFactory.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/SchemaHelperFactory.java
index 84025fc..c6120c7 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/SchemaHelperFactory.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/SchemaHelperFactory.java
@@ -62,7 +62,7 @@
         final AxContextSchema schema = ModelService.getModel(AxContextSchemas.class).get(schemaKey);
         if (schema == null) {
             final String resultString =
-                    "schema \"" + schemaKey.getID() + "\" for entity " + owningEntityKey.getID() + " does not exist";
+                    "schema \"" + schemaKey.getId() + "\" for entity " + owningEntityKey.getId() + " does not exist";
             LOGGER.warn(resultString);
             throw new ContextRuntimeException(resultString);
         }
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/java/JavaSchemaHelper.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/java/JavaSchemaHelper.java
index 1bfe77a..c6a34e3 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/java/JavaSchemaHelper.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/java/JavaSchemaHelper.java
@@ -82,8 +82,8 @@
             setSchemaClass(TypeBuilder.getJavaTypeClass(schema.getSchema()));
         } catch (final IllegalArgumentException e) {
 
-            String resultSting = userKey.getID() + ": class/type " + schema.getSchema() + " for context schema \""
-                    + schema.getID() + "\" not found.";
+            String resultSting = userKey.getId() + ": class/type " + schema.getSchema() + " for context schema \""
+                    + schema.getId() + "\" not found.";
             if (JavaSchemaHelper.BUILT_IN_MAP.get(javatype) != null) {
                 resultSting += " Primitive types are not supported. Use the appropriate Java boxing type instead.";
             } else {
@@ -107,7 +107,7 @@
 
         if (getSchemaClass() == null) {
             final String returnString =
-                    getUserKey().getID() + ": could not create an instance, schema class for the schema is null";
+                    getUserKey().getId() + ": could not create an instance, schema class for the schema is null";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
         }
@@ -121,7 +121,7 @@
             return incomingObject;
         }
 
-        final String returnString = getUserKey().getID() + ": the object \"" + incomingObject + "\" of type \""
+        final String returnString = getUserKey().getId() + ": the object \"" + incomingObject + "\" of type \""
                 + incomingObject.getClass().getCanonicalName()
                 + "\" is not an instance of JsonObject and is not assignable to \""
                 + getSchemaClass().getCanonicalName() + "\"";
@@ -173,7 +173,7 @@
             // Use Gson to translate the object
             return new Gson().toJson(schemaObject);
         } else {
-            final String returnString = getUserKey().getID() + ": object \"" + schemaObject.toString()
+            final String returnString = getUserKey().getId() + ": object \"" + schemaObject.toString()
                     + "\" of class \"" + schemaObject.getClass().getCanonicalName() + "\" not compatible with class \""
                     + getSchemaClass().getCanonicalName() + "\"";
             LOGGER.warn(returnString);
@@ -232,7 +232,7 @@
             final Constructor<?> stringConstructor = getSchemaClass().getConstructor(String.class);
             return stringConstructor.newInstance(object.toString());
         } catch (final Exception e) {
-            final String returnString = getUserKey().getID() + ": object \"" + object.toString() + "\" of class \""
+            final String returnString = getUserKey().getId() + ": object \"" + object.toString() + "\" of class \""
                     + object.getClass().getCanonicalName() + "\" not compatible with class \""
                     + getSchemaClass().getCanonicalName() + "\"";
             LOGGER.warn(returnString);
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/monitoring/ContextMonitor.java b/context/context-management/src/main/java/org/onap/policy/apex/context/monitoring/ContextMonitor.java
index 8e34ecb..e3b3356 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/monitoring/ContextMonitor.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/monitoring/ContextMonitor.java
@@ -184,9 +184,9 @@
                     builder.append(',');
                 }
                 if (stackKey instanceof AxArtifactKey) {
-                    builder.append(((AxArtifactKey) stackKey).getID());
+                    builder.append(((AxArtifactKey) stackKey).getId());
                 } else if (stackKey instanceof AxReferenceKey) {
-                    builder.append(((AxReferenceKey) stackKey).getID());
+                    builder.append(((AxReferenceKey) stackKey).getId());
                 } else {
                     builder.append(stackKey.toString());
                 }
@@ -194,9 +194,9 @@
         }
         builder.append("],");
 
-        builder.append(albumKey.getID());
+        builder.append(albumKey.getId());
         builder.append(',');
-        builder.append(schemaKey.getID());
+        builder.append(schemaKey.getId());
         builder.append(',');
         builder.append(name);
 
diff --git a/context/context-management/src/test/java/org/onap/policy/apex/context/impl/ContextAlbumImplTest.java b/context/context-management/src/test/java/org/onap/policy/apex/context/impl/ContextAlbumImplTest.java
index 5f2b426..0208b7a 100644
--- a/context/context-management/src/test/java/org/onap/policy/apex/context/impl/ContextAlbumImplTest.java
+++ b/context/context-management/src/test/java/org/onap/policy/apex/context/impl/ContextAlbumImplTest.java
@@ -155,9 +155,9 @@
         ContextAlbum albumRo = new ContextAlbumImpl(axContextAlbumRo, distributor, new LinkedHashMap<String, Object>());
 
         assertEquals("TestContextAlbum", album.getName());
-        assertEquals("TestContextAlbum:0.0.1", album.getKey().getID());
-        assertEquals("TestContextAlbum:0.0.1", album.getAlbumDefinition().getID());
-        assertEquals("SimpleStringSchema:0.0.1", album.getSchemaHelper().getSchema().getID());
+        assertEquals("TestContextAlbum:0.0.1", album.getKey().getId());
+        assertEquals("TestContextAlbum:0.0.1", album.getAlbumDefinition().getId());
+        assertEquals("SimpleStringSchema:0.0.1", album.getSchemaHelper().getSchema().getId());
 
         try {
             album.containsKey(null);
@@ -272,8 +272,8 @@
 
         AxConcept[] userArtifactStack = { somePolicyKey, somePolicyState };
         album.setUserArtifactStack(userArtifactStack);
-        assertEquals("MyPolicy:0.0.1", album.getUserArtifactStack()[0].getID());
-        assertEquals("MyPolicy:0.0.1:NULL:SomeState", album.getUserArtifactStack()[1].getID());
+        assertEquals("MyPolicy:0.0.1", album.getUserArtifactStack()[0].getId());
+        assertEquals("MyPolicy:0.0.1:NULL:SomeState", album.getUserArtifactStack()[1].getId());
 
         assertEquals(true, album.keySet().contains("Key0"));
         assertEquals(true, album.values().contains("value of Key0"));
diff --git a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/persistence/TestPersistentContextInstantiation.java b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/persistence/TestPersistentContextInstantiation.java
index d3a8ba1..c862893 100644
--- a/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/persistence/TestPersistentContextInstantiation.java
+++ b/context/context-test-utils/src/test/java/org/onap/policy/apex/context/test/persistence/TestPersistentContextInstantiation.java
@@ -51,7 +51,7 @@
 import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
 import org.onap.policy.apex.model.basicmodel.dao.ApexDao;
 import org.onap.policy.apex.model.basicmodel.dao.ApexDaoFactory;
-import org.onap.policy.apex.model.basicmodel.dao.DAOParameters;
+import org.onap.policy.apex.model.basicmodel.dao.DaoParameters;
 import org.onap.policy.apex.model.basicmodel.handling.ApexModelException;
 import org.onap.policy.apex.model.contextmodel.concepts.AxContextAlbum;
 import org.onap.policy.apex.model.contextmodel.concepts.AxContextModel;
@@ -123,11 +123,11 @@
         final AxArtifactKey[] usedArtifactStackArray = {new AxArtifactKey("testC-top", "0.0.1"),
             new AxArtifactKey("testC-next", "0.0.1"), new AxArtifactKey("testC-bot", "0.0.1")};
 
-        final DAOParameters daoParameters = new DAOParameters();
-        daoParameters.setPluginClass("org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao");
-        daoParameters.setPersistenceUnit("DAOTest");
-        final ApexDao apexDao = new ApexDaoFactory().createApexDao(daoParameters);
-        apexDao.init(daoParameters);
+        final DaoParameters DaoParameters = new DaoParameters();
+        DaoParameters.setPluginClass("org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao");
+        DaoParameters.setPersistenceUnit("DAOTest");
+        final ApexDao apexDao = new ApexDaoFactory().createApexDao(DaoParameters);
+        apexDao.init(DaoParameters);
 
         final AxContextModel someContextModel = TestContextAlbumFactory.createMultiAlbumsContextModel();
 
diff --git a/context/context-test-utils/src/test/resources/META-INF/persistence.xml b/context/context-test-utils/src/test/resources/META-INF/persistence.xml
index ec93578..b7911ca 100644
--- a/context/context-test-utils/src/test/resources/META-INF/persistence.xml
+++ b/context/context-test-utils/src/test/resources/META-INF/persistence.xml
@@ -23,8 +23,8 @@
     <persistence-unit name="DAOTest" transaction-type="RESOURCE_LOCAL">
         <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
 
-        <class>org.onap.policy.apex.model.basicmodel.dao.converters.CDATAConditioner</class>
-        <class>org.onap.policy.apex.model.basicmodel.dao.converters.UUID2String</class>
+        <class>org.onap.policy.apex.model.basicmodel.dao.converters.CDataConditioner</class>
+        <class>org.onap.policy.apex.model.basicmodel.dao.converters.Uuid2String</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxConcept</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxKeyInfo</class>
diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/context/ApexInternalContext.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/context/ApexInternalContext.java
index 2186ee3..85e45f7 100644
--- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/context/ApexInternalContext.java
+++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/context/ApexInternalContext.java
@@ -148,10 +148,10 @@
                 // The schema is different, throw an exception because the schema should not change if the key of the
                 // album has not changed
                 throw new ContextException("internal context update failed on context album \""
-                        + contextAlbumEntry.getKey().getID() + "\" in model \"" + key.getID() + "\", schema \""
-                        + currentContextAlbum.getItemSchema().getID()
+                        + contextAlbumEntry.getKey().getId() + "\" in model \"" + key.getId() + "\", schema \""
+                        + currentContextAlbum.getItemSchema().getId()
                         + "\" on existing context model does not equal schema \""
-                        + newContextAlbum.getItemSchema().getID() + "\" on incoming model");
+                        + newContextAlbum.getItemSchema().getId() + "\" on incoming model");
             }
         }
 
diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImpl.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImpl.java
index 2351408..3349b60 100644
--- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImpl.java
+++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImpl.java
@@ -82,7 +82,7 @@
     protected ApexEngineImpl(final AxArtifactKey key) {
         argumentNotNull(key, "AxArtifactKey may not be null");
 
-        LOGGER.entry("ApexEngine()->" + key.getID() + "," + state);
+        LOGGER.entry("ApexEngine()->" + key.getId() + "," + state);
 
         this.key = key;
 
@@ -90,7 +90,7 @@
         engineStats = new AxEngineStats();
         engineStats.setKey(new AxReferenceKey(key, "_EngineStats"));
 
-        LOGGER.exit("ApexEngine()<-" + key.getID() + "," + state);
+        LOGGER.exit("ApexEngine()<-" + key.getId() + "," + state);
     }
 
     /*
@@ -103,16 +103,16 @@
     @Override
     public void updateModel(final AxPolicyModel apexModel) throws ApexException {
         if (apexModel != null) {
-            LOGGER.entry("updateModel()->" + key.getID() + ", apexPolicyModel=" + apexModel.getKey().getID());
+            LOGGER.entry("updateModel()->" + key.getId() + ", apexPolicyModel=" + apexModel.getKey().getId());
         } else {
-            LOGGER.warn("updateModel()<-" + key.getID() + ", Apex model not set");
+            LOGGER.warn("updateModel()<-" + key.getId() + ", Apex model not set");
             throw new ApexException(
-                    "updateModel()<-" + key.getID() + ", Apex model is not defined, it has a null value");
+                    "updateModel()<-" + key.getId() + ", Apex model is not defined, it has a null value");
         }
 
         // The engine must be stopped in order to do a model update
         if (!state.equals(AxEngineState.STOPPED)) {
-            throw new ApexException("updateModel()<-" + key.getID()
+            throw new ApexException("updateModel()<-" + key.getId()
                     + ", cannot update model, engine should be stopped but is in state " + state);
         }
 
@@ -127,10 +127,10 @@
             }
         } catch (final ContextException e) {
             LOGGER.warn(
-                    "updateModel()<-" + key.getID() + ", error setting the context for engine \"" + key.getID() + "\"",
+                    "updateModel()<-" + key.getId() + ", error setting the context for engine \"" + key.getId() + "\"",
                     e);
             throw new ApexException(
-                    "updateModel()<-" + key.getID() + ", error setting the context for engine \"" + key.getID() + "\"",
+                    "updateModel()<-" + key.getId() + ", error setting the context for engine \"" + key.getId() + "\"",
                     e);
         }
 
@@ -140,13 +140,13 @@
             // always set up as new
             stateMachineHandler = new StateMachineHandler(internalContext);
         } catch (final StateMachineException e) {
-            LOGGER.warn("updateModel()<-" + key.getID() + ", error setting up the engine state machines \""
-                    + key.getID() + "\"", e);
-            throw new ApexException("updateModel()<-" + key.getID() + ", error setting up the engine state machines \""
-                    + key.getID() + "\"", e);
+            LOGGER.warn("updateModel()<-" + key.getId() + ", error setting up the engine state machines \""
+                    + key.getId() + "\"", e);
+            throw new ApexException("updateModel()<-" + key.getId() + ", error setting up the engine state machines \""
+                    + key.getId() + "\"", e);
         }
 
-        LOGGER.exit("updateModel()<-" + key.getID());
+        LOGGER.exit("updateModel()<-" + key.getId());
     }
 
     /*
@@ -159,15 +159,15 @@
         LOGGER.entry("start()" + key);
 
         if (state != AxEngineState.STOPPED) {
-            LOGGER.warn("start()<-" + key.getID() + "," + state + ", cannot start engine, engine not in state STOPPED");
+            LOGGER.warn("start()<-" + key.getId() + "," + state + ", cannot start engine, engine not in state STOPPED");
             throw new ApexException(
-                    "start()<-" + key.getID() + "," + state + ", cannot start engine, engine not in state STOPPED");
+                    "start()<-" + key.getId() + "," + state + ", cannot start engine, engine not in state STOPPED");
         }
 
         if (stateMachineHandler == null || internalContext == null) {
-            LOGGER.warn("start()<-" + key.getID() + "," + state
+            LOGGER.warn("start()<-" + key.getId() + "," + state
                     + ", cannot start engine, engine has not been initialized, its model is not loaded");
-            throw new ApexException("start()<-" + key.getID() + "," + state
+            throw new ApexException("start()<-" + key.getId() + "," + state
                     + ",  cannot start engine, engine has not been initialized, its model is not loaded");
         }
 
@@ -177,10 +177,10 @@
             stateMachineHandler.start();
             engineStats.engineStart();
         } catch (final StateMachineException e) {
-            LOGGER.warn("updateModel()<-" + key.getID() + ", error starting the engine state machines \"" + key.getID()
+            LOGGER.warn("updateModel()<-" + key.getId() + ", error starting the engine state machines \"" + key.getId()
                     + "\"", e);
-            throw new ApexException("updateModel()<-" + key.getID() + ", error starting the engine state machines \""
-                    + key.getID() + "\"", e);
+            throw new ApexException("updateModel()<-" + key.getId() + ", error starting the engine state machines \""
+                    + key.getId() + "\"", e);
         }
 
         // OK, we are good to go
@@ -206,7 +206,7 @@
                     // Already stopped
                     case STOPPED:
 
-                        throw new ApexException("stop()<-" + key.getID() + "," + state
+                        throw new ApexException("stop()<-" + key.getId() + "," + state
                                 + ", cannot stop engine, engine is already stopped");
                         // The normal case, the engine wasn't doing anything or it was executing
                     case READY:
@@ -222,13 +222,13 @@
                         state = AxEngineState.STOPPING;
                         break;
                     default:
-                        throw new ApexException("stop()<-" + key.getID() + "," + state
+                        throw new ApexException("stop()<-" + key.getId() + "," + state
                                 + ", cannot stop engine, engine is in an undefined state");
                 }
             }
         }
 
-        throw new ApexException("stop()<-" + key.getID() + "," + state + ", cannot stop engine, engine stop timed out");
+        throw new ApexException("stop()<-" + key.getId() + "," + state + ", cannot stop engine, engine stop timed out");
     }
 
     /*
@@ -241,7 +241,7 @@
         LOGGER.entry("clear()->" + key);
         if (state != AxEngineState.STOPPED) {
             throw new ApexException(
-                    "clear" + "()<-" + key.getID() + "," + state + ", cannot clear engine, engine is not stopped");
+                    "clear" + "()<-" + key.getId() + "," + state + ", cannot clear engine, engine is not stopped");
         }
 
         // Clear everything
@@ -261,7 +261,7 @@
     public EnEvent createEvent(final AxArtifactKey eventKey) {
         if (state != AxEngineState.READY && state != AxEngineState.EXECUTING) {
             LOGGER.warn(
-                    "createEvent()<-" + key.getID() + "," + state + ", cannot create event, engine not in state READY");
+                    "createEvent()<-" + key.getId() + "," + state + ", cannot create event, engine not in state READY");
             return null;
         }
 
@@ -269,7 +269,7 @@
             // Create an event using the internal context
             return new EnEvent(eventKey);
         } catch (final Exception e) {
-            LOGGER.warn("createEvent()<-" + key.getID() + "," + state + ", error on event creation", e);
+            LOGGER.warn("createEvent()<-" + key.getId() + "," + state + ", error on event creation", e);
             return null;
         }
     }
@@ -284,13 +284,13 @@
     public boolean handleEvent(final EnEvent incomingEvent) {
         boolean ret = false;
         if (incomingEvent == null) {
-            LOGGER.warn("handleEvent()<-" + key.getID() + "," + state + ", cannot run engine, incoming event is null");
+            LOGGER.warn("handleEvent()<-" + key.getId() + "," + state + ", cannot run engine, incoming event is null");
             return ret;
         }
 
         synchronized (state) {
             if (state != AxEngineState.READY) {
-                LOGGER.warn("handleEvent()<-" + key.getID() + "," + state
+                LOGGER.warn("handleEvent()<-" + key.getId() + "," + state
                         + ", cannot run engine, engine not in state READY");
                 return ret;
             }
@@ -308,7 +308,7 @@
             engineStats.executionExit();
             ret = true;
         } catch (final StateMachineException e) {
-            LOGGER.warn("handleEvent()<-" + key.getID() + "," + state + ", engine execution error: ", e);
+            LOGGER.warn("handleEvent()<-" + key.getId() + "," + state + ", engine execution error: ", e);
 
             // Create an exception return event
             outgoingEvent = createExceptionEvent(incomingEvent, e);
@@ -318,7 +318,7 @@
         try {
             synchronized (eventListeners) {
                 if (eventListeners.isEmpty()) {
-                    LOGGER.debug("handleEvent()<-" + key.getID() + "," + state
+                    LOGGER.debug("handleEvent()<-" + key.getId() + "," + state
                             + ", There is no listener registered to recieve outgoing event: " + outgoingEvent);
                 }
                 for (final EnEventListener axEventListener : eventListeners.values()) {
@@ -326,7 +326,7 @@
                 }
             }
         } catch (final ApexException e) {
-            LOGGER.warn("handleEvent()<-" + key.getID() + "," + state + ", outgoing event publishing error: ", e);
+            LOGGER.warn("handleEvent()<-" + key.getId() + "," + state + ", outgoing event publishing error: ", e);
             ret = false;
         }
         synchronized (state) {
diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/StateMachineHandler.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/StateMachineHandler.java
index f17d7f8..5ade065 100644
--- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/StateMachineHandler.java
+++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/StateMachineHandler.java
@@ -71,7 +71,7 @@
      * @throws StateMachineException On state machine initiation errors
      */
     protected StateMachineHandler(final ApexInternalContext internalContext) throws StateMachineException {
-        LOGGER.entry("StateMachineHandler()->" + internalContext.getKey().getID());
+        LOGGER.entry("StateMachineHandler()->" + internalContext.getKey().getId());
 
         key = internalContext.getKey();
 
@@ -97,17 +97,17 @@
             if (lastStateMachineExecutor != null
                     && lastStateMachineExecutor.getSubject() != thisStateMachineExecutor.getSubject()) {
                 LOGGER.error("No more than one policy in a model can have the same trigger event. In model "
-                        + internalContext.getKey().getID() + " Policy ("
-                        + lastStateMachineExecutor.getSubject().getKey().getID() + ") and Policy ("
-                        + thisStateMachineExecutor.getSubject().getKey().getID() + ") have the same Trigger event ("
-                        + triggerEvent.getKey().getID() + ") ");
+                        + internalContext.getKey().getId() + " Policy ("
+                        + lastStateMachineExecutor.getSubject().getKey().getId() + ") and Policy ("
+                        + thisStateMachineExecutor.getSubject().getKey().getId() + ") have the same Trigger event ("
+                        + triggerEvent.getKey().getId() + ") ");
                 LOGGER.error(" Policy (" + lastStateMachineExecutor.getSubject().getKey() + ") has overwritten Policy ("
-                        + thisStateMachineExecutor.getSubject().getKey().getID()
+                        + thisStateMachineExecutor.getSubject().getKey().getId()
                         + " so this overwritten policy will never be triggered in this engine.");
             }
         }
 
-        LOGGER.exit("StateMachineHandler()<-" + internalContext.getKey().getID());
+        LOGGER.exit("StateMachineHandler()<-" + internalContext.getKey().getId());
     }
 
     /**
@@ -117,21 +117,21 @@
      * @throws StateMachineException On state machine initiation errors
      */
     protected void start() throws StateMachineException {
-        LOGGER.entry("start()->" + key.getID());
+        LOGGER.entry("start()->" + key.getId());
 
         // Iterate over the state machines
         for (final StateMachineExecutor smExecutor : stateMachineExecutorMap.values()) {
             try {
                 smExecutor.prepare();
             } catch (final StateMachineException e) {
-                final String stateMachineID = smExecutor.getContext().getKey().getID();
-                LOGGER.warn("start()<-" + key.getID() + ", start failed, state machine \"" + stateMachineID + "\"", e);
+                final String stateMachineID = smExecutor.getContext().getKey().getId();
+                LOGGER.warn("start()<-" + key.getId() + ", start failed, state machine \"" + stateMachineID + "\"", e);
                 throw new StateMachineException(
-                        "start()<-" + key.getID() + ", start failed, state machine \"" + stateMachineID + "\"", e);
+                        "start()<-" + key.getId() + ", start failed, state machine \"" + stateMachineID + "\"", e);
             }
         }
 
-        LOGGER.exit("start()<-" + key.getID());
+        LOGGER.exit("start()<-" + key.getId());
     }
 
     /**
@@ -180,7 +180,7 @@
             try {
                 smExecutor.cleanUp();
             } catch (final StateMachineException e) {
-                final String smID = smExecutor.getContext().getKey().getID();
+                final String smID = smExecutor.getContext().getKey().getId();
                 LOGGER.warn("stop()<-clean up failed, state machine \"" + smID + "\" cleanup failed", e);
             }
         }
diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnEvent.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnEvent.java
index 6fbf647..109240c 100644
--- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnEvent.java
+++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnEvent.java
@@ -123,7 +123,7 @@
      * @return the event key
      */
     public String getID() {
-        return axEvent.getKey().getID();
+        return axEvent.getKey().getId();
     }
 
     /**
diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnField.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnField.java
index 5f12e87..a7ce251 100644
--- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnField.java
+++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnField.java
@@ -65,7 +65,7 @@
         try {
             schemaHelper = new SchemaHelperFactory().createSchemaHelper(axField.getKey(), axField.getSchema());
         } catch (final ContextRuntimeException e) {
-            final String message = "schema helper cannot be created for parameter with key \"" + axField.getID()
+            final String message = "schema helper cannot be created for parameter with key \"" + axField.getId()
                     + "\" with schema \"" + axField.getSchema() + "\"";
             LOGGER.warn(message, e);
             throw new EnException(message, e);
diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateExecutor.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateExecutor.java
index cad83d6..9cf7d90 100644
--- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateExecutor.java
+++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateExecutor.java
@@ -131,7 +131,7 @@
                 if (finalizerLogic == null) {
                     // Finalizer logic for the task does not exist
                     throw new StateMachineRuntimeException("state finalizer logic on task reference \"" + taskReference
-                            + "\" on state \"" + axState.getID() + "\" does not exist");
+                            + "\" on state \"" + axState.getId() + "\" does not exist");
                 }
 
                 // Create a state finalizer executor for the task
@@ -140,7 +140,7 @@
             } else {
                 // This should never happen but.....
                 throw new StateMachineRuntimeException("invalid state output type on task reference \"" + taskReference
-                        + "\" on state \"" + axState.getID() + "\"");
+                        + "\" on state \"" + axState.getId() + "\"");
             }
         }
     }
@@ -178,7 +178,7 @@
         // Check that the incoming event matches the trigger for this state
         if (!incomingEvent.getAxEvent().getKey().equals(axState.getTrigger())) {
             throw new StateMachineException("incoming event \"" + incomingEvent.getID() + "\" does not match trigger \""
-                    + axState.getTrigger().getID() + "\" of state \"" + axState.getID() + "\"");
+                    + axState.getTrigger().getId() + "\" of state \"" + axState.getId() + "\"");
         }
 
         // The key of the task to execute
@@ -213,8 +213,8 @@
                 // State finalizer logic should exist for the task
                 final StateFinalizerExecutor finalizerLogicExecutor = task2StateFinalizerMap.get(taskKey);
                 if (finalizerLogicExecutor == null) {
-                    throw new StateMachineException("state finalizer logic for task \"" + taskKey.getID()
-                            + "\" not found for state \"" + axState.getID() + "\"");
+                    throw new StateMachineException("state finalizer logic for task \"" + taskKey.getId()
+                            + "\" not found for state \"" + axState.getId() + "\"");
                 }
 
                 // Execute the state finalizer logic to select a state output and to adjust the
@@ -227,7 +227,7 @@
             final AxStateOutput stateOutputDefinition = axState.getStateOutputs().get(stateOutputName);
             if (stateOutputDefinition == null) {
                 throw new StateMachineException("state output definition for state output \"" + stateOutputName
-                        + "\" not found for state \"" + axState.getID() + "\"");
+                        + "\" not found for state \"" + axState.getId() + "\"");
             }
 
             // Create the state output and transfer all the fields across to its event
@@ -247,8 +247,8 @@
             // That's it, the state execution is complete
             return stateOutput;
         } catch (final Exception e) {
-            final String errorMessage = "State execution of state \"" + axState.getID() + "\" on task \""
-                    + (taskKey != null ? taskKey.getID() : "null") + "\" failed: " + e.getMessage();
+            final String errorMessage = "State execution of state \"" + axState.getId() + "\" on task \""
+                    + (taskKey != null ? taskKey.getId() : "null") + "\" failed: " + e.getMessage();
 
             LOGGER.warn(errorMessage);
             throw new StateMachineException(errorMessage, e);
diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateFinalizerExecutor.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateFinalizerExecutor.java
index 0d37b0b..3bbcc13 100644
--- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateFinalizerExecutor.java
+++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateFinalizerExecutor.java
@@ -95,7 +95,7 @@
      */
     @Override
     public void prepare() throws StateMachineException {
-        LOGGER.debug("prepare:" + finalizerLogic.getID() + "," + finalizerLogic.getLogicFlavour() + ","
+        LOGGER.debug("prepare:" + finalizerLogic.getId() + "," + finalizerLogic.getLogicFlavour() + ","
                 + finalizerLogic.getLogic());
         argumentNotNull(finalizerLogic.getLogic(), StateMachineException.class, "task logic cannot be null.");
     }
@@ -122,7 +122,7 @@
     @Override
     public final void executePre(final long executionID, final Map<String, Object> newIncomingFields)
             throws StateMachineException, ContextException {
-        LOGGER.debug("execute-pre:" + finalizerLogic.getLogicFlavour() + "," + getSubject().getID() + ","
+        LOGGER.debug("execute-pre:" + finalizerLogic.getLogicFlavour() + "," + getSubject().getId() + ","
                 + finalizerLogic.getLogic());
 
         // Record the incoming fields
@@ -141,8 +141,8 @@
     @Override
     public final void executePost(final boolean returnValue) throws StateMachineException, ContextException {
         if (!returnValue) {
-            String errorMessage = "execute-post: state finalizer logic execution failure on state \"" + axState.getID()
-                    + "\" on finalizer logic " + finalizerLogic.getID();
+            String errorMessage = "execute-post: state finalizer logic execution failure on state \"" + axState.getId()
+                    + "\" on finalizer logic " + finalizerLogic.getId();
             if (executionContext.getMessage() != null) {
                 errorMessage += ", user message: " + executionContext.getMessage();
             }
@@ -152,22 +152,22 @@
 
         // Check a state output has been selected
         if (getOutgoing() == null) {
-            LOGGER.warn("execute-post: state finalizer logic \"" + finalizerLogic.getID()
+            LOGGER.warn("execute-post: state finalizer logic \"" + finalizerLogic.getId()
                     + "\" did not select an output state");
-            throw new StateMachineException("execute-post: state finalizer logic \"" + finalizerLogic.getID()
+            throw new StateMachineException("execute-post: state finalizer logic \"" + finalizerLogic.getId()
                     + "\" did not select an output state");
         }
 
         if (!axState.getStateOutputs().keySet().contains(getOutgoing())) {
             LOGGER.warn(
-                    "execute-post: state finalizer logic \"" + finalizerLogic.getID() + "\" selected output state \""
-                            + getOutgoing() + "\" that does not exsist on state \"" + axState.getID() + "\"");
+                    "execute-post: state finalizer logic \"" + finalizerLogic.getId() + "\" selected output state \""
+                            + getOutgoing() + "\" that does not exsist on state \"" + axState.getId() + "\"");
             throw new StateMachineException(
-                    "execute-post: state finalizer logic \"" + finalizerLogic.getID() + "\" selected output state \""
-                            + getOutgoing() + "\" that does not exsist on state \"" + axState.getID() + "\"");
+                    "execute-post: state finalizer logic \"" + finalizerLogic.getId() + "\" selected output state \""
+                            + getOutgoing() + "\" that does not exsist on state \"" + axState.getId() + "\"");
         }
 
-        LOGGER.debug("execute-post:" + finalizerLogic.getID() + ", returning  state output \"" + getOutgoing()
+        LOGGER.debug("execute-post:" + finalizerLogic.getId() + ", returning  state output \"" + getOutgoing()
                 + " and fields " + incomingFields);
     }
 
diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateMachineExecutor.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateMachineExecutor.java
index 7a9594b..07ef8d6 100644
--- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateMachineExecutor.java
+++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateMachineExecutor.java
@@ -161,7 +161,7 @@
             stateExecutor = stateExecutorMap.get(stateOutput.getNextState());
             if (stateExecutor == null) {
                 throw new StateMachineException(
-                        "state execution failed, next state \"" + stateOutput.getNextState().getID() + "\" not found");
+                        "state execution failed, next state \"" + stateOutput.getNextState().getId() + "\" not found");
             }
         }
 
diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateOutput.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateOutput.java
index aaec71b..65cb0d2 100644
--- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateOutput.java
+++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateOutput.java
@@ -110,7 +110,7 @@
 
         if (!incomingFieldDefinitionMap.keySet().equals(eventFieldMap.keySet())) {
             throw new StateMachineException(
-                    "field definitions and values do not match for event " + outputEventDef.getID() + '\n'
+                    "field definitions and values do not match for event " + outputEventDef.getId() + '\n'
                             + incomingFieldDefinitionMap.keySet() + '\n' + eventFieldMap.keySet());
         }
         for (final Entry<String, Object> incomingFieldEntry : eventFieldMap.entrySet()) {
@@ -120,7 +120,7 @@
             // Check if this field is a field in the event
             if (!outputEventDef.getFields().contains(fieldDef)) {
                 throw new StateMachineException(
-                        "field \"" + fieldName + "\" does not exist on event \"" + outputEventDef.getID() + "\"");
+                        "field \"" + fieldName + "\" does not exist on event \"" + outputEventDef.getId() + "\"");
             }
 
             // Set the value in the output event
diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/TaskExecutor.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/TaskExecutor.java
index 9f6f92d..8dd2575 100644
--- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/TaskExecutor.java
+++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/TaskExecutor.java
@@ -99,7 +99,7 @@
      */
     @Override
     public void prepare() throws StateMachineException {
-        LOGGER.debug("prepare:" + axTask.getKey().getID() + "," + axTask.getTaskLogic().getLogicFlavour() + ","
+        LOGGER.debug("prepare:" + axTask.getKey().getId() + "," + axTask.getTaskLogic().getLogicFlavour() + ","
                 + axTask.getTaskLogic().getLogic());
         argumentNotNull(axTask.getTaskLogic().getLogic(), StateMachineException.class, "task logic cannot be null.");
     }
@@ -127,7 +127,7 @@
     public final void executePre(final long executionID, final Map<String, Object> newIncomingFields)
             throws StateMachineException, ContextException {
         LOGGER.debug("execute-pre:" + getSubject().getTaskLogic().getLogicFlavour() + ","
-                + getSubject().getKey().getID() + "," + getSubject().getTaskLogic().getLogic());
+                + getSubject().getKey().getId() + "," + getSubject().getTaskLogic().getLogic());
 
         // Check that the incoming event has all the input fields for this state
         final Set<String> missingTaskInputFields = new TreeSet<>(axTask.getInputFields().keySet());
@@ -143,7 +143,7 @@
         }
         if (!missingTaskInputFields.isEmpty()) {
             throw new StateMachineException("task input fields \"" + missingTaskInputFields
-                    + "\" are missing for task \"" + axTask.getKey().getID() + "\"");
+                    + "\" are missing for task \"" + axTask.getKey().getId() + "\"");
         }
 
         // Record the incoming fields
@@ -169,7 +169,7 @@
     public final void executePost(final boolean returnValue) throws StateMachineException, ContextException {
         if (!returnValue) {
             String errorMessage = "execute-post: task logic execution failure on task \"" + axTask.getKey().getName()
-                    + "\" in model " + internalContext.getKey().getID();
+                    + "\" in model " + internalContext.getKey().getId();
             if (executionContext.getMessage() != null) {
                 errorMessage += ", user message: " + executionContext.getMessage();
             }
@@ -215,7 +215,7 @@
         }
         if (!missingTaskOutputFields.isEmpty()) {
             throw new StateMachineException("task output fields \"" + missingTaskOutputFields
-                    + "\" are missing for task \"" + axTask.getKey().getID() + "\"");
+                    + "\" are missing for task \"" + axTask.getKey().getId() + "\"");
         }
 
         // Finally, check that the outgoing field map don't have any extra fields, if present, raise
@@ -225,10 +225,10 @@
         extraTaskOutputFields.removeAll(axTask.getOutputFields().keySet());
         if (!extraTaskOutputFields.isEmpty()) {
             throw new StateMachineException("task output fields \"" + extraTaskOutputFields
-                    + "\" are unwanted for task \"" + axTask.getKey().getID() + "\"");
+                    + "\" are unwanted for task \"" + axTask.getKey().getId() + "\"");
         }
 
-        LOGGER.debug("execute-post:" + axTask.getKey().getID() + ", returning fields " + outgoingFields.toString());
+        LOGGER.debug("execute-post:" + axTask.getKey().getId() + ", returning fields " + outgoingFields.toString());
     }
 
     /*
diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/TaskSelectExecutor.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/TaskSelectExecutor.java
index f3ac1f6..cda0ac5 100644
--- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/TaskSelectExecutor.java
+++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/TaskSelectExecutor.java
@@ -92,7 +92,7 @@
      */
     @Override
     public void prepare() throws StateMachineException {
-        LOGGER.debug("prepare:" + axState.getKey().getID() + "," + axState.getTaskSelectionLogic().getLogicFlavour()
+        LOGGER.debug("prepare:" + axState.getKey().getId() + "," + axState.getTaskSelectionLogic().getLogicFlavour()
                 + "," + axState.getTaskSelectionLogic().getLogic());
         argumentNotNull(axState.getTaskSelectionLogic().getLogic(), "task selection logic cannot be null.");
     }
@@ -117,7 +117,7 @@
      */
     @Override
     public final void executePre(final long executionID, final EnEvent newIncomingEvent) throws StateMachineException {
-        LOGGER.debug("execute-pre:" + axState.getKey().getID() + "," + axState.getTaskSelectionLogic().getLogicFlavour()
+        LOGGER.debug("execute-pre:" + axState.getKey().getId() + "," + axState.getTaskSelectionLogic().getLogicFlavour()
                 + "," + axState.getTaskSelectionLogic().getLogic());
 
         this.incomingEvent = newIncomingEvent;
@@ -139,7 +139,7 @@
     public final void executePost(final boolean returnValue) throws StateMachineException {
         if (!returnValue) {
             String errorMessage =
-                    "execute-post: task selection logic failed on state \"" + axState.getKey().getID() + "\"";
+                    "execute-post: task selection logic failed on state \"" + axState.getKey().getId() + "\"";
             if (executionContext.getMessage() != null) {
                 errorMessage += ", user message: " + executionContext.getMessage();
             }
@@ -149,18 +149,18 @@
 
         if (outgoingTaskKey == null || AxArtifactKey.getNullKey().getName().equals(outgoingTaskKey.getName())) {
             outgoingTaskKey = axState.getDefaultTask();
-            LOGGER.debug("execute-post:" + axState.getKey().getID() + ", returning default task");
+            LOGGER.debug("execute-post:" + axState.getKey().getId() + ", returning default task");
             return;
         }
 
         if (!axState.getTaskReferences().containsKey(outgoingTaskKey)) {
-            LOGGER.error("execute-post: task \"" + outgoingTaskKey.getID()
-                    + "\" returned by task selection logic not defined on state \"" + axState.getKey().getID() + "\"");
-            throw new StateMachineException("task \"" + outgoingTaskKey.getID()
-                    + "\" returned by task selection logic not defined on state \"" + axState.getKey().getID() + "\"");
+            LOGGER.error("execute-post: task \"" + outgoingTaskKey.getId()
+                    + "\" returned by task selection logic not defined on state \"" + axState.getKey().getId() + "\"");
+            throw new StateMachineException("task \"" + outgoingTaskKey.getId()
+                    + "\" returned by task selection logic not defined on state \"" + axState.getKey().getId() + "\"");
         }
 
-        LOGGER.debug("execute-post:" + axState.getKey().getID() + "," + ", returning task " + outgoingTaskKey.getID());
+        LOGGER.debug("execute-post:" + axState.getKey().getId() + "," + ", returning task " + outgoingTaskKey.getId());
     }
 
     /*
diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/AxStateFacade.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/AxStateFacade.java
index e63bd3d..bb8e362 100644
--- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/AxStateFacade.java
+++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/AxStateFacade.java
@@ -68,7 +68,7 @@
      * @return the ID
      */
     public String getId() {
-        return state.getKey().getID();
+        return state.getKey().getId();
     }
 
     /**
diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/AxTaskFacade.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/AxTaskFacade.java
index a9e93a3..f7b5355 100644
--- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/AxTaskFacade.java
+++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/AxTaskFacade.java
@@ -74,7 +74,7 @@
      * @return the task ID
      */
     public String getId() {
-        return task.getID();
+        return task.getId();
     }
 
     /**
@@ -112,7 +112,7 @@
         // Find the field for the field name
         if (field == null) {
             final String message = "no " + directionString + " field with name \"" + fieldName + "\" defined on task \""
-                    + task.getID() + "\"";
+                    + task.getId() + "\"";
             LOGGER.warn(message);
             throw new StateMachineRuntimeException(message);
         }
@@ -122,7 +122,7 @@
             return new SchemaHelperFactory().createSchemaHelper(field.getKey(), field.getSchema());
         } catch (final ContextRuntimeException e) {
             final String message = "schema helper cannot be created for task field \"" + fieldName + "\" with key \""
-                    + field.getID() + "\" with schema \"" + field.getSchema() + "\"";
+                    + field.getId() + "\" with schema \"" + field.getSchema() + "\"";
             LOGGER.warn(message, e);
             throw new EnException(message, e);
         }
diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/monitoring/EventMonitor.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/monitoring/EventMonitor.java
index 9710b10..c1c9ce9 100644
--- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/monitoring/EventMonitor.java
+++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/monitoring/EventMonitor.java
@@ -95,9 +95,9 @@
                     builder.append(',');
                 }
                 if (stackKey instanceof AxArtifactKey) {
-                    builder.append(((AxArtifactKey) stackKey).getID());
+                    builder.append(((AxArtifactKey) stackKey).getId());
                 } else if (stackKey instanceof AxReferenceKey) {
-                    builder.append(((AxReferenceKey) stackKey).getID());
+                    builder.append(((AxReferenceKey) stackKey).getId());
                 } else {
                     builder.append(stackKey.toString());
                 }
diff --git a/examples/examples-aadm/src/main/java/org/onap/policy/apex/examples/aadm/model/AADMDomainModelFactory.java b/examples/examples-aadm/src/main/java/org/onap/policy/apex/examples/aadm/model/AADMDomainModelFactory.java
index b0cbf0c..9a2d506 100644
--- a/examples/examples-aadm/src/main/java/org/onap/policy/apex/examples/aadm/model/AADMDomainModelFactory.java
+++ b/examples/examples-aadm/src/main/java/org/onap/policy/apex/examples/aadm/model/AADMDomainModelFactory.java
@@ -696,7 +696,7 @@
 
         final AxValidationResult result = aadmPolicyModel.validate(new AxValidationResult());
         if (!result.getValidationResult().equals(AxValidationResult.ValidationResult.VALID)) {
-            throw new ApexRuntimeException("model " + aadmPolicyModel.getID() + " is not valid" + result);
+            throw new ApexRuntimeException("model " + aadmPolicyModel.getId() + " is not valid" + result);
         }
         return aadmPolicyModel;
     }
diff --git a/examples/examples-aadm/src/main/java/org/onap/policy/apex/examples/aadm/model/AADMDomainModelSaver.java b/examples/examples-aadm/src/main/java/org/onap/policy/apex/examples/aadm/model/AADMDomainModelSaver.java
index 618a953..a25a0e9 100644
--- a/examples/examples-aadm/src/main/java/org/onap/policy/apex/examples/aadm/model/AADMDomainModelSaver.java
+++ b/examples/examples-aadm/src/main/java/org/onap/policy/apex/examples/aadm/model/AADMDomainModelSaver.java
@@ -51,7 +51,7 @@
         final AxPolicyModel aadmPolicyModel = new AADMDomainModelFactory().getAADMPolicyModel();
         final ApexModelSaver<AxPolicyModel> aadmModelSaver =
                 new ApexModelSaver<>(AxPolicyModel.class, aadmPolicyModel, args[0]);
-        aadmModelSaver.apexModelWriteJSON();
-        aadmModelSaver.apexModelWriteXML();
+        aadmModelSaver.apexModelWriteJson();
+        aadmModelSaver.apexModelWriteXml();
     }
 }
diff --git a/examples/examples-aadm/src/test/java/org/onap/policy/apex/examples/aadm/TestAADMDBWrite.java b/examples/examples-aadm/src/test/java/org/onap/policy/apex/examples/aadm/TestAADMDBWrite.java
index 02e6f91..dd6a5eb 100644
--- a/examples/examples-aadm/src/test/java/org/onap/policy/apex/examples/aadm/TestAADMDBWrite.java
+++ b/examples/examples-aadm/src/test/java/org/onap/policy/apex/examples/aadm/TestAADMDBWrite.java
@@ -27,7 +27,7 @@
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
-import org.onap.policy.apex.model.basicmodel.dao.DAOParameters;
+import org.onap.policy.apex.model.basicmodel.dao.DaoParameters;
 import org.onap.policy.apex.model.basicmodel.test.TestApexModel;
 import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
 
@@ -51,10 +51,10 @@
 
     @Test
     public void testModelWriteReadJPA() throws Exception {
-        final DAOParameters daoParameters = new DAOParameters();
-        daoParameters.setPluginClass("org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao");
-        daoParameters.setPersistenceUnit("AADMModelTest");
+        final DaoParameters DaoParameters = new DaoParameters();
+        DaoParameters.setPluginClass("org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao");
+        DaoParameters.setPersistenceUnit("AADMModelTest");
 
-        testApexModel.testApexModelWriteReadJPA(daoParameters);
+        testApexModel.testApexModelWriteReadJpa(DaoParameters);
     }
 }
diff --git a/examples/examples-aadm/src/test/java/org/onap/policy/apex/examples/aadm/TestAADMModel.java b/examples/examples-aadm/src/test/java/org/onap/policy/apex/examples/aadm/TestAADMModel.java
index 2c62c49..7a453ae 100644
--- a/examples/examples-aadm/src/test/java/org/onap/policy/apex/examples/aadm/TestAADMModel.java
+++ b/examples/examples-aadm/src/test/java/org/onap/policy/apex/examples/aadm/TestAADMModel.java
@@ -30,7 +30,7 @@
 import org.junit.Before;
 import org.junit.Test;
 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
-import org.onap.policy.apex.model.basicmodel.dao.DAOParameters;
+import org.onap.policy.apex.model.basicmodel.dao.DaoParameters;
 import org.onap.policy.apex.model.basicmodel.test.TestApexModel;
 import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
 
@@ -60,21 +60,21 @@
 
     @Test
     public void testModelWriteReadXML() throws Exception {
-        testApexModel.testApexModelWriteReadXML();
+        testApexModel.testApexModelWriteReadXml();
     }
 
     @Test
     public void testModelWriteReadJSON() throws Exception {
-        testApexModel.testApexModelWriteReadJSON();
+        testApexModel.testApexModelWriteReadJson();
     }
 
     @Test
     public void testModelWriteReadJPA() throws Exception {
-        final DAOParameters daoParameters = new DAOParameters();
-        daoParameters.setPluginClass("org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao");
-        daoParameters.setPersistenceUnit("AADMModelTest");
+        final DaoParameters DaoParameters = new DaoParameters();
+        DaoParameters.setPluginClass("org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao");
+        DaoParameters.setPersistenceUnit("AADMModelTest");
 
-        testApexModel.testApexModelWriteReadJPA(daoParameters);
+        testApexModel.testApexModelWriteReadJpa(DaoParameters);
     }
 
     private static final String VALID_MODEL_STRING = "***validation of model successful***";
diff --git a/examples/examples-aadm/src/test/java/org/onap/policy/apex/examples/aadm/TestAADMUseCase.java b/examples/examples-aadm/src/test/java/org/onap/policy/apex/examples/aadm/TestAADMUseCase.java
index 1f9b108..f7ce2fd 100644
--- a/examples/examples-aadm/src/test/java/org/onap/policy/apex/examples/aadm/TestAADMUseCase.java
+++ b/examples/examples-aadm/src/test/java/org/onap/policy/apex/examples/aadm/TestAADMUseCase.java
@@ -441,7 +441,7 @@
      */
     private AxEvent getTriggerEvent(final AxPolicyModel apexPolicyModel) {
         for (final AxEvent axEvent : apexPolicyModel.getEvents().getEventMap().values()) {
-            if (axEvent.getKey().getID().equals("AADMEvent:0.0.1")) {
+            if (axEvent.getKey().getId().equals("AADMEvent:0.0.1")) {
                 return axEvent;
             }
         }
diff --git a/examples/examples-aadm/src/test/resources/META-INF/persistence.xml b/examples/examples-aadm/src/test/resources/META-INF/persistence.xml
index eaef96a..eb28ad8 100644
--- a/examples/examples-aadm/src/test/resources/META-INF/persistence.xml
+++ b/examples/examples-aadm/src/test/resources/META-INF/persistence.xml
@@ -23,8 +23,8 @@
     <persistence-unit name="AADMModelTest" transaction-type="RESOURCE_LOCAL">
         <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
 
-        <class>org.onap.policy.apex.model.basicmodel.dao.converters.CDATAConditioner</class>
-        <class>org.onap.policy.apex.model.basicmodel.dao.converters.UUID2String</class>
+        <class>org.onap.policy.apex.model.basicmodel.dao.converters.CDataConditioner</class>
+        <class>org.onap.policy.apex.model.basicmodel.dao.converters.Uuid2String</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxConcept</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxKeyInfo</class>
diff --git a/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/AdaptiveDomainModelFactory.java b/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/AdaptiveDomainModelFactory.java
index 6242b16..6b71468 100644
--- a/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/AdaptiveDomainModelFactory.java
+++ b/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/AdaptiveDomainModelFactory.java
@@ -288,7 +288,7 @@
 
         final AxValidationResult result = anomalyDetectionPolicyModel.validate(new AxValidationResult());
         if (!result.getValidationResult().equals(AxValidationResult.ValidationResult.VALID)) {
-            throw new ApexRuntimeException("model " + anomalyDetectionPolicyModel.getID() + " is not valid" + result);
+            throw new ApexRuntimeException("model " + anomalyDetectionPolicyModel.getId() + " is not valid" + result);
         }
         return anomalyDetectionPolicyModel;
     }
@@ -550,7 +550,7 @@
 
         final AxValidationResult result = autoLearnPolicyModel.validate(new AxValidationResult());
         if (!result.getValidationResult().equals(AxValidationResult.ValidationResult.VALID)) {
-            throw new ApexRuntimeException("model " + autoLearnPolicyModel.getID() + " is not valid" + result);
+            throw new ApexRuntimeException("model " + autoLearnPolicyModel.getId() + " is not valid" + result);
         }
         return autoLearnPolicyModel;
     }
diff --git a/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/AdaptiveDomainModelSaver.java b/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/AdaptiveDomainModelSaver.java
index 0cc9bd3..9c860e3 100644
--- a/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/AdaptiveDomainModelSaver.java
+++ b/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/AdaptiveDomainModelSaver.java
@@ -51,14 +51,14 @@
         final AxPolicyModel adPolicyModel = new AdaptiveDomainModelFactory().getAnomalyDetectionPolicyModel();
         final ApexModelSaver<AxPolicyModel> adModelSaver =
                 new ApexModelSaver<>(AxPolicyModel.class, adPolicyModel, args[0]);
-        adModelSaver.apexModelWriteJSON();
-        adModelSaver.apexModelWriteXML();
+        adModelSaver.apexModelWriteJson();
+        adModelSaver.apexModelWriteXml();
 
         // Save Auto Learn model
         final AxPolicyModel alPolicyModel = new AdaptiveDomainModelFactory().getAutoLearnPolicyModel();
         final ApexModelSaver<AxPolicyModel> alModelSaver =
                 new ApexModelSaver<>(AxPolicyModel.class, alPolicyModel, args[0]);
-        alModelSaver.apexModelWriteJSON();
-        alModelSaver.apexModelWriteXML();
+        alModelSaver.apexModelWriteJson();
+        alModelSaver.apexModelWriteXml();
     }
 }
diff --git a/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/TestAnomalyDetectionDBWrite.java b/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/TestAnomalyDetectionDBWrite.java
index 898531c..9affa78 100644
--- a/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/TestAnomalyDetectionDBWrite.java
+++ b/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/TestAnomalyDetectionDBWrite.java
@@ -27,7 +27,7 @@
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
-import org.onap.policy.apex.model.basicmodel.dao.DAOParameters;
+import org.onap.policy.apex.model.basicmodel.dao.DaoParameters;
 import org.onap.policy.apex.model.basicmodel.test.TestApexModel;
 import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
 
@@ -51,10 +51,10 @@
 
     @Test
     public void testModelWriteReadJPA() throws Exception {
-        final DAOParameters daoParameters = new DAOParameters();
-        daoParameters.setPluginClass("org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao");
-        daoParameters.setPersistenceUnit("AdaptiveModelsTest");
+        final DaoParameters DaoParameters = new DaoParameters();
+        DaoParameters.setPluginClass("org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao");
+        DaoParameters.setPersistenceUnit("AdaptiveModelsTest");
 
-        testApexModel.testApexModelWriteReadJPA(daoParameters);
+        testApexModel.testApexModelWriteReadJpa(DaoParameters);
     }
 }
diff --git a/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/TestAnomalyDetectionModel.java b/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/TestAnomalyDetectionModel.java
index 7e2fb0e..3782f2d 100644
--- a/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/TestAnomalyDetectionModel.java
+++ b/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/TestAnomalyDetectionModel.java
@@ -30,7 +30,7 @@
 import org.junit.Before;
 import org.junit.Test;
 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
-import org.onap.policy.apex.model.basicmodel.dao.DAOParameters;
+import org.onap.policy.apex.model.basicmodel.dao.DaoParameters;
 import org.onap.policy.apex.model.basicmodel.test.TestApexModel;
 import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
 
@@ -60,21 +60,21 @@
 
     @Test
     public void testModelWriteReadXML() throws Exception {
-        testApexModel.testApexModelWriteReadXML();
+        testApexModel.testApexModelWriteReadXml();
     }
 
     @Test
     public void testModelWriteReadJSON() throws Exception {
-        testApexModel.testApexModelWriteReadJSON();
+        testApexModel.testApexModelWriteReadJson();
     }
 
     @Test
     public void testModelWriteReadJPA() throws Exception {
-        final DAOParameters daoParameters = new DAOParameters();
-        daoParameters.setPluginClass("org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao");
-        daoParameters.setPersistenceUnit("AdaptiveModelsTest");
+        final DaoParameters DaoParameters = new DaoParameters();
+        DaoParameters.setPluginClass("org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao");
+        DaoParameters.setPersistenceUnit("AdaptiveModelsTest");
 
-        testApexModel.testApexModelWriteReadJPA(daoParameters);
+        testApexModel.testApexModelWriteReadJpa(DaoParameters);
     }
 
     private static final String VALID_MODEL_STRING = "***validation of model successful***";
diff --git a/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/TestAutoLearnDBWrite.java b/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/TestAutoLearnDBWrite.java
index 64efa6c..e096105 100644
--- a/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/TestAutoLearnDBWrite.java
+++ b/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/TestAutoLearnDBWrite.java
@@ -27,7 +27,7 @@
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
-import org.onap.policy.apex.model.basicmodel.dao.DAOParameters;
+import org.onap.policy.apex.model.basicmodel.dao.DaoParameters;
 import org.onap.policy.apex.model.basicmodel.test.TestApexModel;
 import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
 
@@ -51,10 +51,10 @@
 
     @Test
     public void testModelWriteReadJPA() throws Exception {
-        final DAOParameters daoParameters = new DAOParameters();
-        daoParameters.setPluginClass("org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao");
-        daoParameters.setPersistenceUnit("AdaptiveModelsTest");
+        final DaoParameters DaoParameters = new DaoParameters();
+        DaoParameters.setPluginClass("org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao");
+        DaoParameters.setPersistenceUnit("AdaptiveModelsTest");
 
-        testApexModel.testApexModelWriteReadJPA(daoParameters);
+        testApexModel.testApexModelWriteReadJpa(DaoParameters);
     }
 }
diff --git a/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/TestAutoLearnModel.java b/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/TestAutoLearnModel.java
index aa7f621..beb7a9c 100644
--- a/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/TestAutoLearnModel.java
+++ b/examples/examples-adaptive/src/test/java/org/onap/policy/apex/examples/adaptive/TestAutoLearnModel.java
@@ -30,7 +30,7 @@
 import org.junit.Before;
 import org.junit.Test;
 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
-import org.onap.policy.apex.model.basicmodel.dao.DAOParameters;
+import org.onap.policy.apex.model.basicmodel.dao.DaoParameters;
 import org.onap.policy.apex.model.basicmodel.test.TestApexModel;
 import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
 
@@ -60,21 +60,21 @@
 
     @Test
     public void testModelWriteReadXML() throws Exception {
-        testApexModel.testApexModelWriteReadXML();
+        testApexModel.testApexModelWriteReadXml();
     }
 
     @Test
     public void testModelWriteReadJSON() throws Exception {
-        testApexModel.testApexModelWriteReadJSON();
+        testApexModel.testApexModelWriteReadJson();
     }
 
     @Test
     public void testModelWriteReadJPA() throws Exception {
-        final DAOParameters daoParameters = new DAOParameters();
-        daoParameters.setPluginClass("org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao");
-        daoParameters.setPersistenceUnit("AdaptiveModelsTest");
+        final DaoParameters DaoParameters = new DaoParameters();
+        DaoParameters.setPluginClass("org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao");
+        DaoParameters.setPersistenceUnit("AdaptiveModelsTest");
 
-        testApexModel.testApexModelWriteReadJPA(daoParameters);
+        testApexModel.testApexModelWriteReadJpa(DaoParameters);
     }
 
     private static final String VALID_MODEL_STRING = "***validation of model successful***";
diff --git a/examples/examples-adaptive/src/test/resources/META-INF/persistence.xml b/examples/examples-adaptive/src/test/resources/META-INF/persistence.xml
index 7282bb5..4dcd879 100644
--- a/examples/examples-adaptive/src/test/resources/META-INF/persistence.xml
+++ b/examples/examples-adaptive/src/test/resources/META-INF/persistence.xml
@@ -23,8 +23,8 @@
     <persistence-unit name="AdaptiveModelsTest" transaction-type="RESOURCE_LOCAL">
         <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
 
-        <class>org.onap.policy.apex.model.basicmodel.dao.converters.CDATAConditioner</class>
-        <class>org.onap.policy.apex.model.basicmodel.dao.converters.UUID2String</class>
+        <class>org.onap.policy.apex.model.basicmodel.dao.converters.CDataConditioner</class>
+        <class>org.onap.policy.apex.model.basicmodel.dao.converters.Uuid2String</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxConcept</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxKeyInfo</class>
diff --git a/examples/examples-myfirstpolicy/src/main/java/org/onap/policy/apex/examples/myfirstpolicy/model/MFPDomainModelSaver.java b/examples/examples-myfirstpolicy/src/main/java/org/onap/policy/apex/examples/myfirstpolicy/model/MFPDomainModelSaver.java
index 7343f74..fb47f6c 100644
--- a/examples/examples-myfirstpolicy/src/main/java/org/onap/policy/apex/examples/myfirstpolicy/model/MFPDomainModelSaver.java
+++ b/examples/examples-myfirstpolicy/src/main/java/org/onap/policy/apex/examples/myfirstpolicy/model/MFPDomainModelSaver.java
@@ -50,13 +50,13 @@
         AxPolicyModel mfpPolicyModel = new MFPDomainModelFactory().getMFP1PolicyModel();
         ApexModelSaver<AxPolicyModel> mfpModelSaver =
                 new ApexModelSaver<>(AxPolicyModel.class, mfpPolicyModel, args[0] + "/1/");
-        mfpModelSaver.apexModelWriteJSON();
-        mfpModelSaver.apexModelWriteXML();
+        mfpModelSaver.apexModelWriteJson();
+        mfpModelSaver.apexModelWriteXml();
 
         mfpPolicyModel = new MFPDomainModelFactory().getMFP2PolicyModel();
         mfpModelSaver = new ApexModelSaver<>(AxPolicyModel.class, mfpPolicyModel, args[0] + "/2/");
-        mfpModelSaver.apexModelWriteJSON();
-        mfpModelSaver.apexModelWriteXML();
+        mfpModelSaver.apexModelWriteJson();
+        mfpModelSaver.apexModelWriteXml();
 
     }
 }
diff --git a/examples/examples-myfirstpolicy/src/test/java/org/onap/policy/apex/examples/myfirstpolicy/TestMFPModel.java b/examples/examples-myfirstpolicy/src/test/java/org/onap/policy/apex/examples/myfirstpolicy/TestMFPModel.java
index a8be6c4..64ff5b1 100644
--- a/examples/examples-myfirstpolicy/src/test/java/org/onap/policy/apex/examples/myfirstpolicy/TestMFPModel.java
+++ b/examples/examples-myfirstpolicy/src/test/java/org/onap/policy/apex/examples/myfirstpolicy/TestMFPModel.java
@@ -76,10 +76,10 @@
     @Test
     public void testModelValid() throws Exception {
         AxValidationResult result = testApexModel1.testApexModelValid();
-        assertTrue("Model did not validate cleanly", result.isOK());
+        assertTrue("Model did not validate cleanly", result.isOk());
 
         result = testApexModel2.testApexModelValid();
-        assertTrue("Model did not validate cleanly", result.isOK());
+        assertTrue("Model did not validate cleanly", result.isOk());
     }
 
     /**
@@ -89,8 +89,8 @@
      */
     @Test
     public void testModelWriteReadXML() throws Exception {
-        testApexModel1.testApexModelWriteReadXML();
-        testApexModel2.testApexModelWriteReadXML();
+        testApexModel1.testApexModelWriteReadXml();
+        testApexModel2.testApexModelWriteReadXml();
     }
 
     /**
@@ -100,7 +100,7 @@
      */
     @Test
     public void testModelWriteReadJSON() throws Exception {
-        testApexModel1.testApexModelWriteReadJSON();
-        testApexModel2.testApexModelWriteReadJSON();
+        testApexModel1.testApexModelWriteReadJson();
+        testApexModel2.testApexModelWriteReadJson();
     }
 }
diff --git a/examples/examples-myfirstpolicy/src/test/java/org/onap/policy/apex/examples/myfirstpolicy/TestMFPUseCase.java b/examples/examples-myfirstpolicy/src/test/java/org/onap/policy/apex/examples/myfirstpolicy/TestMFPUseCase.java
index 22f985f..1068a53 100644
--- a/examples/examples-myfirstpolicy/src/test/java/org/onap/policy/apex/examples/myfirstpolicy/TestMFPUseCase.java
+++ b/examples/examples-myfirstpolicy/src/test/java/org/onap/policy/apex/examples/myfirstpolicy/TestMFPUseCase.java
@@ -262,7 +262,7 @@
                 continue;
             }
             assertTrue("Event file " + inputFile + " has a field " + e.getKey() + " but this is not defined for "
-                    + event.getID(), (event.getParameterMap().containsKey(e.getKey())));
+                    + event.getId(), (event.getParameterMap().containsKey(e.getKey())));
             if (jsonObject.get(e.getKey()).isJsonNull()) {
                 ret.put(e.getKey(), null);
             }
@@ -270,7 +270,7 @@
         for (final AxField field : event.getFields()) {
             if (!field.getOptional()) {
                 assertTrue("Event file " + inputFile + " is missing a mandatory field " + field.getKey().getLocalName()
-                        + " for " + event.getID(), jsonObject.has(field.getKey().getLocalName()));
+                        + " for " + event.getId(), jsonObject.has(field.getKey().getLocalName()));
             } else {
                 ret.put(field.getKey().getLocalName(), null);
             }
@@ -329,7 +329,7 @@
                 continue;
             }
             assertTrue("Event file " + inputFile + " has a field " + e.getKey() + " but this is not defined for "
-                    + event.getID(), (event.getParameterMap().containsKey(e.getKey())));
+                    + event.getId(), (event.getParameterMap().containsKey(e.getKey())));
             if (jsonObject.get(e.getKey()).isJsonNull()) {
                 ret.put(e.getKey(), null);
             }
@@ -337,7 +337,7 @@
         for (final AxField field : event.getFields()) {
             if (!field.getOptional()) {
                 assertTrue("Event file " + inputFile + " is missing a mandatory field " + field.getKey().getLocalName()
-                        + " for " + event.getID(), jsonObject.has(field.getKey().getLocalName()));
+                        + " for " + event.getId(), jsonObject.has(field.getKey().getLocalName()));
             } else {
                 ret.put(field.getKey().getLocalName(), null);
             }
diff --git a/examples/examples-myfirstpolicy/src/test/resources/META-INF/persistence.xml b/examples/examples-myfirstpolicy/src/test/resources/META-INF/persistence.xml
index 4dcba14..7acc7a0 100644
--- a/examples/examples-myfirstpolicy/src/test/resources/META-INF/persistence.xml
+++ b/examples/examples-myfirstpolicy/src/test/resources/META-INF/persistence.xml
@@ -23,8 +23,8 @@
     <persistence-unit name="MFPModelTest" transaction-type="RESOURCE_LOCAL">
         <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
 
-        <class>org.onap.policy.apex.model.basicmodel.dao.converters.CDATAConditioner</class>
-        <class>org.onap.policy.apex.model.basicmodel.dao.converters.UUID2String</class>
+        <class>org.onap.policy.apex.model.basicmodel.dao.converters.CDataConditioner</class>
+        <class>org.onap.policy.apex.model.basicmodel.dao.converters.Uuid2String</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxConcept</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxKeyInfo</class>
diff --git a/examples/examples-onap-vcpe/pom.xml b/examples/examples-onap-vcpe/pom.xml
index 353c7a2..3080416 100644
--- a/examples/examples-onap-vcpe/pom.xml
+++ b/examples/examples-onap-vcpe/pom.xml
@@ -52,6 +52,21 @@
             <version>${version.jersey}</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.onap.policy.apex-pdp.plugins.plugins-context.plugins-context-schema</groupId>
+            <artifactId>plugins-context-schema-avro</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.apex-pdp.plugins.plugins-executor</groupId>
+            <artifactId>plugins-executor-javascript</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.apex-pdp.plugins.plugins-event.plugins-event-carrier</groupId>
+            <artifactId>plugins-event-carrier-restrequestor</artifactId>
+            <version>${project.version}</version>
+        </dependency>
     </dependencies>
 
     <build>
diff --git a/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AAIAndGuardSim.java b/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AAIAndGuardSim.java
index a821462..f6ae332 100644
--- a/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AAIAndGuardSim.java
+++ b/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AAIAndGuardSim.java
@@ -28,7 +28,7 @@
 import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities;
 
 public class AAIAndGuardSim {
-    private static final String BASE_URI = "http://192.168.144.235:54321/AAIAndGuardSim";
+    private static final String BASE_URI = "http://localhost:54321/AAIAndGuardSim";
     private HttpServer server;
 
     public AAIAndGuardSim() {
diff --git a/examples/examples-pcvs/src/main/java/org/onap/policy/apex/examples/pcvs/model/PCVSDomainModelSaver.java b/examples/examples-pcvs/src/main/java/org/onap/policy/apex/examples/pcvs/model/PCVSDomainModelSaver.java
index ee6277a..65e84a4 100644
--- a/examples/examples-pcvs/src/main/java/org/onap/policy/apex/examples/pcvs/model/PCVSDomainModelSaver.java
+++ b/examples/examples-pcvs/src/main/java/org/onap/policy/apex/examples/pcvs/model/PCVSDomainModelSaver.java
@@ -50,8 +50,8 @@
         final AxPolicyModel pcvsPolicyModel = new PCVSDomainModelFactory().getPCVVpnSlaSPolicyModel(args[0]);
         final ApexModelSaver<AxPolicyModel> pcvsModelSaver =
                 new ApexModelSaver<>(AxPolicyModel.class, pcvsPolicyModel, args[1] + "vpnsla/");
-        pcvsModelSaver.apexModelWriteJSON();
-        pcvsModelSaver.apexModelWriteXML();
+        pcvsModelSaver.apexModelWriteJson();
+        pcvsModelSaver.apexModelWriteXml();
 
     }
 }
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/ApexConceptException.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/ApexConceptException.java
index 1ffb277..d62818d 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/ApexConceptException.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/ApexConceptException.java
@@ -41,9 +41,9 @@
      * Instantiates a new apex concept exception.
      *
      * @param message the message on the exception
-     * @param e the exception that caused this Apex exception
+     * @param exception the exception that caused this Apex exception
      */
-    public ApexConceptException(final String message, final Exception e) {
-        super(message, e);
+    public ApexConceptException(final String message, final Exception exception) {
+        super(message, exception);
     }
 }
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/ApexException.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/ApexException.java
index 94472d3..97920c3 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/ApexException.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/ApexException.java
@@ -55,21 +55,21 @@
      * Instantiates a new apex exception.
      *
      * @param message the message on the exception
-     * @param e the exception that caused this Apex exception
+     * @param exception the exception that caused this Apex exception
      */
-    public ApexException(final String message, final Exception e) {
-        this(message, e, null);
+    public ApexException(final String message, final Exception exception) {
+        this(message, exception, null);
     }
 
     /**
      * Instantiates a new apex exception.
      *
      * @param message the message on the exception
-     * @param e the exception that caused this Apex exception
+     * @param exception the exception that caused this Apex exception
      * @param object the object that the exception was thrown on
      */
-    public ApexException(final String message, final Exception e, final Object object) {
-        super(message, e);
+    public ApexException(final String message, final Exception exception, final Object object) {
+        super(message, exception);
         this.object = object;
     }
 
@@ -83,7 +83,7 @@
     }
 
     /**
-     * Build a cascaded message from an exception and all its nested exceptions
+     * Build a cascaded message from an exception and all its nested exceptions.
      * @param throwable the top level exception
      * @return cascaded message string
      */
@@ -100,7 +100,6 @@
     }
 
     /**
-     *
      * Get the object on which the exception was thrown.
      *
      * @return The object on which the exception was thrown
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/ApexRuntimeException.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/ApexRuntimeException.java
index 5724b48..b4240ad 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/ApexRuntimeException.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/ApexRuntimeException.java
@@ -55,21 +55,21 @@
      * Instantiates a new apex runtime exception.
      *
      * @param message the message on the exception
-     * @param e the exception that caused this Apex exception
+     * @param exception the exception that caused this Apex exception
      */
-    public ApexRuntimeException(final String message, final Exception e) {
-        this(message, e, null);
+    public ApexRuntimeException(final String message, final Exception exception) {
+        this(message, exception, null);
     }
 
     /**
      * Instantiates a new apex runtime exception.
      *
      * @param message the message on the exception
-     * @param e the exception that caused this Apex exception
+     * @param exception the exception that caused this Apex exception
      * @param object the object that the exception was thrown on
      */
-    public ApexRuntimeException(final String message, final Exception e, final Object object) {
-        super(message, e);
+    public ApexRuntimeException(final String message, final Exception exception, final Object object) {
+        super(message, exception);
         this.object = object;
     }
 
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxArtifactKey.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxArtifactKey.java
index e08c3c6..1f906ea 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxArtifactKey.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxArtifactKey.java
@@ -38,15 +38,16 @@
  * An artifact key uniquely identifies every first order entity in the system. Every first order concept in the system
  * must have an {@link AxArtifactKey} to identify it. Concepts that are wholly contained in another concept are
  * identified using a {@link AxReferenceKey} key.
- * <p>
- * Key validation checks that the name and version fields match the {@link NAME_REGEXP} and {@link VERSION_REGEXP}
+ * 
+ * <p>Key validation checks that the name and version fields match the {@link NAME_REGEXP} and {@link VERSION_REGEXP}
  * regular expressions respectively.
  */
 @Embeddable
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "apexArtifactKey", namespace = "http://www.onap.org/policy/apex-pdp")
 
-@XmlType(name = "AxArtifactKey", namespace = "http://www.onap.org/policy/apex-pdp", propOrder = { "name", "version" })
+@XmlType(name = "AxArtifactKey", namespace = "http://www.onap.org/policy/apex-pdp", propOrder =
+    { "name", "version" })
 
 public class AxArtifactKey extends AxKey {
     private static final long serialVersionUID = 8932717618579392561L;
@@ -70,10 +71,9 @@
     }
 
     /**
-     * Copy constructor
+     * Copy constructor.
      *
-     * @param copyConcept
-     *        the concept to copy from
+     * @param copyConcept the concept to copy from
      */
     public AxArtifactKey(final AxArtifactKey copyConcept) {
         super(copyConcept);
@@ -82,10 +82,8 @@
     /**
      * Constructor to create a key with the specified name and version.
      *
-     * @param name
-     *        the key name
-     * @param version
-     *        the key version
+     * @param name the key name
+     * @param version the key version
      */
     public AxArtifactKey(final String name, final String version) {
         super();
@@ -96,8 +94,7 @@
     /**
      * Constructor to create a key using the key and version from the specified key ID.
      *
-     * @param id
-     *        the key ID in a format that respects the {@link KEY_ID_REGEXP}
+     * @param id the key ID in a format that respects the {@link KEY_ID_REGEXP}
      */
     public AxArtifactKey(final String id) {
         Assertions.argumentNotNull(id, "id may not be null");
@@ -152,7 +149,7 @@
      * @see org.onap.policy.apex.model.basicmodel.concepts.AxKey#getID()
      */
     @Override
-    public String getID() {
+    public String getId() {
         return name + ':' + version;
     }
 
@@ -168,8 +165,7 @@
     /**
      * Sets the key name.
      *
-     * @param name
-     *        the key name
+     * @param name the key name
      */
     public void setName(final String name) {
         this.name = Assertions.validateStringParameter(NAME_TOKEN, name, NAME_REGEXP);
@@ -187,8 +183,7 @@
     /**
      * Sets the key version.
      *
-     * @param version
-     *        the key version
+     * @param version the key version
      */
     public void setVersion(final String version) {
         this.version = Assertions.validateStringParameter(VERSION_TOKEN, version, VERSION_REGEXP);
@@ -265,8 +260,8 @@
                             "name invalid-" + nameValidationErrorMessage));
         }
 
-        final String versionValidationErrorMessage = Assertions.getStringParameterValidationMessage(VERSION_TOKEN, version,
-                        VERSION_REGEXP);
+        final String versionValidationErrorMessage = Assertions.getStringParameterValidationMessage(VERSION_TOKEN,
+                        version, VERSION_REGEXP);
         if (versionValidationErrorMessage != null) {
             result.addValidationMessage(new AxValidationMessage(this, this.getClass(), ValidationResult.INVALID,
                             "version invalid-" + versionValidationErrorMessage));
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxConcept.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxConcept.java
index 3d7f502..bb66147 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxConcept.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxConcept.java
@@ -40,12 +40,12 @@
     private static final long serialVersionUID = -7434939557282697490L;
 
     /**
-     * Default constructor
+     * Default constructor.
      */
     public AxConcept() {}
 
     /**
-     * Copy constructor
+     * Copy constructor.
      * 
      * @param copyConcept the concept to copy from
      */
@@ -120,8 +120,8 @@
      *
      * @return the ID string of this concept
      */
-    public String getID() {
-        return getKey().getID();
+    public String getId() {
+        return getKey().getId();
     }
 
     /**
@@ -130,10 +130,10 @@
      * @param id the key ID to match against
      * @return true, if this key matches the ID
      */
-    public final boolean matchesID(final String id) {
+    public final boolean matchesId(final String id) {
         Assertions.argumentNotNull(id, "id may not be null");
 
         // Check the ID
-        return getID().equals(id);
+        return getId().equals(id);
     }
 }
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxConceptGetter.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxConceptGetter.java
index 0735f87..0284de4 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxConceptGetter.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxConceptGetter.java
@@ -24,9 +24,9 @@
 
 /**
  * This interface is used to allow get methods to be placed on concepts that have embedded maps.
- * <p>
- * It forces those concepts with maps to implement the get methods specified on this interface as convenience methods to avoid concept users having to use a
- * second level of referencing to access concepts in the the maps.
+ * 
+ * <p>It forces those concepts with maps to implement the get methods specified on this interface as convenience methods
+ * to avoid concept users having to use a second level of referencing to access concepts in the the maps.
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  * @param <C> the type of concept on which the interface is applied.
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxConceptGetterImpl.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxConceptGetterImpl.java
index b4bff80..866de80 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxConceptGetterImpl.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxConceptGetterImpl.java
@@ -82,7 +82,8 @@
                 break;
             }
             foundKey = nextkey;
-        } while (true);
+        }
+        while (true);
 
         return conceptMap.get(foundKey);
     }
@@ -147,7 +148,8 @@
                 break;
             }
             returnSet.add(conceptMap.get(foundKey));
-        } while (true);
+        }
+        while (true);
 
         return returnSet;
     }
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxKey.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxKey.java
index 36b4925..5702a65 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxKey.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxKey.java
@@ -65,14 +65,14 @@
     }
 
     /**
-     * Default constructor
+     * Default constructor.
      */
     public AxKey() {
         super();
     }
 
     /**
-     * Copy constructor
+     * Copy constructor.
      *
      * @param copyConcept the concept to copy from
      */
@@ -86,7 +86,7 @@
      * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#getID()
      */
     @Override
-    public abstract String getID();
+    public abstract String getId();
 
     /**
      * Return the result of a compatibility check of two keys.
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxKeyInfo.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxKeyInfo.java
index 6c709fa..2c2952d 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxKeyInfo.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxKeyInfo.java
@@ -37,16 +37,16 @@
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 
 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult.ValidationResult;
-import org.onap.policy.apex.model.basicmodel.dao.converters.CDATAConditioner;
-import org.onap.policy.apex.model.basicmodel.dao.converters.UUID2String;
+import org.onap.policy.apex.model.basicmodel.dao.converters.CDataConditioner;
+import org.onap.policy.apex.model.basicmodel.dao.converters.Uuid2String;
 import org.onap.policy.apex.model.utilities.Assertions;
 
 /**
  * The key information on an {@link AxArtifactKey} key in an Apex policy model. Each {@link AxArtifactKey} must have an
  * {@link AxKeyInfo} object. THe information held is the key's UUID and it's description.
- * <p>
- * Validation checks that all fields are defined and that the key is valid. It also observes that descriptions are blank
- * and warns if the UUID is a zero UUID.
+ * 
+ * <p>Validation checks that all fields are defined and that the key is valid. It also observes that descriptions are
+ * blank and warns if the UUID is a zero UUID.
  */
 
 @Entity
@@ -68,14 +68,14 @@
     private AxArtifactKey key;
 
     @Column(name = "uuid")
-    @Convert(converter = UUID2String.class)
-    @XmlJavaTypeAdapter(value = UUID2String.class)
+    @Convert(converter = Uuid2String.class)
+    @XmlJavaTypeAdapter(value = Uuid2String.class)
     @XmlElement(name = "UUID", required = true)
     private UUID uuid;
 
     @Column(name = "description", length = MAX_DESCRIPTION_LENGTH_8192)
-    @Convert(converter = CDATAConditioner.class)
-    @XmlJavaTypeAdapter(value = CDATAConditioner.class)
+    @Convert(converter = CDataConditioner.class)
+    @XmlJavaTypeAdapter(value = CDataConditioner.class)
     @XmlElement(required = true)
     private String description;
 
@@ -87,7 +87,7 @@
     }
 
     /**
-     * Copy constructor
+     * Copy constructor.
      *
      * @param copyConcept the concept to copy from
      */
@@ -101,7 +101,7 @@
      * @param key the key of the concept
      */
     public AxKeyInfo(final AxArtifactKey key) {
-        this(key, UUID.randomUUID(), "Generated description for concept referred to by key \"" + key.getID() + "\"");
+        this(key, UUID.randomUUID(), "Generated description for concept referred to by key \"" + key.getId() + "\"");
     }
 
     /**
@@ -157,7 +157,7 @@
      *
      * @return the uuid of the concept
      */
-    public UUID getUUID() {
+    public UUID getUuid() {
         return uuid;
     }
 
@@ -313,8 +313,8 @@
         if (!uuid.equals(other.uuid)) {
             return false;
         }
-        final String thisdesc = CDATAConditioner.clean(description);
-        final String otherdesc = CDATAConditioner.clean(other.description);
+        final String thisdesc = CDataConditioner.clean(description);
+        final String otherdesc = CDataConditioner.clean(other.description);
         return thisdesc.equals(otherdesc);
     }
 
@@ -351,7 +351,7 @@
      * @param seed the seed
      * @return the uuid
      */
-    public static UUID generateReproducibleUUID(final String seed) {
+    public static UUID generateReproducibleUuid(final String seed) {
         final Random random;
         if (seed != null && seed.length() > 0) {
             random = new Random(seed.hashCode());
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxKeyInformation.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxKeyInformation.java
index 6590ff4..9afec99 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxKeyInformation.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxKeyInformation.java
@@ -50,9 +50,9 @@
  * {@link AxModel} must have an {@link AxKeyInformation} field. The {@link AxKeyInformation} class implements the helper
  * methods of the {@link AxConceptGetter} interface to allow {@link AxKeyInfo} instances to be retrieved by calling
  * methods directly on this class without referencing the contained map.
- * <p>
- * Validation checks that the key is not null, that the key information map is not empty, that each key and value in the
- * map is defined, that the key in each map entry matches the key if each entry value, and that no duplicate UUIDs
+ * 
+ * <p>Validation checks that the key is not null, that the key information map is not empty, that each key and value in
+ * the map is defined, that the key in each map entry matches the key if each entry value, and that no duplicate UUIDs
  * exist. Each key information entry is then validated individually.
  */
 @Entity
@@ -87,7 +87,7 @@
     }
 
     /**
-     * Copy constructor
+     * Copy constructor.
      *
      * @param copyConcept the concept to copy from
      */
@@ -125,10 +125,10 @@
      * Map. This method is called by JAXB after unmarshaling and is used to convert the hash map to a
      * {@link NavigableMap} so that it will work with the {@link AxConceptGetter} interface.
      *
-     * @param u the unmarshaler that is unmarshaling the model
+     * @param unmarshaler the unmarshaler that is unmarshaling the model
      * @param parent the parent object of this object in the unmarshaler
      */
-    public void afterUnmarshal(final Unmarshaller u, final Object parent) {
+    public void afterUnmarshal(final Unmarshaller unmarshaler, final Object parent) {
         // The map must be navigable to allow name and version searching,
         // unmarshaling returns a hash map
         final NavigableMap<AxArtifactKey, AxKeyInfo> navigablekeyInfoMap = new TreeMap<>();
@@ -152,7 +152,7 @@
             if (!keyInfoMap.containsKey(artifactKey)) {
                 final AxKeyInfo keyInfo = new AxKeyInfo(artifactKey);
                 // generate a reproducible UUID
-                keyInfo.setUuid(AxKeyInfo.generateReproducibleUUID(keyInfo.getID() + keyInfo.getDescription()));
+                keyInfo.setUuid(AxKeyInfo.generateReproducibleUuid(keyInfo.getId() + keyInfo.getDescription()));
                 keyInfoMap.put(artifactKey, keyInfo);
             }
         }
@@ -244,7 +244,7 @@
     }
 
     /**
-     * Validate an key information entry
+     * Validate an key information entry.
      *
      * @param keyInfoEntry the key information entry
      * @param uuidSet the set of UUIDs encountered in validation so far, the UUID of this entry is added to the set
@@ -268,12 +268,12 @@
 
             result = keyInfoEntry.getValue().validate(result);
 
-            if (uuidSet.contains(keyInfoEntry.getValue().getUUID())) {
+            if (uuidSet.contains(keyInfoEntry.getValue().getUuid())) {
                 result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
                         "duplicate UUID found on keyInfoMap entry " + keyInfoEntry.getKey() + ":"
-                                + keyInfoEntry.getValue().getUUID()));
+                                + keyInfoEntry.getValue().getUuid()));
             } else {
-                uuidSet.add(keyInfoEntry.getValue().getUUID());
+                uuidSet.add(keyInfoEntry.getValue().getUuid());
             }
         }
 
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxKeyUse.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxKeyUse.java
index eeb8dc6..09170de 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxKeyUse.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxKeyUse.java
@@ -29,8 +29,8 @@
  * This class records a usage of a key in the system. When the list of keys being used by a concept is built using the
  * getKeys() method of the {@link AxConcept} class, an instance of this class is created for every key occurrence. The
  * list of keys returned by the getKeys() method is a list of {@link AxKeyUse} objects.
- * <p>
- * Validation checks that each key is valid.
+ * 
+ * <p>Validation checks that each key is valid.
  */
 
 public class AxKeyUse extends AxKey {
@@ -46,7 +46,7 @@
     }
 
     /**
-     * Copy constructor
+     * Copy constructor.
      *
      * @param copyConcept the concept to copy from
      */
@@ -90,8 +90,8 @@
      * @see org.onap.policy.apex.model.basicmodel.concepts.AxKey#getID()
      */
     @Override
-    public String getID() {
-        return usedKey.getID();
+    public String getId() {
+        return usedKey.getId();
     }
 
     /**
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxModel.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxModel.java
index dac1d69..66045db 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxModel.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxModel.java
@@ -46,9 +46,9 @@
 /**
  * This class is the base class for all models in Apex. All model classes inherit from this model so all models must
  * have a key and have key information.
- * <p>
- * Validation checks that the model key is valid. It goes on to check for null keys and checks each key for uniqueness
- * in the model. A check is carried out to ensure that an {@link AxKeyInfo} instance exists for every
+ * 
+ * <p>Validation checks that the model key is valid. It goes on to check for null keys and checks each key for
+ * uniqueness in the model. A check is carried out to ensure that an {@link AxKeyInfo} instance exists for every
  * {@link AxArtifactKey} key. For each {@link AxReferenceKey} instance, a check is made that its parent and local name
  * are nut null and that a {@link AxKeyInfo} entry exists for its parent. Then a check is made that each used
  * {@link AxArtifactKey} and {@link AxReferenceKey} usage references a key that exists. Finally, a check is made to
@@ -61,7 +61,8 @@
 
 @XmlRootElement(name = "apexModel", namespace = "http://www.onap.org/policy/apex-pdp")
 @XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "AxModel", namespace = "http://www.onap.org/policy/apex-pdp", propOrder = { "key", "keyInformation" })
+@XmlType(name = "AxModel", namespace = "http://www.onap.org/policy/apex-pdp", propOrder =
+    { "key", "keyInformation" })
 
 public class AxModel extends AxConcept {
     private static final String IS_A_NULL_KEY = " is a null key";
@@ -88,7 +89,7 @@
     }
 
     /**
-     * Copy constructor
+     * Copy constructor.
      *
      * @param copyConcept the concept to copy from
      */
@@ -197,8 +198,8 @@
         AxValidationResult result = resultIn;
 
         if (key.equals(AxArtifactKey.getNullKey())) {
-            result.addValidationMessage(
-                    new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID, "key is a null key"));
+            result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
+                            "key is a null key"));
         }
 
         result = key.validate(result);
@@ -226,7 +227,7 @@
         for (final AxReferenceKey referenceKey : referenceKeySet) {
             if (!artifactKeySet.contains(referenceKey.getParentArtifactKey())) {
                 result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
-                        "parent artifact key not found for reference key " + referenceKey));
+                                "parent artifact key not found for reference key " + referenceKey));
             }
         }
 
@@ -236,7 +237,7 @@
         for (final AxArtifactKey keyInfoKey : keyInformation.getKeyInfoMap().keySet()) {
             if (!artifactKeySet.contains(keyInfoKey)) {
                 result.addValidationMessage(new AxValidationMessage(keyInfoKey, this.getClass(),
-                        ValidationResult.WARNING, "key not found for key information entry"));
+                                ValidationResult.WARNING, "key not found for key information entry"));
             }
         }
 
@@ -244,7 +245,7 @@
     }
 
     /**
-     * Check for consistent usage of an artifact key in the model
+     * Check for consistent usage of an artifact key in the model.
      *
      * @param artifactKey The artifact key to check
      * @param artifactKeySet The set of artifact keys encountered so far, this key is appended to the set
@@ -252,23 +253,23 @@
      * @return the result of the validation
      */
     private AxValidationResult validateArtifactKeyInModel(final AxArtifactKey artifactKey,
-            final Set<AxArtifactKey> artifactKeySet, final AxValidationResult result) {
+                    final Set<AxArtifactKey> artifactKeySet, final AxValidationResult result) {
         // Null key check
         if (artifactKey.equals(AxArtifactKey.getNullKey())) {
             result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
-                    "key " + artifactKey + IS_A_NULL_KEY));
+                            "key " + artifactKey + IS_A_NULL_KEY));
         }
 
         // Null key name start check
         if (artifactKey.getName().toUpperCase().startsWith(AxKey.NULL_KEY_NAME)) {
             result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
-                    "key " + artifactKey + " name starts with keyword " + AxKey.NULL_KEY_NAME));
+                            "key " + artifactKey + " name starts with keyword " + AxKey.NULL_KEY_NAME));
         }
 
         // Unique key check
         if (artifactKeySet.contains(artifactKey)) {
             result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
-                    "duplicate key " + artifactKey + " found"));
+                            "duplicate key " + artifactKey + " found"));
         } else {
             artifactKeySet.add(artifactKey);
         }
@@ -276,14 +277,14 @@
         // Key information check
         if (!keyInformation.getKeyInfoMap().containsKey(artifactKey)) {
             result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
-                    "key information not found for key " + artifactKey));
+                            "key information not found for key " + artifactKey));
         }
 
         return result;
     }
 
     /**
-     * Check for consistent usage of a reference key in the model
+     * Check for consistent usage of a reference key in the model.
      *
      * @param artifactKey The reference key to check
      * @param referenceKeySet The set of reference keys encountered so far, this key is appended to the set
@@ -291,35 +292,35 @@
      * @return the result of the validation
      */
     private AxValidationResult validateReferenceKeyInModel(final AxReferenceKey referenceKey,
-            final Set<AxReferenceKey> referenceKeySet, final AxValidationResult result) {
+                    final Set<AxReferenceKey> referenceKeySet, final AxValidationResult result) {
         // Null key check
         if (referenceKey.equals(AxReferenceKey.getNullKey())) {
             result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
-                    "key " + referenceKey + IS_A_NULL_KEY));
+                            "key " + referenceKey + IS_A_NULL_KEY));
         }
 
         // Null parent key check
         if (referenceKey.getParentArtifactKey().equals(AxArtifactKey.getNullKey())) {
             result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
-                    "parent artifact key of key " + referenceKey + IS_A_NULL_KEY));
+                            "parent artifact key of key " + referenceKey + IS_A_NULL_KEY));
         }
 
         // Null local name check
         if (referenceKey.getLocalName().equals(AxKey.NULL_KEY_NAME)) {
             result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
-                    "key " + referenceKey + " has a null local name"));
+                            "key " + referenceKey + " has a null local name"));
         }
 
         // Null key name start check
         if (referenceKey.getParentArtifactKey().getName().toUpperCase().startsWith(AxKey.NULL_KEY_NAME)) {
             result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
-                    "key " + referenceKey + " parent name starts with keyword " + AxKey.NULL_KEY_NAME));
+                            "key " + referenceKey + " parent name starts with keyword " + AxKey.NULL_KEY_NAME));
         }
 
         // Unique key check
         if (referenceKeySet.contains(referenceKey)) {
             result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
-                    "duplicate key " + referenceKey + " found"));
+                            "duplicate key " + referenceKey + " found"));
         } else {
             referenceKeySet.add(referenceKey);
         }
@@ -327,14 +328,14 @@
         // Key information check
         if (!keyInformation.getKeyInfoMap().containsKey(referenceKey.getParentArtifactKey())) {
             result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
-                    "key information not found for parent key of key " + referenceKey));
+                            "key information not found for parent key of key " + referenceKey));
         }
 
         return result;
     }
 
     /**
-     * Check for consistent usage of cross-key references in the model
+     * Check for consistent usage of cross-key references in the model.
      *
      * @param usedKeySet The set of all keys used in the model
      * @param artifactKeySet The set of artifact keys encountered so far, this key is appended to the set
@@ -343,20 +344,20 @@
      * @return the result of the validation
      */
     private AxValidationResult validateKeyUses(final Set<AxKeyUse> usedKeySet, final Set<AxArtifactKey> artifactKeySet,
-            final Set<AxReferenceKey> referenceKeySet, final AxValidationResult result) {
+                    final Set<AxReferenceKey> referenceKeySet, final AxValidationResult result) {
         // Check all key uses
         for (final AxKeyUse usedKey : usedKeySet) {
             if (usedKey.getKey() instanceof AxArtifactKey) {
                 // AxArtifact key usage, check the key exists
                 if (!artifactKeySet.contains(usedKey.getKey())) {
                     result.addValidationMessage(new AxValidationMessage(usedKey.getKey(), this.getClass(),
-                            ValidationResult.INVALID, "an artifact key used in the model is not defined"));
+                                    ValidationResult.INVALID, "an artifact key used in the model is not defined"));
                 }
             } else {
                 // AxReference key usage, check the key exists
                 if (!referenceKeySet.contains(usedKey.getKey())) {
                     result.addValidationMessage(new AxValidationMessage(usedKey.getKey(), this.getClass(),
-                            ValidationResult.INVALID, "a reference key used in the model is not defined"));
+                                    ValidationResult.INVALID, "a reference key used in the model is not defined"));
                 }
             }
         }
@@ -364,7 +365,6 @@
         return result;
     }
 
-
     /*
      * (non-Javadoc)
      *
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxReferenceKey.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxReferenceKey.java
index 7cb4dd8..55ea95c 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxReferenceKey.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxReferenceKey.java
@@ -38,16 +38,16 @@
  * A reference key identifies entities in the system that are contained in other entities. Every contained concept in
  * the system must have an {@link AxReferenceKey} to identify it. Non-contained first order concepts are identified
  * using an {@link AxArtifactKey} key.
- * <p>
- * An {@link AxReferenceKey} contains an {@link AxArtifactKey} key reference to the first order entity that contains it.
- * The local name of the reference key must uniquely identify the referenced concept among those concepts contained in
- * the reference key's parent. In other words, if a parent concept has more than one child, the local name in the key of
- * all its children must be unique.
- * <p>
- * If a reference key's parent is itself a reference key, then the parent's local name must be set in the reference key.
- * If the parent is a first order concept, then the parent's local name in the key will be set to NULL.
- * <p>
- * Key validation checks that the parent name and parent version fields match the {@link NAME_REGEXP} and
+ * 
+ * <p>An {@link AxReferenceKey} contains an {@link AxArtifactKey} key reference to the first order entity that contains
+ * it. The local name of the reference key must uniquely identify the referenced concept among those concepts contained
+ * in the reference key's parent. In other words, if a parent concept has more than one child, the local name in the key
+ * of all its children must be unique.
+ * 
+ * <p>If a reference key's parent is itself a reference key, then the parent's local name must be set in the reference
+ * key. If the parent is a first order concept, then the parent's local name in the key will be set to NULL.
+ * 
+ * <p>Key validation checks that the parent name and parent version fields match the {@link NAME_REGEXP} and
  * {@link VERSION_REGEXP} regular expressions respectively and that the local name fields match the
  * {@link LOCAL_NAME_REGEXP} regular expression.
  */
@@ -69,7 +69,8 @@
     public static final String LOCAL_NAME_REGEXP = "[A-Za-z0-9\\-_\\.]+|^$";
 
     /** Regular expression to specify the structure of IDs in reference keys. */
-    public static final String REFERENCE_KEY_ID_REGEXP = "[A-Za-z0-9\\-_]+:[0-9].[0-9].[0-9]:[A-Za-z0-9\\-_]+:[A-Za-z0-9\\-_]+";
+    public static final String REFERENCE_KEY_ID_REGEXP =
+                    "[A-Za-z0-9\\-_]+:[0-9].[0-9].[0-9]:[A-Za-z0-9\\-_]+:[A-Za-z0-9\\-_]+";
 
     private static final int PARENT_NAME_FIELD = 0;
     private static final int PARENT_VERSION_FIELD = 1;
@@ -262,7 +263,7 @@
      * @see org.onap.policy.apex.model.basicmodel.concepts.AxKey#getID()
      */
     @Override
-    public String getID() {
+    public String getId() {
         return parentKeyName + ':' + parentKeyVersion + ':' + parentLocalName + ':' + localName;
     }
 
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxValidationResult.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxValidationResult.java
index 664cf95..dbe4c6a 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxValidationResult.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxValidationResult.java
@@ -73,7 +73,7 @@
      *
      * @return true, if the concept has no warnings or errors
      */
-    public boolean isOK() {
+    public boolean isOk() {
         return validationResult == ValidationResult.VALID || validationResult == ValidationResult.OBSERVATION;
     }
 
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/ApexDao.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/ApexDao.java
index 461f3f1..655e9a9 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/ApexDao.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/ApexDao.java
@@ -43,7 +43,7 @@
      * @param daoParameters parameters to use to access the database
      * @throws ApexException on initialization errors
      */
-    void init(DAOParameters daoParameters) throws ApexException;
+    void init(DaoParameters daoParameters) throws ApexException;
 
     /**
      * Close the Apex DAO.
@@ -70,19 +70,19 @@
      * Delete an Apex concept on the database.
      *
      * @param <T> the type of the object to delete, a subclass of {@link AxConcept}
-     * @param aClass the class of the object to delete, a subclass of {@link AxConcept}
+     * @param someClass the class of the object to delete, a subclass of {@link AxConcept}
      * @param key the key of the object to delete
      */
-    <T extends AxConcept> void delete(Class<T> aClass, AxArtifactKey key);
+    <T extends AxConcept> void delete(Class<T> someClass, AxArtifactKey key);
 
     /**
      * Delete an Apex concept on the database.
      *
      * @param <T> the type of the object to delete, a subclass of {@link AxConcept}
-     * @param aClass the class of the object to delete, a subclass of {@link AxConcept}
+     * @param someClass the class of the object to delete, a subclass of {@link AxConcept}
      * @param key the key of the object to delete
      */
-    <T extends AxConcept> void delete(Class<T> aClass, AxReferenceKey key);
+    <T extends AxConcept> void delete(Class<T> someClass, AxReferenceKey key);
 
     /**
      * Create a collection of objects in the database.
@@ -90,7 +90,7 @@
      * @param <T> the type of the object to create, a subclass of {@link AxConcept}
      * @param objs the objects to create
      */
-    <T extends AxConcept> void create(Collection<T> objs);
+    <T extends AxConcept> void createCollection(Collection<T> objs);
 
     /**
      * Delete a collection of objects in the database.
@@ -98,103 +98,103 @@
      * @param <T> the type of the objects to delete, a subclass of {@link AxConcept}
      * @param objs the objects to delete
      */
-    <T extends AxConcept> void delete(Collection<T> objs);
+    <T extends AxConcept> void deleteCollection(Collection<T> objs);
 
     /**
      * Delete a collection of objects in the database referred to by artifact key.
      *
      * @param <T> the type of the objects to delete, a subclass of {@link AxConcept}
-     * @param aClass the class of the objects to delete, a subclass of {@link AxConcept}
+     * @param someClass the class of the objects to delete, a subclass of {@link AxConcept}
      * @param keys the keys of the objects to delete
      * @return the number of objects deleted
      */
-    <T extends AxConcept> int deleteByArtifactKey(Class<T> aClass, Collection<AxArtifactKey> keys);
+    <T extends AxConcept> int deleteByArtifactKey(Class<T> someClass, Collection<AxArtifactKey> keys);
 
     /**
      * Delete a collection of objects in the database referred to by reference key.
      *
      * @param <T> the type of the objects to delete, a subclass of {@link AxConcept}
-     * @param aClass the class of the objects to delete, a subclass of {@link AxConcept}
+     * @param someClass the class of the objects to delete, a subclass of {@link AxConcept}
      * @param keys the keys of the objects to delete
      * @return the number of objects deleted
      */
-    <T extends AxConcept> int deleteByReferenceKey(Class<T> aClass, Collection<AxReferenceKey> keys);
+    <T extends AxConcept> int deleteByReferenceKey(Class<T> someClass, Collection<AxReferenceKey> keys);
 
     /**
      * Delete all objects of a given class in the database.
      *
      * @param <T> the type of the objects to delete, a subclass of {@link AxConcept}
-     * @param aClass the class of the objects to delete, a subclass of {@link AxConcept}
+     * @param someClass the class of the objects to delete, a subclass of {@link AxConcept}
      */
-    <T extends AxConcept> void deleteAll(Class<T> aClass);
+    <T extends AxConcept> void deleteAll(Class<T> someClass);
 
     /**
      * Get an object from the database, referred to by artifact key.
      *
      * @param <T> the type of the object to get, a subclass of {@link AxConcept}
-     * @param aClass the class of the object to get, a subclass of {@link AxConcept}
+     * @param someClass the class of the object to get, a subclass of {@link AxConcept}
      * @param key the key of the object to get
      * @return the object that was retrieved from the database
      */
-    <T extends AxConcept> T get(Class<T> aClass, AxArtifactKey key);
+    <T extends AxConcept> T get(Class<T> someClass, AxArtifactKey key);
 
     /**
      * Get an object from the database, referred to by reference key.
      *
      * @param <T> the type of the object to get, a subclass of {@link AxConcept}
-     * @param aClass the class of the object to get, a subclass of {@link AxConcept}
+     * @param someClass the class of the object to get, a subclass of {@link AxConcept}
      * @param key the key of the object to get
      * @return the object that was retrieved from the database or null if the object was not retrieved
      */
-    <T extends AxConcept> T get(Class<T> aClass, AxReferenceKey key);
+    <T extends AxConcept> T get(Class<T> someClass, AxReferenceKey key);
 
     /**
      * Get all the objects in the database of a given type.
      *
      * @param <T> the type of the objects to get, a subclass of {@link AxConcept}
-     * @param aClass the class of the objects to get, a subclass of {@link AxConcept}
+     * @param someClass the class of the objects to get, a subclass of {@link AxConcept}
      * @return the objects or null if no objects were retrieved
      */
-    <T extends AxConcept> List<T> getAll(Class<T> aClass);
+    <T extends AxConcept> List<T> getAll(Class<T> someClass);
 
     /**
      * Get all the objects in the database of the given type with the given parent artifact key.
      *
      * @param <T> the type of the objects to get, a subclass of {@link AxConcept}
-     * @param aClass the class of the objects to get, a subclass of {@link AxConcept}
+     * @param someClass the class of the objects to get, a subclass of {@link AxConcept}
      * @param parentKey the parent key of the concepts to get
      * @return the all
      */
-    <T extends AxConcept> List<T> getAll(Class<T> aClass, AxArtifactKey parentKey);
+    <T extends AxConcept> List<T> getAll(Class<T> someClass, AxArtifactKey parentKey);
 
     /**
      * Get a concept from the database with the given artifact key.
      *
      * @param <T> the type of the object to get, a subclass of {@link AxConcept}
-     * @param aClass the class of the object to get, a subclass of {@link AxConcept}
-     * @param artifactID the artifact key of the concept to get
+     * @param someClass the class of the object to get, a subclass of {@link AxConcept}
+     * @param artifactId the artifact key of the concept to get
      * @return the concept that matches the key or null if the concept is not retrieved
      */
-    <T extends AxConcept> T getArtifact(Class<T> aClass, AxArtifactKey artifactID);
+    <T extends AxConcept> T getArtifact(Class<T> someClass, AxArtifactKey artifactId);
 
     /**
      * Get a concept from the database with the given reference key.
      *
      * @param <T> the type of the object to get, a subclass of {@link AxConcept}
-     * @param aClass the class of the object to get, a subclass of {@link AxConcept}
-     * @param artifactID the artifact key of the concept to get
+     * @param someClass the class of the object to get, a subclass of {@link AxConcept}
+     * @param artifactId the artifact key of the concept to get
      * @return the concept that matches the key or null if the concept is not retrieved
      */
-    <T extends AxConcept> T getArtifact(Class<T> aClass, AxReferenceKey artifactID);
+    <T extends AxConcept> T getArtifact(Class<T> someClass, AxReferenceKey artifactId);
 
     /**
      * Get the number of instances of a concept that exist in the database.
      *
      * @param <T> the type of the object to get, a subclass of {@link AxConcept}
-     * @param aClass the class of the object to get, a subclass of {@link AxConcept}
+     * @param someClass the class of the object to get, a subclass of {@link AxConcept}
      * @return the number of instances of the concept in the database
      */
-    <T extends AxConcept> long size(Class<T> aClass);
+    <T extends AxConcept> long size(Class<T> someClass);
 
     /**
      * Update a concept in the database.
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/ApexDaoFactory.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/ApexDaoFactory.java
index 50724d2..82838ed 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/ApexDaoFactory.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/ApexDaoFactory.java
@@ -27,7 +27,7 @@
 
 /**
  * This factory class returns an Apex DAO for the configured persistence mechanism. The factory uses the plugin class
- * specified in {@link DAOParameters} to instantiate a DAO instance.
+ * specified in {@link DaoParameters} to instantiate a DAO instance.
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
@@ -42,7 +42,7 @@
      * @return the Apex DAO
      * @throws ApexException on invalid JPA plugins
      */
-    public ApexDao createApexDao(final DAOParameters daoParameters) throws ApexException {
+    public ApexDao createApexDao(final DaoParameters daoParameters) throws ApexException {
         Assertions.argumentNotNull(daoParameters, ApexException.class, "Parameter \"daoParameters\" may not be null");
 
         // Get the class for the DAO using reflection
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/DAOParameters.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/DaoParameters.java
similarity index 99%
rename from model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/DAOParameters.java
rename to model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/DaoParameters.java
index 5a44d18..cdaf64e 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/DAOParameters.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/DaoParameters.java
@@ -27,7 +27,7 @@
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
-public class DAOParameters {
+public class DaoParameters {
     /** The default Apex DAO plugin class. */
     public static final String DEFAULT_PLUGIN_CLASS = "org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao";
 
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/converters/CDATAConditioner.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/converters/CDataConditioner.java
similarity index 89%
rename from model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/converters/CDATAConditioner.java
rename to model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/converters/CDataConditioner.java
index 9e840da..93c891b 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/converters/CDATAConditioner.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/converters/CDataConditioner.java
@@ -31,7 +31,7 @@
  * @author John Keeney (John.Keeney@ericsson.com)
  */
 @Converter
-public class CDATAConditioner extends XmlAdapter<String, String> implements AttributeConverter<String, String> {
+public class CDataConditioner extends XmlAdapter<String, String> implements AttributeConverter<String, String> {
 
     private static final String NL = "\n";
 
@@ -61,8 +61,8 @@
      * @see javax.xml.bind.annotation.adapters.XmlAdapter
      */
     @Override
-    public String unmarshal(final String v) throws Exception {
-        return this.convertToEntityAttribute(v);
+    public String unmarshal(final String value) throws Exception {
+        return this.convertToEntityAttribute(value);
     }
 
     /*
@@ -71,8 +71,8 @@
      * @see javax.xml.bind.annotation.adapters.XmlAdapter
      */
     @Override
-    public String marshal(final String v) throws Exception {
-        return this.convertToDatabaseColumn(v);
+    public String marshal(final String value) throws Exception {
+        return this.convertToDatabaseColumn(value);
     }
 
     /**
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/converters/UUID2String.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/converters/Uuid2String.java
similarity index 88%
rename from model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/converters/UUID2String.java
rename to model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/converters/Uuid2String.java
index f26dfc2..3f7bddb 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/converters/UUID2String.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/converters/Uuid2String.java
@@ -32,7 +32,7 @@
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
 @Converter
-public class UUID2String extends XmlAdapter<String, UUID> implements AttributeConverter<UUID, String> {
+public class Uuid2String extends XmlAdapter<String, UUID> implements AttributeConverter<UUID, String> {
 
     /*
      * (non-Javadoc)
@@ -67,8 +67,8 @@
      * @see javax.xml.bind.annotation.adapters.XmlAdapter
      */
     @Override
-    public UUID unmarshal(final String v) throws Exception {
-        return this.convertToEntityAttribute(v);
+    public UUID unmarshal(final String value) throws Exception {
+        return this.convertToEntityAttribute(value);
     }
 
     /*
@@ -77,7 +77,7 @@
      * @see javax.xml.bind.annotation.adapters.XmlAdapter
      */
     @Override
-    public String marshal(final UUID v) throws Exception {
-        return this.convertToDatabaseColumn(v);
+    public String marshal(final UUID value) throws Exception {
+        return this.convertToDatabaseColumn(value);
     }
 }
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/impl/DefaultApexDao.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/impl/DefaultApexDao.java
index 228362b..7945a08 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/impl/DefaultApexDao.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/impl/DefaultApexDao.java
@@ -34,7 +34,7 @@
 import org.onap.policy.apex.model.basicmodel.concepts.AxConcept;
 import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey;
 import org.onap.policy.apex.model.basicmodel.dao.ApexDao;
-import org.onap.policy.apex.model.basicmodel.dao.DAOParameters;
+import org.onap.policy.apex.model.basicmodel.dao.DaoParameters;
 import org.slf4j.ext.XLogger;
 import org.slf4j.ext.XLoggerFactory;
 
@@ -66,7 +66,7 @@
      * org.onap.policy.apex.model.basicmodel.dao.ApexDao#init(org.onap.policy.apex.model.basicmodel.dao.DAOParameters)
      */
     @Override
-    public void init(final DAOParameters daoParameters) throws ApexException {
+    public void init(final DaoParameters daoParameters) throws ApexException {
         if (daoParameters == null || daoParameters.getPersistenceUnit() == null) {
             LOGGER.error("Apex persistence unit parameter not set");
             throw new ApexException("Apex persistence unit parameter not set");
@@ -75,11 +75,12 @@
         LOGGER.debug("Creating Apex persistence unit \"" + daoParameters.getPersistenceUnit() + "\" . . .");
         try {
             emf = Persistence.createEntityManagerFactory(daoParameters.getPersistenceUnit(),
-                    daoParameters.getJdbcProperties());
+                            daoParameters.getJdbcProperties());
         } catch (final Exception e) {
             LOGGER.warn("Creation of Apex persistence unit \"" + daoParameters.getPersistenceUnit() + "\" failed", e);
             throw new ApexException(
-                    "Creation of Apex persistence unit \"" + daoParameters.getPersistenceUnit() + "\" failed", e);
+                            "Creation of Apex persistence unit \"" + daoParameters.getPersistenceUnit() + "\" failed",
+                            e);
         }
         LOGGER.debug("Created Apex persistence unit \"" + daoParameters.getPersistenceUnit() + "\"");
     }
@@ -159,15 +160,15 @@
      * org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey)
      */
     @Override
-    public <T extends AxConcept> void delete(final Class<T> aClass, final AxArtifactKey key) {
+    public <T extends AxConcept> void delete(final Class<T> someClass, final AxArtifactKey key) {
         if (key == null) {
             return;
         }
         final EntityManager mg = getEntityManager();
         try {
             mg.getTransaction().begin();
-            mg.createQuery(DELETE_FROM + aClass.getSimpleName() + C_WHERE_C_KEY_NAME + key.getName() + AND_C_KEY_VERSION
-                    + key.getVersion() + "'", aClass).executeUpdate();
+            mg.createQuery(DELETE_FROM + someClass.getSimpleName() + C_WHERE_C_KEY_NAME + key.getName()
+                            + AND_C_KEY_VERSION + key.getVersion() + "'", someClass).executeUpdate();
             mg.getTransaction().commit();
         } finally {
             mg.close();
@@ -181,16 +182,16 @@
      * org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey)
      */
     @Override
-    public <T extends AxConcept> void delete(final Class<T> aClass, final AxReferenceKey key) {
+    public <T extends AxConcept> void delete(final Class<T> someClass, final AxReferenceKey key) {
         if (key == null) {
             return;
         }
         final EntityManager mg = getEntityManager();
         try {
             mg.getTransaction().begin();
-            mg.createQuery(DELETE_FROM + aClass.getSimpleName() + C_WHERE_C_KEY_PARENT_KEY_NAME + key.getParentKeyName()
-                    + AND_C_KEY_PARENT_KEY_VERSION + key.getParentKeyVersion() + AND_C_KEY_LOCAL_NAME
-                    + key.getLocalName() + "'", aClass).executeUpdate();
+            mg.createQuery(DELETE_FROM + someClass.getSimpleName() + C_WHERE_C_KEY_PARENT_KEY_NAME
+                            + key.getParentKeyName() + AND_C_KEY_PARENT_KEY_VERSION + key.getParentKeyVersion()
+                            + AND_C_KEY_LOCAL_NAME + key.getLocalName() + "'", someClass).executeUpdate();
             mg.getTransaction().commit();
         } finally {
             mg.close();
@@ -203,7 +204,7 @@
      * @see org.onap.policy.apex.model.basicmodel.dao.ApexDao#create(java.util.Collection)
      */
     @Override
-    public <T extends AxConcept> void create(final Collection<T> objs) {
+    public <T extends AxConcept> void createCollection(final Collection<T> objs) {
         if (objs == null || objs.isEmpty()) {
             return;
         }
@@ -225,7 +226,7 @@
      * @see org.onap.policy.apex.model.basicmodel.dao.ApexDao#delete(java.util.Collection)
      */
     @Override
-    public <T extends AxConcept> void delete(final Collection<T> objs) {
+    public <T extends AxConcept> void deleteCollection(final Collection<T> objs) {
         if (objs == null || objs.isEmpty()) {
             return;
         }
@@ -247,7 +248,8 @@
      * @see org.onap.policy.apex.model.basicmodel.dao.ApexDao#deleteByArtifactKey(java.lang.Class, java.util.Collection)
      */
     @Override
-    public <T extends AxConcept> int deleteByArtifactKey(final Class<T> aClass, final Collection<AxArtifactKey> keys) {
+    public <T extends AxConcept> int deleteByArtifactKey(final Class<T> someClass,
+                    final Collection<AxArtifactKey> keys) {
         if (keys == null || keys.isEmpty()) {
             return 0;
         }
@@ -256,8 +258,10 @@
         try {
             mg.getTransaction().begin();
             for (final AxArtifactKey key : keys) {
-                deletedCount += mg.createQuery(DELETE_FROM + aClass.getSimpleName() + C_WHERE_C_KEY_NAME + key.getName()
-                        + AND_C_KEY_VERSION + key.getVersion() + "'", aClass).executeUpdate();
+                deletedCount += mg
+                                .createQuery(DELETE_FROM + someClass.getSimpleName() + C_WHERE_C_KEY_NAME
+                                                + key.getName() + AND_C_KEY_VERSION + key.getVersion() + "'", someClass)
+                                .executeUpdate();
             }
             mg.getTransaction().commit();
         } finally {
@@ -273,8 +277,8 @@
      * java.util.Collection)
      */
     @Override
-    public <T extends AxConcept> int deleteByReferenceKey(final Class<T> aClass,
-            final Collection<AxReferenceKey> keys) {
+    public <T extends AxConcept> int deleteByReferenceKey(final Class<T> someClass,
+                    final Collection<AxReferenceKey> keys) {
         if (keys == null || keys.isEmpty()) {
             return 0;
         }
@@ -283,12 +287,9 @@
         try {
             mg.getTransaction().begin();
             for (final AxReferenceKey key : keys) {
-                deletedCount +=
-                        mg.createQuery(
-                                DELETE_FROM + aClass.getSimpleName() + C_WHERE_C_KEY_PARENT_KEY_NAME
-                                        + key.getParentKeyName() + AND_C_KEY_PARENT_KEY_VERSION
-                                        + key.getParentKeyVersion() + AND_C_KEY_LOCAL_NAME + key.getLocalName() + "'",
-                                aClass).executeUpdate();
+                deletedCount += mg.createQuery(DELETE_FROM + someClass.getSimpleName() + C_WHERE_C_KEY_PARENT_KEY_NAME
+                                + key.getParentKeyName() + AND_C_KEY_PARENT_KEY_VERSION + key.getParentKeyVersion()
+                                + AND_C_KEY_LOCAL_NAME + key.getLocalName() + "'", someClass).executeUpdate();
             }
             mg.getTransaction().commit();
         } finally {
@@ -303,11 +304,11 @@
      * @see org.onap.policy.apex.model.basicmodel.dao.ApexDao#deleteAll(java.lang.Class)
      */
     @Override
-    public <T extends AxConcept> void deleteAll(final Class<T> aClass) {
+    public <T extends AxConcept> void deleteAll(final Class<T> someClass) {
         final EntityManager mg = getEntityManager();
         try {
             mg.getTransaction().begin();
-            mg.createQuery(DELETE_FROM + aClass.getSimpleName() + " c ", aClass).executeUpdate();
+            mg.createQuery(DELETE_FROM + someClass.getSimpleName() + " c ", someClass).executeUpdate();
             mg.getTransaction().commit();
         } finally {
             mg.close();
@@ -321,21 +322,21 @@
      * org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey)
      */
     @Override
-    public <T extends AxConcept> T get(final Class<T> aClass, final AxArtifactKey key) {
-        if (aClass == null) {
+    public <T extends AxConcept> T get(final Class<T> someClass, final AxArtifactKey key) {
+        if (someClass == null) {
             return null;
         }
         final EntityManager mg = getEntityManager();
         try {
-            final T t = mg.find(aClass, key);
+            final T t = mg.find(someClass, key);
             if (t != null) {
                 // This clone is created to force the JPA DAO to recurse down through the object
                 try {
-                    final T clonedT = aClass.newInstance();
+                    final T clonedT = someClass.newInstance();
                     t.copyTo(clonedT);
                     return clonedT;
                 } catch (final Exception e) {
-                    LOGGER.warn("Could not clone object of class \"" + aClass.getCanonicalName() + "\"", e);
+                    LOGGER.warn("Could not clone object of class \"" + someClass.getCanonicalName() + "\"", e);
                     return null;
                 }
             } else {
@@ -353,20 +354,20 @@
      * org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey)
      */
     @Override
-    public <T extends AxConcept> T get(final Class<T> aClass, final AxReferenceKey key) {
-        if (aClass == null) {
+    public <T extends AxConcept> T get(final Class<T> someClass, final AxReferenceKey key) {
+        if (someClass == null) {
             return null;
         }
         final EntityManager mg = getEntityManager();
         try {
-            final T t = mg.find(aClass, key);
+            final T t = mg.find(someClass, key);
             if (t != null) {
                 try {
-                    final T clonedT = aClass.newInstance();
+                    final T clonedT = someClass.newInstance();
                     t.copyTo(clonedT);
                     return clonedT;
                 } catch (final Exception e) {
-                    LOGGER.warn("Could not clone object of class \"" + aClass.getCanonicalName() + "\"", e);
+                    LOGGER.warn("Could not clone object of class \"" + someClass.getCanonicalName() + "\"", e);
                     return null;
                 }
             } else {
@@ -383,13 +384,13 @@
      * @see org.onap.policy.apex.model.basicmodel.dao.ApexDao#getAll(java.lang.Class)
      */
     @Override
-    public <T extends AxConcept> List<T> getAll(final Class<T> aClass) {
-        if (aClass == null) {
+    public <T extends AxConcept> List<T> getAll(final Class<T> someClass) {
+        if (someClass == null) {
             return Collections.emptyList();
         }
         final EntityManager mg = getEntityManager();
         try {
-            return mg.createQuery(SELECT_C_FROM + aClass.getSimpleName() + " c", aClass).getResultList();
+            return mg.createQuery(SELECT_C_FROM + someClass.getSimpleName() + " c", someClass).getResultList();
         } finally {
             mg.close();
         }
@@ -402,16 +403,15 @@
      * org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey)
      */
     @Override
-    public <T extends AxConcept> List<T> getAll(final Class<T> aClass, final AxArtifactKey parentKey) {
-        if (aClass == null) {
+    public <T extends AxConcept> List<T> getAll(final Class<T> someClass, final AxArtifactKey parentKey) {
+        if (someClass == null) {
             return Collections.emptyList();
         }
         final EntityManager mg = getEntityManager();
         try {
-            return mg
-                    .createQuery(SELECT_C_FROM + aClass.getSimpleName() + C_WHERE_C_KEY_PARENT_KEY_NAME
-                            + parentKey.getName() + AND_C_KEY_PARENT_KEY_VERSION + parentKey.getVersion() + "'", aClass)
-                    .getResultList();
+            return mg.createQuery(SELECT_C_FROM + someClass.getSimpleName() + C_WHERE_C_KEY_PARENT_KEY_NAME
+                            + parentKey.getName() + AND_C_KEY_PARENT_KEY_VERSION + parentKey.getVersion() + "'",
+                            someClass).getResultList();
         } finally {
             mg.close();
         }
@@ -424,15 +424,15 @@
      * org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey)
      */
     @Override
-    public <T extends AxConcept> T getArtifact(final Class<T> aClass, final AxArtifactKey key) {
-        if (aClass == null || key == null) {
+    public <T extends AxConcept> T getArtifact(final Class<T> someClass, final AxArtifactKey key) {
+        if (someClass == null || key == null) {
             return null;
         }
         final EntityManager mg = getEntityManager();
         List<T> ret;
         try {
-            ret = mg.createQuery(SELECT_C_FROM + aClass.getSimpleName() + C_WHERE_C_KEY_NAME + key.getName()
-                    + AND_C_KEY_VERSION + key.getVersion() + "'", aClass).getResultList();
+            ret = mg.createQuery(SELECT_C_FROM + someClass.getSimpleName() + C_WHERE_C_KEY_NAME + key.getName()
+                            + AND_C_KEY_VERSION + key.getVersion() + "'", someClass).getResultList();
         } finally {
             mg.close();
         }
@@ -440,8 +440,8 @@
             return null;
         }
         if (ret.size() > 1) {
-            throw new IllegalArgumentException("More than one result was returned for search for " + aClass
-                    + " with key " + key.getID() + ": " + ret);
+            throw new IllegalArgumentException("More than one result was returned for search for " + someClass
+                            + " with key " + key.getId() + ": " + ret);
         }
         return ret.get(0);
     }
@@ -453,16 +453,16 @@
      * org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey)
      */
     @Override
-    public <T extends AxConcept> T getArtifact(final Class<T> aClass, final AxReferenceKey key) {
-        if (aClass == null || key == null) {
+    public <T extends AxConcept> T getArtifact(final Class<T> someClass, final AxReferenceKey key) {
+        if (someClass == null || key == null) {
             return null;
         }
         final EntityManager mg = getEntityManager();
         List<T> ret;
         try {
-            ret = mg.createQuery(SELECT_C_FROM + aClass.getSimpleName() + C_WHERE_C_KEY_PARENT_KEY_NAME
-                    + key.getParentKeyName() + AND_C_KEY_PARENT_KEY_VERSION + key.getParentKeyVersion()
-                    + AND_C_KEY_LOCAL_NAME + key.getLocalName() + "'", aClass).getResultList();
+            ret = mg.createQuery(SELECT_C_FROM + someClass.getSimpleName() + C_WHERE_C_KEY_PARENT_KEY_NAME
+                            + key.getParentKeyName() + AND_C_KEY_PARENT_KEY_VERSION + key.getParentKeyVersion()
+                            + AND_C_KEY_LOCAL_NAME + key.getLocalName() + "'", someClass).getResultList();
         } finally {
             mg.close();
         }
@@ -470,8 +470,8 @@
             return null;
         }
         if (ret.size() > 1) {
-            throw new IllegalArgumentException("More than one result was returned for search for " + aClass
-                    + " with key " + key.getID() + ": " + ret);
+            throw new IllegalArgumentException("More than one result was returned for search for " + someClass
+                            + " with key " + key.getId() + ": " + ret);
         }
         return ret.get(0);
     }
@@ -503,15 +503,15 @@
      * @see org.onap.policy.apex.model.basicmodel.dao.ApexDao#size(java.lang.Class)
      */
     @Override
-    public <T extends AxConcept> long size(final Class<T> aClass) {
-        if (aClass == null) {
+    public <T extends AxConcept> long size(final Class<T> someClass) {
+        if (someClass == null) {
             return 0;
         }
         final EntityManager mg = getEntityManager();
         long size = 0;
         try {
-            size = mg.createQuery("SELECT COUNT(c) FROM " + aClass.getSimpleName() + " c", Long.class)
-                    .getSingleResult();
+            size = mg.createQuery("SELECT COUNT(c) FROM " + someClass.getSimpleName() + " c", Long.class)
+                            .getSingleResult();
         } finally {
             mg.close();
         }
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/impl/package-info.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/impl/package-info.java
index 12e854f..5d585c2 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/impl/package-info.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/impl/package-info.java
@@ -19,7 +19,8 @@
  */
 
 /**
- * Contains a default DAO implementation for APEX {@link org.onap.policy.apex.model.basicmodel.concepts.AxConcept} classes that uses javax persistence.
+ * Contains a default DAO implementation for APEX {@link org.onap.policy.apex.model.basicmodel.concepts.AxConcept}
+ * classes that uses javax persistence.
  * 
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/package-info.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/package-info.java
index fe551b8..505e402 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/package-info.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/dao/package-info.java
@@ -20,8 +20,8 @@
 
 /**
  * Defines and implements the Data Access Object (DAO) that allows Apex
- * {@link org.onap.policy.apex.model.basicmodel.concepts.AxConcept} concepts to be read from and written to databases over
- * JDBC.
+ * {@link org.onap.policy.apex.model.basicmodel.concepts.AxConcept} concepts to be read from and written to databases
+ * over JDBC.
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelCreator.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelCreator.java
index 82a808c..a33e1bf 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelCreator.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelCreator.java
@@ -23,7 +23,8 @@
 import org.onap.policy.apex.model.basicmodel.concepts.AxModel;
 
 /**
- * This interface is implemented by factories that create Apex models. It is mainly used by unit test classes that generate Apex models for test purposes.
+ * This interface is implemented by factories that create Apex models. It is mainly used by unit test classes that
+ * generate Apex models for test purposes.
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  * @param <M> the type of Apex model to create, must be a sub class of {@link AxModel}
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelException.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelException.java
index 8964a5b..17eb263 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelException.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelException.java
@@ -43,9 +43,9 @@
      * Instantiates a new apex model handling exception.
      *
      * @param message the message
-     * @param e the e
+     * @param exception the exception
      */
-    public ApexModelException(final String message, final Exception e) {
-        super(message, e);
+    public ApexModelException(final String message, final Exception exception) {
+        super(message, exception);
     }
 }
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelFileWriter.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelFileWriter.java
index 2312b88..aead4cb 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelFileWriter.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelFileWriter.java
@@ -57,8 +57,8 @@
      * @param modelFileName The name of the file to write to
      * @throws ApexException thrown on errors
      */
-    public void apexModelWriteXMLFile(final M model, final Class<M> rootModelClass, final String modelFileName)
-            throws ApexException {
+    public void apexModelWriteXmlFile(final M model, final Class<M> rootModelClass, final String modelFileName)
+                    throws ApexException {
         LOGGER.debug("running apexModelWriteXMLFile . . .");
 
         final ApexModelWriter<M> modelWriter = new ApexModelWriter<>(rootModelClass);
@@ -80,8 +80,8 @@
      * @param modelFileName The name of the file to write to
      * @throws ApexException thrown on errors
      */
-    public void apexModelWriteJSONFile(final M model, final Class<M> rootModelClass, final String modelFileName)
-            throws ApexException {
+    public void apexModelWriteJsonFile(final M model, final Class<M> rootModelClass, final String modelFileName)
+                    throws ApexException {
         LOGGER.debug("running apexModelWriteJSONFile . . .");
 
         final ApexModelWriter<M> modelWriter = new ApexModelWriter<>(rootModelClass);
@@ -119,7 +119,8 @@
      * @param modelFileName the file name of the file to write to
      * @throws ApexException on exceptions writing the model
      */
-    private void writeModelFile(final M model, final ApexModelWriter<M> modelWriter, final String modelFileName) throws ApexException {
+    private void writeModelFile(final M model, final ApexModelWriter<M> modelWriter, final String modelFileName)
+                    throws ApexException {
         final File modelFile = new File(modelFileName);
         if (!modelFile.getParentFile().exists() && !modelFile.getParentFile().mkdirs()) {
             LOGGER.warn("could not create directory  " + modelFile.getParentFile());
@@ -130,8 +131,7 @@
             final FileOutputStream fileOutputStream = new FileOutputStream(modelFile);
             modelWriter.write(model, fileOutputStream);
             fileOutputStream.close();
-        }
-        catch (final Exception e) {
+        } catch (final Exception e) {
             LOGGER.warn("error processing file " + modelFile.getAbsolutePath(), e);
             throw new ApexException("error processing file " + modelFile.getAbsolutePath(), e);
         }
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelReader.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelReader.java
index 6ca9c03..ce2c9fc 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelReader.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelReader.java
@@ -59,8 +59,10 @@
     private static final XLogger LOGGER = XLoggerFactory.getXLogger(ApexModelReader.class);
 
     // Regular expressions for checking input types
-    private static final String XML_INPUT_TYPE_REGEXP = "^\\s*<\\?xml.*>\\s*"; // (starts with <?xml...>
-    private static final String JSON_INPUT_TYPE_REGEXP = "^\\s*[\\(\\{\\[][\\s+\\S]*[\\)\\}\\]]"; // starts with some kind of bracket [ or (
+    // (starts with <?xml...>
+    private static final String XML_INPUT_TYPE_REGEXP = "^\\s*<\\?xml.*>\\s*";
+    // starts with some kind of bracket [ or (
+    private static final String JSON_INPUT_TYPE_REGEXP = "^\\s*[\\(\\{\\[][\\s+\\S]*[\\)\\}\\]]";
     // or {, then has something, then has
     // and has a close bracket
 
@@ -119,8 +121,9 @@
         if (schemaFileName != null) {
             try {
                 // Set the concept schema
-                final URL schemaURL = ResourceUtils.getUrlResource(schemaFileName);
-                final Schema apexConceptSchema = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema(schemaURL);
+                final URL schemaUrl = ResourceUtils.getUrlResource(schemaFileName);
+                final Schema apexConceptSchema = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI)
+                                .newSchema(schemaUrl);
                 unmarshaller.setSchema(apexConceptSchema);
             }
             catch (final Exception e) {
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelSaver.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelSaver.java
index 16ea1f3..4f3008f 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelSaver.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelSaver.java
@@ -45,13 +45,13 @@
     private final String writePath;
 
     /**
-     * Constructor, specifies the type of the Apex model (a sub class of {@link AxModel}), the model to write, and the path of a directory to which to write the
-     * model.
+     * Constructor, specifies the type of the Apex model (a sub class of {@link AxModel}), the model to write, and the
+     * path of a directory to which to write the model.
      *
      * @param rootModelClass the class of the model, a sub class of {@link AxModel}
      * @param model the model to write, an instance of a sub class of {@link AxModel}
-     * @param writePath the directory to which models will be written. The name of the written model will be the Model Name for its key with the suffix
-     *            {@code .xml} or {@code .json}.
+     * @param writePath the directory to which models will be written. The name of the written model will be the Model
+     *        Name for its key with the suffix {@code .xml} or {@code .json}.
      */
     public ApexModelSaver(final Class<M> rootModelClass, final M model, final String writePath) {
         Assertions.argumentNotNull(rootModelClass, "argument rootModelClass may not be null");
@@ -68,12 +68,12 @@
      *
      * @throws ApexException on errors writing the Apex model
      */
-    public void apexModelWriteXML() throws ApexException {
+    public void apexModelWriteXml() throws ApexException {
         LOGGER.debug("running apexModelWriteXML . . .");
 
         // Write the file to disk
         final File xmlFile = new File(writePath + File.separatorChar + model.getKey().getName() + ".xml");
-        new ApexModelFileWriter<M>(true).apexModelWriteXMLFile(model, rootModelClass, xmlFile.getPath());
+        new ApexModelFileWriter<M>(true).apexModelWriteXmlFile(model, rootModelClass, xmlFile.getPath());
 
         LOGGER.debug("ran apexModelWriteXML");
     }
@@ -83,12 +83,12 @@
      *
      * @throws ApexException on errors writing the Apex model
      */
-    public void apexModelWriteJSON() throws ApexException {
+    public void apexModelWriteJson() throws ApexException {
         LOGGER.debug("running apexModelWriteJSON . . .");
 
         // Write the file to disk
         final File jsonFile = new File(writePath + File.separatorChar + model.getKey().getName() + ".json");
-        new ApexModelFileWriter<M>(true).apexModelWriteJSONFile(model, rootModelClass, jsonFile.getPath());
+        new ApexModelFileWriter<M>(true).apexModelWriteJsonFile(model, rootModelClass, jsonFile.getPath());
 
         LOGGER.debug("ran apexModelWriteJSON");
     }
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelStringWriter.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelStringWriter.java
index 3d2e50b..92a956b 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelStringWriter.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelStringWriter.java
@@ -58,13 +58,13 @@
      * @return The string with the concept
      * @throws ApexException thrown on errors
      */
-    public String writeString(final C concept, final Class<C> rootConceptClass, final boolean jsonFlag) throws ApexException {
+    public String writeString(final C concept, final Class<C> rootConceptClass, final boolean jsonFlag)
+                    throws ApexException {
         Assertions.argumentNotNull(concept, "concept may not be null");
-        
+
         if (jsonFlag) {
-            return writeJSONString(concept, rootConceptClass);
-        }
-        else {
+            return writeJsonString(concept, rootConceptClass);
+        } else {
             return concept.toString();
         }
     }
@@ -77,7 +77,7 @@
      * @return The string with the concept
      * @throws ApexException thrown on errors
      */
-    public String writeXMLString(final C concept, final Class<C> rootConceptClass) throws ApexException {
+    public String writeXmlString(final C concept, final Class<C> rootConceptClass) throws ApexException {
         LOGGER.debug("running writeXMLString . . .");
 
         final ApexModelWriter<C> conceptWriter = new ApexModelWriter<>(rootConceptClass);
@@ -90,8 +90,7 @@
         try {
             conceptWriter.write(concept, baOutputStream);
             baOutputStream.close();
-        }
-        catch (final Exception e) {
+        } catch (final Exception e) {
             LOGGER.warn("error writing XML string", e);
             throw new ApexException("error writing XML string", e);
         }
@@ -108,7 +107,7 @@
      * @return The string with the concept
      * @throws ApexException thrown on errors
      */
-    public String writeJSONString(final C concept, final Class<C> rootConceptClass) throws ApexException {
+    public String writeJsonString(final C concept, final Class<C> rootConceptClass) throws ApexException {
         LOGGER.debug("running writeJSONString . . .");
 
         final ApexModelWriter<C> conceptWriter = new ApexModelWriter<>(rootConceptClass);
@@ -119,8 +118,7 @@
         try {
             conceptWriter.write(concept, baOutputStream);
             baOutputStream.close();
-        }
-        catch (final Exception e) {
+        } catch (final Exception e) {
             LOGGER.warn("error writing JSON string", e);
             throw new ApexException("error writing JSON string", e);
         }
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelWriter.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelWriter.java
index 2bea92c..977a8e7 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelWriter.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexModelWriter.java
@@ -67,7 +67,7 @@
     private boolean jsonOutput = false;
 
     // The list of fields to output as CDATA
-    private final Set<String> cDataFieldSet = new TreeSet<>();
+    private final Set<String> cdataFieldSet = new TreeSet<>();
 
     // The Marshaller for the Apex concepts
     private Marshaller marshaller = null;
@@ -104,7 +104,7 @@
      * @return the set of fields
      */
     public Set<String> getCDataFieldSet() {
-        return cDataFieldSet;
+        return cdataFieldSet;
     }
 
     /**
@@ -176,14 +176,14 @@
             LOGGER.debug(validationResult.toString());
             if (!validationResult.isValid()) {
                 LOGGER.warn(validationResult.toString());
-                throw new ApexModelException("Apex concept xml (" + concept.getKey().getID() + ") validation failed");
+                throw new ApexModelException("Apex concept xml (" + concept.getKey().getId() + ") validation failed");
             }
         }
 
         if (jsonOutput) {
-            writeJSON(concept, apexConceptWriter);
+            writeJson(concept, apexConceptWriter);
         } else {
-            writeXML(concept, apexConceptWriter);
+            writeXml(concept, apexConceptWriter);
         }
     }
 
@@ -194,7 +194,7 @@
      * @param apexConceptWriter the writer to write to
      * @throws ApexModelException on validation or writing exceptions
      */
-    private void writeXML(final C concept, final Writer apexConceptWriter) throws ApexModelException {
+    private void writeXml(final C concept, final Writer apexConceptWriter) throws ApexModelException {
         Assertions.argumentNotNull(concept, CONCEPT_MAY_NOT_BE_NULL);
 
         LOGGER.debug("writing Apex concept XML . . .");
@@ -212,7 +212,7 @@
 
             // Convert the cDataFieldSet into a space delimited string
             domTransformer.setOutputProperty(OutputKeys.CDATA_SECTION_ELEMENTS,
-                    cDataFieldSet.toString().replaceAll("[\\[\\]\\,]", " "));
+                    cdataFieldSet.toString().replaceAll("[\\[\\]\\,]", " "));
             domTransformer.transform(new DOMSource(document), new StreamResult(apexConceptWriter));
         } catch (JAXBException | TransformerException | ParserConfigurationException e) {
             LOGGER.warn("Unable to marshal Apex concept XML", e);
@@ -245,7 +245,7 @@
      * @param apexConceptWriter the writer to write to
      * @throws ApexModelException on validation or writing exceptions
      */
-    private void writeJSON(final C concept, final Writer apexConceptWriter) throws ApexModelException {
+    private void writeJson(final C concept, final Writer apexConceptWriter) throws ApexModelException {
         Assertions.argumentNotNull(concept, CONCEPT_MAY_NOT_BE_NULL);
 
         LOGGER.debug("writing Apex concept JSON . . .");
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexSchemaGenerator.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexSchemaGenerator.java
index 6e17ab9..46e30bf 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexSchemaGenerator.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/handling/ApexSchemaGenerator.java
@@ -53,20 +53,17 @@
 
         if (args.length == 1) {
             printStream = System.out;
-        }
-        else if (args.length == 2) {
+        } else if (args.length == 2) {
             final File schemaFile = new File(args[1]);
 
             try {
                 schemaFile.getParentFile().mkdirs();
                 printStream = new PrintStream(schemaFile);
-            }
-            catch (final Exception e) {
+            } catch (final Exception e) {
                 LOGGER.error("error on Apex schema output", e);
                 return;
             }
-        }
-        else {
+        } else {
             LOGGER.error("usage: ApexSchemaGenerator apex-root-class [schema-file-name]");
             return;
         }
@@ -90,12 +87,10 @@
         JAXBContext jaxbContext;
         try {
             jaxbContext = JAXBContext.newInstance(Class.forName(rootClassName));
-        }
-        catch (final ClassNotFoundException e) {
+        } catch (final ClassNotFoundException e) {
             LOGGER.error("could not create JAXB context, root class " + rootClassName + " not found", e);
             return null;
-        }
-        catch (final JAXBException e) {
+        } catch (final JAXBException e) {
             LOGGER.error("could not create JAXB context", e);
             return null;
         }
@@ -103,8 +98,7 @@
         final ApexSchemaOutputResolver sor = new ApexSchemaOutputResolver();
         try {
             jaxbContext.generateSchema(sor);
-        }
-        catch (final IOException e) {
+        } catch (final IOException e) {
             LOGGER.error("error generating the Apex schema (XSD) file", e);
             return null;
         }
@@ -116,22 +110,26 @@
     }
 
     /**
-     * There is a bug in schema generation that does not specify the elements from Java Maps as being unqualified. This method "hacks" those
-     * elements in the schema to fix this, the elements being {@code entry}, {@code key}, and {@code value}
+     * There is a bug in schema generation that does not specify the elements from Java Maps as being unqualified. This
+     * method "hacks" those elements in the schema to fix this, the elements being {@code entry}, {@code key}, and
+     * {@code value}
      *
      * @param schemaString The schema in which elements should be fixed
      * @return the string
      */
     private String fixForUnqualifiedBug(final String schemaString) {
         // Fix the "entry" element
-        String newSchemaString = schemaString.replaceAll("<xs:element name=\"entry\" minOccurs=\"0\" maxOccurs=\"unbounded\">",
-                "<xs:element name=\"entry\" minOccurs=\"0\" maxOccurs=\"unbounded\" form=\"unqualified\">");
+        String newSchemaString = schemaString.replaceAll(
+                        "<xs:element name=\"entry\" minOccurs=\"0\" maxOccurs=\"unbounded\">",
+                        "<xs:element name=\"entry\" minOccurs=\"0\" maxOccurs=\"unbounded\" form=\"unqualified\">");
 
         // Fix the "key" element
-        newSchemaString = newSchemaString.replaceAll("<xs:element name=\"key\"", "<xs:element name=\"key\" form=\"unqualified\"");
+        newSchemaString = newSchemaString.replaceAll("<xs:element name=\"key\"",
+                        "<xs:element name=\"key\" form=\"unqualified\"");
 
         // Fix the "value" element
-        newSchemaString = newSchemaString.replaceAll("<xs:element name=\"value\"", "<xs:element name=\"value\" form=\"unqualified\"");
+        newSchemaString = newSchemaString.replaceAll("<xs:element name=\"value\"",
+                        "<xs:element name=\"value\" form=\"unqualified\"");
 
         return newSchemaString;
     }
@@ -148,14 +146,14 @@
          * @see javax.xml.bind.SchemaOutputResolver#createOutput(java.lang.String, java.lang.String)
          */
         @Override
-        public Result createOutput(final String namespaceURI, final String suggestedFileName) throws IOException {
+        public Result createOutput(final String namespaceUri, final String suggestedFileName) throws IOException {
             final StreamResult result = new StreamResult(stringWriter);
             result.setSystemId(suggestedFileName);
             return result;
         }
 
         /**
-         * Get the schema from the string writer created in the {@link createOutput()} method.
+         * Get the schema from the string writer.
          *
          * @return the schema generated by JAXB
          */
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/package-info.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/package-info.java
index 8c76c5f..23968c9 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/package-info.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/package-info.java
@@ -19,10 +19,11 @@
  */
 
 /**
- * Provides the base definition of an APEX model. It also defines the Model Service, the mechanism that allows access to the
- * model for APEX concepts anywhere in the system.
+ * Provides the base definition of an APEX model. It also defines the Model Service, the mechanism that allows access to
+ * the model for APEX concepts anywhere in the system.
  *
- * It also provides handling support to models, allowing them to be read and written to file and databases in JSON and XML format.
+ * It also provides handling support to models, allowing them to be read and written to file and databases in JSON and
+ * XML format.
  * 
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/service/ModelService.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/service/ModelService.java
index d1ecc60..1e922b8 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/service/ModelService.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/service/ModelService.java
@@ -29,11 +29,13 @@
 /**
  * The model service makes Apex models available to all classes in a JVM.
  *
- * The reason for having a model service is to avoid having to pass concept and model definitions down long call chains in modules such as the Apex engine and
- * editor. The model service makes the model and concept definitions available statically.
+ * <p>The reason for having a model service is to avoid having to pass concept and model definitions down long call
+ * chains in modules such as the Apex engine and editor. The model service makes the model and concept definitions
+ * available statically.
  *
- * Note that the use of the model service means that only a single Apex model of a particular type may exist in Apex (particularly the engine) at any time. Of
- * course the model in a JVM can be changed at any time provided all users of the model are stopped and restrted in an orderly manner.
+ * <p>Note that the use of the model service means that only a single Apex model of a particular type may exist in
+ * Apex (particularly the engine) at any time. Of course the model in a JVM can be changed at any time provided all
+ * users of the model are stopped and restarted in an orderly manner.
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  */
@@ -80,7 +82,8 @@
         final M model = (M) modelMap.get(modelClass);
 
         if (model == null) {
-            throw new ApexRuntimeException("Model for " + modelClass.getCanonicalName() + " not found in model service");
+            throw new ApexRuntimeException(
+                            "Model for " + modelClass.getCanonicalName() + " not found in model service");
         }
 
         return model;
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/test/TestApexModel.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/test/TestApexModel.java
index 356afd7..81b3373 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/test/TestApexModel.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/test/TestApexModel.java
@@ -30,7 +30,7 @@
 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
 import org.onap.policy.apex.model.basicmodel.dao.ApexDao;
 import org.onap.policy.apex.model.basicmodel.dao.ApexDaoFactory;
-import org.onap.policy.apex.model.basicmodel.dao.DAOParameters;
+import org.onap.policy.apex.model.basicmodel.dao.DaoParameters;
 import org.onap.policy.apex.model.basicmodel.handling.ApexModelFileWriter;
 import org.onap.policy.apex.model.basicmodel.handling.ApexModelReader;
 import org.onap.policy.apex.model.basicmodel.handling.ApexModelWriter;
@@ -39,19 +39,19 @@
 import org.slf4j.ext.XLoggerFactory;
 
 /**
- * This class tests reading and writing of Apex models to file and to a database using JPA. It also tests validation of Apex models. This class is designed for
- * use in unit tests in modules that define Apex models.
+ * This class tests reading and writing of Apex models to file and to a database using JPA. It also tests validation of
+ * Apex models. This class is designed for use in unit tests in modules that define Apex models.
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  * @param <M> the generic type
  */
 public class TestApexModel<M extends AxModel> {
     private static final String MODEL_IS_INVALID = "model is invalid ";
-	private static final String ERROR_PROCESSING_FILE = "error processing file ";
-	private static final String TEST_MODEL_DOES_NOT_EQUAL_MODEL_READ_FROM_XML_FILE = "test model does not equal model read from XML file ";
-	private static final String ERROR_CREATING_TEMPORARY_FILE_FOR_APEX_MODEL = "error creating temporary file for Apex model";
+    private static final String ERROR_PROCESSING_FILE = "error processing file ";
+    private static final String TEST_MODEL_UNEQUAL_STR = "test model does not equal model read from XML file ";
+    private static final String TEMP_FILE_CREATE_ERR_STR = "error creating temporary file for Apex model";
 
-	private static final XLogger LOGGER = XLoggerFactory.getXLogger(TestApexModel.class);
+    private static final XLogger LOGGER = XLoggerFactory.getXLogger(TestApexModel.class);
 
     // The root model class that specifies the root to import and export from
     private final Class<M> rootModelClass;
@@ -60,8 +60,8 @@
     private TestApexModelCreator<M> modelCreator = null;
 
     /**
-     * Constructor, defines the subclass of {@link AxModel} that is being tested and the {@link TestApexModelCreator} object that is used to generate Apex
-     * models.
+     * Constructor, defines the subclass of {@link AxModel} that is being tested and the {@link TestApexModelCreator}
+     * object that is used to generate Apex models.
      *
      * @param rootModelClass the Apex model class, a sub class of {@link AxModel}
      * @param modelCreator the @link TestApexModelCreator} that will generate Apex models of various types for testing
@@ -85,36 +85,34 @@
      *
      * @throws ApexException on write/read errors
      */
-    public final void testApexModelWriteReadXML() throws ApexException {
+    public final void testApexModelWriteReadXml() throws ApexException {
         LOGGER.debug("running testApexModelWriteReadXML . . .");
 
         final M model = modelCreator.getModel();
 
         // Write the file to disk
         File xmlFile;
-        
+
         try {
             xmlFile = File.createTempFile("ApexModel", ".xml");
             xmlFile.deleteOnExit();
+        } catch (final Exception e) {
+            LOGGER.warn(TEMP_FILE_CREATE_ERR_STR, e);
+            throw new ApexException(TEMP_FILE_CREATE_ERR_STR, e);
         }
-        catch (final Exception e) {
-            LOGGER.warn(ERROR_CREATING_TEMPORARY_FILE_FOR_APEX_MODEL, e);
-            throw new ApexException(ERROR_CREATING_TEMPORARY_FILE_FOR_APEX_MODEL, e);
-        }
-        new ApexModelFileWriter<M>(true).apexModelWriteXMLFile(model, rootModelClass, xmlFile.getPath());
+        new ApexModelFileWriter<M>(true).apexModelWriteXmlFile(model, rootModelClass, xmlFile.getPath());
 
         // Read the file from disk
         final ApexModelReader<M> modelReader = new ApexModelReader<>(rootModelClass);
 
         try {
-            final URL apexModelURL = ResourceUtils.getLocalFile(xmlFile.getAbsolutePath());
-            final M fileModel = modelReader.read(apexModelURL.openStream());
+            final URL apexModelUrl = ResourceUtils.getLocalFile(xmlFile.getAbsolutePath());
+            final M fileModel = modelReader.read(apexModelUrl.openStream());
             if (!model.equals(fileModel)) {
-                LOGGER.warn(TEST_MODEL_DOES_NOT_EQUAL_MODEL_READ_FROM_XML_FILE + xmlFile.getAbsolutePath());
-                throw new ApexException(TEST_MODEL_DOES_NOT_EQUAL_MODEL_READ_FROM_XML_FILE + xmlFile.getAbsolutePath());
+                LOGGER.warn(TEST_MODEL_UNEQUAL_STR + xmlFile.getAbsolutePath());
+                throw new ApexException(TEST_MODEL_UNEQUAL_STR + xmlFile.getAbsolutePath());
             }
-        }
-        catch (final Exception e) {
+        } catch (final Exception e) {
             LOGGER.warn(ERROR_PROCESSING_FILE + xmlFile.getAbsolutePath(), e);
             throw new ApexException(ERROR_PROCESSING_FILE + xmlFile.getAbsolutePath(), e);
         }
@@ -141,7 +139,7 @@
      *
      * @throws ApexException on write/read errors
      */
-    public final void testApexModelWriteReadJSON() throws ApexException {
+    public final void testApexModelWriteReadJson() throws ApexException {
         LOGGER.debug("running testApexModelWriteReadJSON . . .");
 
         final M model = modelCreator.getModel();
@@ -151,25 +149,24 @@
         try {
             jsonFile = File.createTempFile("ApexModel", ".xml");
             jsonFile.deleteOnExit();
+        } catch (final Exception e) {
+            LOGGER.warn(TEMP_FILE_CREATE_ERR_STR, e);
+            throw new ApexException(TEMP_FILE_CREATE_ERR_STR, e);
         }
-        catch (final Exception e) {
-            LOGGER.warn(ERROR_CREATING_TEMPORARY_FILE_FOR_APEX_MODEL, e);
-            throw new ApexException(ERROR_CREATING_TEMPORARY_FILE_FOR_APEX_MODEL, e);
-        }
-        new ApexModelFileWriter<M>(true).apexModelWriteJSONFile(model, rootModelClass, jsonFile.getPath());
+        new ApexModelFileWriter<M>(true).apexModelWriteJsonFile(model, rootModelClass, jsonFile.getPath());
 
         // Read the file from disk
         final ApexModelReader<M> modelReader = new ApexModelReader<>(rootModelClass);
 
         try {
-            final URL apexModelURL = ResourceUtils.getLocalFile(jsonFile.getAbsolutePath());
-            final M fileModel = modelReader.read(apexModelURL.openStream());
+            final URL apexModelUrl = ResourceUtils.getLocalFile(jsonFile.getAbsolutePath());
+            final M fileModel = modelReader.read(apexModelUrl.openStream());
             if (!model.equals(fileModel)) {
-                LOGGER.warn(TEST_MODEL_DOES_NOT_EQUAL_MODEL_READ_FROM_XML_FILE + jsonFile.getAbsolutePath());
-                throw new ApexException(TEST_MODEL_DOES_NOT_EQUAL_MODEL_READ_FROM_XML_FILE + jsonFile.getAbsolutePath());
+                LOGGER.warn(TEST_MODEL_UNEQUAL_STR + jsonFile.getAbsolutePath());
+                throw new ApexException(
+                                TEST_MODEL_UNEQUAL_STR + jsonFile.getAbsolutePath());
             }
-        }
-        catch (final Exception e) {
+        } catch (final Exception e) {
             LOGGER.warn(ERROR_PROCESSING_FILE + jsonFile.getAbsolutePath(), e);
             throw new ApexException(ERROR_PROCESSING_FILE + jsonFile.getAbsolutePath(), e);
         }
@@ -195,7 +192,7 @@
      * @param daoParameters the DAO parameters to use for JPA/JDBC
      * @throws ApexException thrown on errors writing or reading the model to database
      */
-    public final void testApexModelWriteReadJPA(final DAOParameters daoParameters) throws ApexException {
+    public final void testApexModelWriteReadJpa(final DaoParameters daoParameters) throws ApexException {
         LOGGER.debug("running testApexModelWriteReadJPA . . .");
 
         final M model = modelCreator.getModel();
@@ -204,10 +201,10 @@
         apexDao.init(daoParameters);
 
         apexDao.create(model);
-        final M dbJPAModel = apexDao.get(rootModelClass, model.getKey());
+        final M dbJpaModel = apexDao.get(rootModelClass, model.getKey());
         apexDao.close();
 
-        if (!model.equals(dbJPAModel)) {
+        if (!model.equals(dbJpaModel)) {
             LOGGER.warn("test model does not equal model written and read using generic JPA");
             throw new ApexException("test model does not equal model written and read using generic JPA");
         }
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/test/TestApexModelCreator.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/test/TestApexModelCreator.java
index 9807489..65441a3 100644
--- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/test/TestApexModelCreator.java
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/test/TestApexModelCreator.java
@@ -24,8 +24,8 @@
 import org.onap.policy.apex.model.basicmodel.handling.ApexModelCreator;
 
 /**
- * The Interface TestApexModelCreator is used to create models for Apex model tests. It is mainly used by unit tests for Apex domain models so that
- * developers can write test Java programs to create models.
+ * The Interface TestApexModelCreator is used to create models for Apex model tests. It is mainly used by unit tests for
+ * Apex domain models so that developers can write test Java programs to create models.
  *
  * @author Liam Fallon (liam.fallon@ericsson.com)
  * @param <M> the generic type
diff --git a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/concepts/AxKeyTest.java b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/concepts/AxKeyTest.java
index 6ac46b1..ea09cc6 100644
--- a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/concepts/AxKeyTest.java
+++ b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/concepts/AxKeyTest.java
@@ -29,91 +29,99 @@
 import org.junit.Test;
 import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
 import org.onap.policy.apex.model.basicmodel.concepts.AxKey;
+import org.onap.policy.apex.model.basicmodel.concepts.AxKey.Compatibility;
 import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey;
 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
-import org.onap.policy.apex.model.basicmodel.concepts.AxKey.Compatibility;
 
-/**
- * @author Liam Fallon (liam.fallon@ericsson.com)
- */
 public class AxKeyTest {
 
     @Test
     public void testArtifactKey() {
-        AxArtifactKey aKey0 = new AxArtifactKey();
-        AxArtifactKey aKey1 = new AxArtifactKey("name", "0.0.1");
-        AxArtifactKey aKey2 = new AxArtifactKey(aKey1);
-        AxArtifactKey aKey3 = new AxArtifactKey(aKey1.getID());
-        AxArtifactKey aKey4 = new AxArtifactKey(aKey1);
-        AxArtifactKey aKey5 = new AxArtifactKey(aKey1);
-        AxArtifactKey aKey6 = new AxArtifactKey(aKey1);
-
         try {
             new AxArtifactKey("some bad key id");
             fail("This test should throw an exception");
+        } catch (IllegalArgumentException e) {
+            assertEquals("parameter \"id\": value \"some bad key id\", "
+                            + "does not match regular expression \"[A-Za-z0-9\\-_\\.]+:[0-9].[0-9].[0-9]\"",
+                            e.getMessage());
         }
-        catch (IllegalArgumentException e) {
-            assertEquals("parameter \"id\": value \"some bad key id\", does not match regular expression \"[A-Za-z0-9\\-_\\.]+:[0-9].[0-9].[0-9]\"", e.getMessage());
-        }
-        
-        assertEquals(AxArtifactKey.getNullKey(), aKey0);
-        assertEquals(aKey1, aKey2);
-        assertEquals(aKey1, aKey3);
-        
-        assertEquals(aKey2, aKey1.getKey());
-        assertEquals(1, aKey1.getKeys().size());
-        
-        aKey0.setName("zero");
-        aKey0.setVersion("0.0.2");
-        aKey3.setVersion("0.0.2");
-        aKey4.setVersion("0.1.2");
-        aKey5.setVersion("1.2.2");
-        aKey6.setVersion("3");
-        
-        assertEquals(Compatibility.DIFFERENT, aKey0.getCompatibility(new AxReferenceKey()));
-        assertEquals(Compatibility.DIFFERENT, aKey0.getCompatibility(aKey1));
-        assertEquals(Compatibility.IDENTICAL, aKey2.getCompatibility(aKey1));
-        assertEquals(Compatibility.PATCH,     aKey3.getCompatibility(aKey1));
-        assertEquals(Compatibility.MINOR,     aKey4.getCompatibility(aKey1));
-        assertEquals(Compatibility.MAJOR,     aKey5.getCompatibility(aKey1));
-        assertEquals(Compatibility.MAJOR,     aKey6.getCompatibility(aKey1));
-        
-        assertTrue(aKey1.isCompatible(aKey2));
-        assertTrue(aKey1.isCompatible(aKey3));
-        assertTrue(aKey1.isCompatible(aKey4));
-        assertFalse(aKey1.isCompatible(aKey0));
-        assertFalse(aKey1.isCompatible(aKey5));
-        assertFalse(aKey1.isCompatible(new AxReferenceKey()));
-        
-        assertEquals(AxValidationResult.ValidationResult.VALID, aKey0.validate(new AxValidationResult()).getValidationResult());
-        assertEquals(AxValidationResult.ValidationResult.VALID, aKey1.validate(new AxValidationResult()).getValidationResult());
-        assertEquals(AxValidationResult.ValidationResult.VALID, aKey2.validate(new AxValidationResult()).getValidationResult());
-        assertEquals(AxValidationResult.ValidationResult.VALID, aKey3.validate(new AxValidationResult()).getValidationResult());
-        assertEquals(AxValidationResult.ValidationResult.VALID, aKey4.validate(new AxValidationResult()).getValidationResult());
-        assertEquals(AxValidationResult.ValidationResult.VALID, aKey5.validate(new AxValidationResult()).getValidationResult());
-        assertEquals(AxValidationResult.ValidationResult.VALID, aKey6.validate(new AxValidationResult()).getValidationResult());
-        
-        aKey0.clean();
-        assertNotNull(aKey0.toString());
-        
-        AxArtifactKey aKey7 = new AxArtifactKey(aKey1);
-        assertEquals(150332875, aKey7.hashCode());
-        assertEquals(0, aKey7.compareTo(aKey1));
-        assertEquals(-12, aKey7.compareTo(aKey0));
-        
+
+        AxArtifactKey someKey0 = new AxArtifactKey();
+        assertEquals(AxArtifactKey.getNullKey(), someKey0);
+
+        AxArtifactKey someKey1 = new AxArtifactKey("name", "0.0.1");
+        AxArtifactKey someKey2 = new AxArtifactKey(someKey1);
+        AxArtifactKey someKey3 = new AxArtifactKey(someKey1.getId());
+        assertEquals(someKey1, someKey2);
+        assertEquals(someKey1, someKey3);
+
+        assertEquals(someKey2, someKey1.getKey());
+        assertEquals(1, someKey1.getKeys().size());
+
+        someKey0.setName("zero");
+        someKey0.setVersion("0.0.2");
+
+        someKey3.setVersion("0.0.2");
+
+        AxArtifactKey someKey4 = new AxArtifactKey(someKey1);
+        someKey4.setVersion("0.1.2");
+
+        AxArtifactKey someKey5 = new AxArtifactKey(someKey1);
+        someKey5.setVersion("1.2.2");
+
+        AxArtifactKey someKey6 = new AxArtifactKey(someKey1);
+        someKey6.setVersion("3");
+
+        assertEquals(Compatibility.DIFFERENT, someKey0.getCompatibility(new AxReferenceKey()));
+        assertEquals(Compatibility.DIFFERENT, someKey0.getCompatibility(someKey1));
+        assertEquals(Compatibility.IDENTICAL, someKey2.getCompatibility(someKey1));
+        assertEquals(Compatibility.PATCH, someKey3.getCompatibility(someKey1));
+        assertEquals(Compatibility.MINOR, someKey4.getCompatibility(someKey1));
+        assertEquals(Compatibility.MAJOR, someKey5.getCompatibility(someKey1));
+        assertEquals(Compatibility.MAJOR, someKey6.getCompatibility(someKey1));
+
+        assertTrue(someKey1.isCompatible(someKey2));
+        assertTrue(someKey1.isCompatible(someKey3));
+        assertTrue(someKey1.isCompatible(someKey4));
+        assertFalse(someKey1.isCompatible(someKey0));
+        assertFalse(someKey1.isCompatible(someKey5));
+        assertFalse(someKey1.isCompatible(new AxReferenceKey()));
+
+        assertEquals(AxValidationResult.ValidationResult.VALID,
+                        someKey0.validate(new AxValidationResult()).getValidationResult());
+        assertEquals(AxValidationResult.ValidationResult.VALID,
+                        someKey1.validate(new AxValidationResult()).getValidationResult());
+        assertEquals(AxValidationResult.ValidationResult.VALID,
+                        someKey2.validate(new AxValidationResult()).getValidationResult());
+        assertEquals(AxValidationResult.ValidationResult.VALID,
+                        someKey3.validate(new AxValidationResult()).getValidationResult());
+        assertEquals(AxValidationResult.ValidationResult.VALID,
+                        someKey4.validate(new AxValidationResult()).getValidationResult());
+        assertEquals(AxValidationResult.ValidationResult.VALID,
+                        someKey5.validate(new AxValidationResult()).getValidationResult());
+        assertEquals(AxValidationResult.ValidationResult.VALID,
+                        someKey6.validate(new AxValidationResult()).getValidationResult());
+
+        someKey0.clean();
+        assertNotNull(someKey0.toString());
+
+        AxArtifactKey someKey7 = new AxArtifactKey(someKey1);
+        assertEquals(150332875, someKey7.hashCode());
+        assertEquals(0, someKey7.compareTo(someKey1));
+        assertEquals(-12, someKey7.compareTo(someKey0));
+
         try {
-            aKey0.compareTo(null);
-        }
-        catch (IllegalArgumentException e) {
+            someKey0.compareTo(null);
+        } catch (IllegalArgumentException e) {
             assertEquals("comparison object may not be null", e.getMessage());
         }
-        
-        assertEquals(0, aKey0.compareTo(aKey0));
-        assertEquals(353602977, aKey0.compareTo(new AxReferenceKey()));
-        
-        assertFalse(aKey0.equals(null));
-        assertTrue(aKey0.equals(aKey0));
-        assertFalse(((AxKey)aKey0).equals(new AxReferenceKey()));
+
+        assertEquals(0, someKey0.compareTo(someKey0));
+        assertEquals(353602977, someKey0.compareTo(new AxReferenceKey()));
+
+        assertFalse(someKey0.equals(null));
+        assertTrue(someKey0.equals(someKey0));
+        assertFalse(((AxKey) someKey0).equals(new AxReferenceKey()));
     }
 
 }
diff --git a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/concepts/TestAxKeyInfo.java b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/concepts/TestAxKeyInfo.java
index 8368634..f615d9d 100644
--- a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/concepts/TestAxKeyInfo.java
+++ b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/concepts/TestAxKeyInfo.java
@@ -33,9 +33,6 @@
 import org.onap.policy.apex.model.basicmodel.concepts.AxKeyInfo;
 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
 
-/**
- * @author Liam Fallon (liam.fallon@ericsson.com)
- */
 public class TestAxKeyInfo {
 
     @Test
@@ -46,23 +43,24 @@
 
         AxKeyInfo testKeyInfo = new AxKeyInfo();
         testKeyInfo.setKey((new AxArtifactKey("PN", "0.0.1")));
-        assertEquals("PN:0.0.1", testKeyInfo.getKey().getID());
+        assertEquals("PN:0.0.1", testKeyInfo.getKey().getId());
 
         AxArtifactKey key = new AxArtifactKey("key", "0.0.1");
         testKeyInfo.setKey(key);
         assertEquals(key, testKeyInfo.getKey());
-        
+
         UUID uuid = UUID.randomUUID();
         testKeyInfo.setUuid(uuid);
-        assertEquals(uuid, testKeyInfo.getUUID());
+        assertEquals(uuid, testKeyInfo.getUuid());
         testKeyInfo.setDescription("Key Description");
         assertEquals("Key Description", testKeyInfo.getDescription());
-        
+
         AxKeyInfo clonedReferenceKey = new AxKeyInfo(testKeyInfo);
-        assertTrue(clonedReferenceKey.toString().startsWith("AxKeyInfo:(artifactId=AxArtifactKey:(name=key,version=0.0.1),uuid="));
-        
+        assertTrue(clonedReferenceKey.toString()
+                        .startsWith("AxKeyInfo:(artifactId=AxArtifactKey:(name=key,version=0.0.1),uuid="));
+
         assertFalse(testKeyInfo.hashCode() == 0);
-        
+
         assertTrue(testKeyInfo.equals(testKeyInfo));
         assertTrue(testKeyInfo.equals(clonedReferenceKey));
         assertFalse(testKeyInfo.equals(null));
@@ -71,7 +69,7 @@
         assertFalse(testKeyInfo.equals(new AxKeyInfo(key, UUID.randomUUID(), "Some Description")));
         assertFalse(testKeyInfo.equals(new AxKeyInfo(key, uuid, "Some Description")));
         assertTrue(testKeyInfo.equals(new AxKeyInfo(key, uuid, "Key Description")));
-        
+
         assertEquals(0, testKeyInfo.compareTo(testKeyInfo));
         assertEquals(0, testKeyInfo.compareTo(clonedReferenceKey));
         assertNotEquals(0, testKeyInfo.compareTo(null));
@@ -80,28 +78,28 @@
         assertNotEquals(0, testKeyInfo.compareTo(new AxKeyInfo(key, UUID.randomUUID(), "Some Description")));
         assertNotEquals(0, testKeyInfo.compareTo(new AxKeyInfo(key, uuid, "Some Description")));
         assertEquals(0, testKeyInfo.compareTo(new AxKeyInfo(key, uuid, "Key Description")));
-        
+
         assertNotNull(testKeyInfo.getKeys());
-        
+
         AxValidationResult result = new AxValidationResult();
         result = testKeyInfo.validate(result);
         assertEquals(AxValidationResult.ValidationResult.VALID, result.getValidationResult());
-        
+
         testKeyInfo.setDescription("");
         result = testKeyInfo.validate(result);
         assertEquals(AxValidationResult.ValidationResult.OBSERVATION, result.getValidationResult());
-        
+
         testKeyInfo.setUuid(new UUID(0, 0));
         result = testKeyInfo.validate(result);
         assertEquals(AxValidationResult.ValidationResult.WARNING, result.getValidationResult());
-        
+
         testKeyInfo.setKey(AxArtifactKey.getNullKey());
         result = testKeyInfo.validate(result);
         assertEquals(AxValidationResult.ValidationResult.INVALID, result.getValidationResult());
-        
-        assertNotNull(AxKeyInfo.generateReproducibleUUID(null));
-        assertNotNull(AxKeyInfo.generateReproducibleUUID("SeedString"));
-        
+
+        assertNotNull(AxKeyInfo.generateReproducibleUuid(null));
+        assertNotNull(AxKeyInfo.generateReproducibleUuid("SeedString"));
+
         testKeyInfo.clean();
         assertNotNull(testKeyInfo);
     }
diff --git a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/concepts/TestAxReferenceKey.java b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/concepts/TestAxReferenceKey.java
index dbc925d..79f3984 100644
--- a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/concepts/TestAxReferenceKey.java
+++ b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/concepts/TestAxReferenceKey.java
@@ -32,9 +32,6 @@
 import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey;
 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
 
-/**
- * @author Liam Fallon (liam.fallon@ericsson.com)
- */
 public class TestAxReferenceKey {
 
     @Test
@@ -49,46 +46,47 @@
         assertNotNull(new AxReferenceKey("ParentKeyName", "0.0.1", "ParentLocalName", "LocalName"));
         assertNotNull(new AxReferenceKey("ParentKeyName:0.0.1:ParentLocalName:LocalName"));
         assertEquals(AxReferenceKey.getNullKey().getKey(), AxReferenceKey.getNullKey());
-        assertEquals("NULL:0.0.0:NULL:NULL", AxReferenceKey.getNullKey().getID());
+        assertEquals("NULL:0.0.0:NULL:NULL", AxReferenceKey.getNullKey().getId());
 
         AxReferenceKey testReferenceKey = new AxReferenceKey();
         testReferenceKey.setParentArtifactKey(new AxArtifactKey("PN", "0.0.1"));
-        assertEquals("PN:0.0.1", testReferenceKey.getParentArtifactKey().getID());
-        
+        assertEquals("PN:0.0.1", testReferenceKey.getParentArtifactKey().getId());
+
         testReferenceKey.setParentReferenceKey(new AxReferenceKey("PN", "0.0.1", "LN"));
-        assertEquals("PN:0.0.1:NULL:LN", testReferenceKey.getParentReferenceKey().getID());
-        
+        assertEquals("PN:0.0.1:NULL:LN", testReferenceKey.getParentReferenceKey().getId());
+
         testReferenceKey.setParentKeyName("NPKN");
         assertEquals("NPKN", testReferenceKey.getParentKeyName());
-        
+
         testReferenceKey.setParentKeyVersion("0.0.1");
         assertEquals("0.0.1", testReferenceKey.getParentKeyVersion());
-        
+
         testReferenceKey.setParentLocalName("NPKLN");
         assertEquals("NPKLN", testReferenceKey.getParentLocalName());
-        
+
         testReferenceKey.setLocalName("NLN");
         assertEquals("NLN", testReferenceKey.getLocalName());
-        
+
         assertFalse(testReferenceKey.isCompatible(AxArtifactKey.getNullKey()));
         assertFalse(testReferenceKey.isCompatible(AxReferenceKey.getNullKey()));
         assertTrue(testReferenceKey.isCompatible(testReferenceKey));
-        
+
         assertEquals(AxKey.Compatibility.DIFFERENT, testReferenceKey.getCompatibility(AxArtifactKey.getNullKey()));
         assertEquals(AxKey.Compatibility.DIFFERENT, testReferenceKey.getCompatibility(AxReferenceKey.getNullKey()));
         assertEquals(AxKey.Compatibility.IDENTICAL, testReferenceKey.getCompatibility(testReferenceKey));
-        
+
         AxValidationResult result = new AxValidationResult();
         result = testReferenceKey.validate(result);
         assertEquals(AxValidationResult.ValidationResult.VALID, result.getValidationResult());
-        
+
         testReferenceKey.clean();
-        
+
         AxReferenceKey clonedReferenceKey = new AxReferenceKey(testReferenceKey);
-        assertEquals("AxReferenceKey:(parentKeyName=NPKN,parentKeyVersion=0.0.1,parentLocalName=NPKLN,localName=NLN)", clonedReferenceKey.toString());
-        
+        assertEquals("AxReferenceKey:(parentKeyName=NPKN,parentKeyVersion=0.0.1,parentLocalName=NPKLN,localName=NLN)",
+                        clonedReferenceKey.toString());
+
         assertFalse(testReferenceKey.hashCode() == 0);
-        
+
         assertTrue(testReferenceKey.equals(testReferenceKey));
         assertTrue(testReferenceKey.equals(clonedReferenceKey));
         assertFalse(testReferenceKey.equals("Hello"));
@@ -97,7 +95,7 @@
         assertFalse(testReferenceKey.equals(new AxReferenceKey("NPKN", "0.0.1", "PLN", "LN")));
         assertFalse(testReferenceKey.equals(new AxReferenceKey("NPKN", "0.0.1", "NPLN", "LN")));
         assertTrue(testReferenceKey.equals(new AxReferenceKey("NPKN", "0.0.1", "NPKLN", "NLN")));
-        
+
         assertEquals(0, testReferenceKey.compareTo(testReferenceKey));
         assertEquals(0, testReferenceKey.compareTo(clonedReferenceKey));
         assertNotEquals(0, testReferenceKey.compareTo(new AxArtifactKey()));
@@ -106,7 +104,7 @@
         assertNotEquals(0, testReferenceKey.compareTo(new AxReferenceKey("NPKN", "0.0.1", "PLN", "LN")));
         assertNotEquals(0, testReferenceKey.compareTo(new AxReferenceKey("NPKN", "0.0.1", "NPLN", "LN")));
         assertEquals(0, testReferenceKey.compareTo(new AxReferenceKey("NPKN", "0.0.1", "NPKLN", "NLN")));
-        
+
         assertNotNull(testReferenceKey.getKeys());
     }
 }
diff --git a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/concepts/TestEntity.java b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/concepts/TestEntity.java
index 6ba380b..2667f3d 100644
--- a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/concepts/TestEntity.java
+++ b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/concepts/TestEntity.java
@@ -47,22 +47,22 @@
     protected AxReferenceKey key;
 
     private double doubleValue;
-   
+
     public TestEntity() {
         this.key = new AxReferenceKey();
         this.doubleValue = 0;
     }
-   
+
     public TestEntity(Double doubleValue) {
         this.key = new AxReferenceKey();
         this.doubleValue = doubleValue;
     }
-   
+
     public TestEntity(AxReferenceKey key, Double doubleValue) {
         this.key = key;
         this.doubleValue = doubleValue;
     }
-   
+
     public AxReferenceKey getKey() {
         return key;
     }
@@ -96,7 +96,7 @@
     public void clean() {
         key.clean();
     }
-   
+
     @Override
     public String toString() {
         final StringBuilder builder = new StringBuilder();
@@ -107,20 +107,18 @@
 
     @Override
     public AxConcept copyTo(AxConcept target) {
-        final Object copyObject = ((target == null) ? new TestEntity(): target);
+        final Object copyObject = ((target == null) ? new TestEntity() : target);
         if (copyObject instanceof TestEntity) {
             final TestEntity copy = ((TestEntity) copyObject);
             if (this.checkSetKey()) {
                 copy.setKey(new AxReferenceKey(key));
-            }
-            else {
+            } else {
                 copy.key = null;
             }
             copy.doubleValue = doubleValue;
             return copy;
-        }
-        else {
-        		return null;
+        } else {
+            return null;
         }
     }
 
@@ -134,42 +132,49 @@
 
     @Override
     public boolean equals(Object obj) {
-        if (obj == null)
+        if (obj == null) {
             return false;
-        if (this == obj)
+        }
+        if (this == obj) {
             return true;
-        if (getClass() != obj.getClass())
+        }
+        if (getClass() != obj.getClass()) {
             return false;
+        }
         TestEntity other = (TestEntity) obj;
         if (key == null) {
-            if (other.key != null)
+            if (other.key != null) {
                 return false;
+            }
+        } else if (!key.equals(other.key)) {
+            return false;
         }
-        else
-            if (!key.equals(other.key))
-                return false;
-        if (doubleValue != other.doubleValue)
-                return false;
+        if (doubleValue != other.doubleValue) {
+            return false;
+        }
         return true;
     }
-   
+
     @Override
     public int compareTo(AxConcept otherObj) {
-        if (otherObj == null)
+        if (otherObj == null) {
             return -1;
-        if (this == otherObj)
+        }
+        if (this == otherObj) {
             return 0;
+        }
         TestEntity other = (TestEntity) otherObj;
         if (key == null) {
-            if (other.key != null)
+            if (other.key != null) {
                 return 1;
+            }
+        } else if (!key.equals(other.key)) {
+            return key.compareTo(other.key);
         }
-        else
-            if (!key.equals(other.key))
-                return key.compareTo(other.key);
-        if (doubleValue != other.doubleValue)
+        if (doubleValue != other.doubleValue) {
             return new Double(doubleValue).compareTo(other.doubleValue);
-       
+        }
+
         return 0;
     }
 }
diff --git a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/concepts/TestExceptions.java b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/concepts/TestExceptions.java
index 1fc5209..7a980d5 100644
--- a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/concepts/TestExceptions.java
+++ b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/concepts/TestExceptions.java
@@ -31,9 +31,6 @@
 import org.onap.policy.apex.model.basicmodel.concepts.ApexRuntimeException;
 import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
 
-/**
- * @author Liam Fallon (liam.fallon@ericsson.com)
- */
 public class TestExceptions {
 
     @Test
@@ -42,29 +39,32 @@
         assertNotNull(new ApexException("Message", new AxArtifactKey()));
         assertNotNull(new ApexException("Message", new IOException()));
         assertNotNull(new ApexException("Message", new IOException(), new AxArtifactKey()));
-        
+
         AxArtifactKey key = new AxArtifactKey();
         ApexException ae = new ApexException("Message", new IOException("IO exception message"), key);
         assertEquals("Message\ncaused by: Message\ncaused by: IO exception message", ae.getCascadedMessage());
         assertEquals(key, ae.getObject());
-        
+
         assertNotNull(new ApexRuntimeException("Message"));
         assertNotNull(new ApexRuntimeException("Message", new AxArtifactKey()));
         assertNotNull(new ApexRuntimeException("Message", new IOException()));
         assertNotNull(new ApexRuntimeException("Message", new IOException(), new AxArtifactKey()));
-        
-        AxArtifactKey rKey = new AxArtifactKey();
-        ApexRuntimeException re = new ApexRuntimeException("Runtime Message", new IOException("IO runtime exception message"), rKey);
-        assertEquals("Runtime Message\ncaused by: Runtime Message\ncaused by: IO runtime exception message", re.getCascadedMessage());
+
+        AxArtifactKey rkey = new AxArtifactKey();
+        ApexRuntimeException re = new ApexRuntimeException("Runtime Message",
+                        new IOException("IO runtime exception message"), rkey);
+        assertEquals("Runtime Message\ncaused by: Runtime Message\ncaused by: IO runtime exception message",
+                        re.getCascadedMessage());
         assertEquals(key, re.getObject());
-        
+
         assertNotNull(new ApexConceptException("Message"));
         assertNotNull(new ApexConceptException("Message", new IOException()));
-        
-        AxArtifactKey cKey = new AxArtifactKey();
-        ApexException ace = new ApexException("Concept Message", new IOException("IO concept exception message"), cKey);
-        assertEquals("Concept Message\ncaused by: Concept Message\ncaused by: IO concept exception message", ace.getCascadedMessage());
-        assertEquals(cKey, ace.getObject());
+
+        AxArtifactKey ckey = new AxArtifactKey();
+        ApexException ace = new ApexException("Concept Message", new IOException("IO concept exception message"), ckey);
+        assertEquals("Concept Message\ncaused by: Concept Message\ncaused by: IO concept exception message",
+                        ace.getCascadedMessage());
+        assertEquals(ckey, ace.getObject());
     }
 
 }
diff --git a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/concepts/testKeyUse.java b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/concepts/TestKeyUse.java
similarity index 97%
rename from model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/concepts/testKeyUse.java
rename to model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/concepts/TestKeyUse.java
index 10706f3..6b53469 100644
--- a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/concepts/testKeyUse.java
+++ b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/concepts/TestKeyUse.java
@@ -28,12 +28,12 @@
 
 import org.junit.Test;
 import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
+import org.onap.policy.apex.model.basicmodel.concepts.AxKey.Compatibility;
 import org.onap.policy.apex.model.basicmodel.concepts.AxKeyUse;
 import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey;
 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
-import org.onap.policy.apex.model.basicmodel.concepts.AxKey.Compatibility;
 
-public class testKeyUse {
+public class TestKeyUse {
 
     @Test
     public void test() {
@@ -45,7 +45,7 @@
         AxKeyUse keyUse = new AxKeyUse();
         keyUse.setKey(key);
         assertEquals(key, keyUse.getKey());
-        assertEquals("Key:0.0.1", keyUse.getID());
+        assertEquals("Key:0.0.1", keyUse.getId());
         assertEquals(key, keyUse.getKeys().get(0));
         
         assertEquals(Compatibility.IDENTICAL, keyUse.getCompatibility(key));
diff --git a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/concepts/TestValidation.java b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/concepts/TestValidation.java
index 93eb78b..cfa4d0d 100644
--- a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/concepts/TestValidation.java
+++ b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/concepts/TestValidation.java
@@ -32,9 +32,6 @@
 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult.ValidationResult;
 
-/**
- * @author Liam Fallon (liam.fallon@ericsson.com)
- */
 public class TestValidation {
 
     @Test
@@ -42,49 +39,53 @@
         AxValidationResult result = new AxValidationResult();
         AxReferenceKey refKey = new AxReferenceKey("PK", "0.0.1", "PLN", "LN");
         result = refKey.validate(result);
-        
+
         assertNotNull(result);
-        assertTrue(result.isOK());
+        assertTrue(result.isOk());
         assertTrue(result.isValid());
         assertEquals(AxValidationResult.ValidationResult.VALID, result.getValidationResult());
         assertNotNull(result.getMessageList());
-        
-        AxValidationMessage vMess0 = new AxValidationMessage(AxArtifactKey.getNullKey(), AxArtifactKey.class, ValidationResult.VALID, "Some message");
-        result.addValidationMessage(vMess0);
-        
-        assertTrue(result.isOK());
+
+        AxValidationMessage vmess0 = new AxValidationMessage(AxArtifactKey.getNullKey(), AxArtifactKey.class,
+                        ValidationResult.VALID, "Some message");
+        result.addValidationMessage(vmess0);
+
+        assertTrue(result.isOk());
         assertTrue(result.isValid());
         assertEquals(AxValidationResult.ValidationResult.VALID, result.getValidationResult());
         assertNotNull(result.getMessageList());
         assertNotNull("hello", result.toString());
-        
-        AxValidationMessage vMess1 = new AxValidationMessage(AxArtifactKey.getNullKey(), AxArtifactKey.class, ValidationResult.OBSERVATION, "Some message");
-        result.addValidationMessage(vMess1);
-        
-        assertTrue(result.isOK());
+
+        AxValidationMessage vmess1 = new AxValidationMessage(AxArtifactKey.getNullKey(), AxArtifactKey.class,
+                        ValidationResult.OBSERVATION, "Some message");
+        result.addValidationMessage(vmess1);
+
+        assertTrue(result.isOk());
         assertTrue(result.isValid());
         assertEquals(AxValidationResult.ValidationResult.OBSERVATION, result.getValidationResult());
         assertNotNull(result.getMessageList());
         assertNotNull("hello", result.toString());
-        
-        AxValidationMessage vMess2 = new AxValidationMessage(AxArtifactKey.getNullKey(), AxArtifactKey.class, ValidationResult.WARNING, "Some message");
-        result.addValidationMessage(vMess2);
-        
-        assertFalse(result.isOK());
+
+        AxValidationMessage vmess2 = new AxValidationMessage(AxArtifactKey.getNullKey(), AxArtifactKey.class,
+                        ValidationResult.WARNING, "Some message");
+        result.addValidationMessage(vmess2);
+
+        assertFalse(result.isOk());
         assertTrue(result.isValid());
         assertEquals(AxValidationResult.ValidationResult.WARNING, result.getValidationResult());
         assertNotNull(result.getMessageList());
         assertNotNull("hello", result.toString());
-        
-        AxValidationMessage vMess3 = new AxValidationMessage(AxArtifactKey.getNullKey(), AxArtifactKey.class, ValidationResult.INVALID, "Some message");
-        result.addValidationMessage(vMess3);
-        
-        assertFalse(result.isOK());
+
+        AxValidationMessage vmess3 = new AxValidationMessage(AxArtifactKey.getNullKey(), AxArtifactKey.class,
+                        ValidationResult.INVALID, "Some message");
+        result.addValidationMessage(vmess3);
+
+        assertFalse(result.isOk());
         assertFalse(result.isValid());
         assertEquals(AxValidationResult.ValidationResult.INVALID, result.getValidationResult());
         assertNotNull(result.getMessageList());
         assertNotNull("hello", result.toString());
-        
+
         assertEquals(AxValidationResult.ValidationResult.INVALID, result.getMessageList().get(3).getValidationResult());
         assertEquals("Some message", result.getMessageList().get(3).getMessage());
         assertEquals(AxArtifactKey.class.getCanonicalName(), result.getMessageList().get(3).getObservedClass());
diff --git a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/dao/EntityTest.java b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/dao/EntityTest.java
index e5d5973..4c99ce3 100644
--- a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/dao/EntityTest.java
+++ b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/dao/EntityTest.java
@@ -45,7 +45,7 @@
 import org.onap.policy.apex.model.basicmodel.concepts.TestEntity;
 
 /**
- * JUnit test class
+ * JUnit test class.
  */
 public class EntityTest {
     private Connection connection;
@@ -65,7 +65,7 @@
 
     @Test
     public void testEntityTestSanity() throws ApexException {
-        final DAOParameters daoParameters = new DAOParameters();
+        final DaoParameters daoParameters = new DaoParameters();
 
         apexDao = new ApexDaoFactory().createApexDao(daoParameters);
 
@@ -101,10 +101,10 @@
     }
 
     @Test
-    public void testEntityTestAllOpsJPA() throws ApexException {
-        final DAOParameters daoParameters = new DAOParameters();
+    public void testEntityTestAllOpsJpa() throws ApexException {
+        final DaoParameters daoParameters = new DaoParameters();
         daoParameters.setPluginClass("org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao");
-        daoParameters.setPersistenceUnit("DAOTest");
+        daoParameters.setPersistenceUnit("DaoTest");
 
         apexDao = new ApexDaoFactory().createApexDao(daoParameters);
         apexDao.init(daoParameters);
@@ -115,9 +115,9 @@
 
     @Test
     public void testEntityTestBadVals() throws ApexException {
-        final DAOParameters daoParameters = new DAOParameters();
+        final DaoParameters daoParameters = new DaoParameters();
         daoParameters.setPluginClass("org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao");
-        daoParameters.setPersistenceUnit("DAOTest");
+        daoParameters.setPersistenceUnit("DaoTest");
 
         apexDao = new ApexDaoFactory().createApexDao(daoParameters);
         apexDao.init(daoParameters);
@@ -130,12 +130,12 @@
         final List<AxReferenceKey> emptyRKeyList = new ArrayList<>();
 
         apexDao.create(nullKey);
-        apexDao.create(nullKeyList);
-        apexDao.create(emptyKeyList);
+        apexDao.createCollection(nullKeyList);
+        apexDao.createCollection(emptyKeyList);
 
         apexDao.delete(nullKey);
-        apexDao.delete(nullKeyList);
-        apexDao.delete(emptyKeyList);
+        apexDao.deleteCollection(nullKeyList);
+        apexDao.deleteCollection(emptyKeyList);
         apexDao.delete(AxArtifactKey.class, nullKey);
         apexDao.delete(AxReferenceKey.class, nullRefKey);
         apexDao.deleteByArtifactKey(AxArtifactKey.class, nullKeyList);
@@ -160,12 +160,12 @@
         final AxArtifactKey aKey0 = new AxArtifactKey("A-KEY0", "0.0.1");
         final AxArtifactKey aKey1 = new AxArtifactKey("A-KEY1", "0.0.1");
         final AxArtifactKey aKey2 = new AxArtifactKey("A-KEY2", "0.0.1");
-        final AxKeyInfo keyInfo0 =
-                new AxKeyInfo(aKey0, UUID.fromString("00000000-0000-0000-0000-000000000000"), "key description 0");
-        final AxKeyInfo keyInfo1 =
-                new AxKeyInfo(aKey1, UUID.fromString("00000000-0000-0000-0000-000000000001"), "key description 1");
-        final AxKeyInfo keyInfo2 =
-                new AxKeyInfo(aKey2, UUID.fromString("00000000-0000-0000-0000-000000000002"), "key description 2");
+        final AxKeyInfo keyInfo0 = new AxKeyInfo(aKey0, UUID.fromString("00000000-0000-0000-0000-000000000000"),
+                        "key description 0");
+        final AxKeyInfo keyInfo1 = new AxKeyInfo(aKey1, UUID.fromString("00000000-0000-0000-0000-000000000001"),
+                        "key description 1");
+        final AxKeyInfo keyInfo2 = new AxKeyInfo(aKey2, UUID.fromString("00000000-0000-0000-0000-000000000002"),
+                        "key description 2");
 
         apexDao.create(keyInfo0);
 
@@ -185,7 +185,7 @@
         keyInfoSetIn.add(keyInfo1);
         keyInfoSetIn.add(keyInfo2);
 
-        apexDao.create(keyInfoSetIn);
+        apexDao.createCollection(keyInfoSetIn);
 
         Set<AxKeyInfo> keyInfoSetOut = new TreeSet<AxKeyInfo>(apexDao.getAll(AxKeyInfo.class));
 
@@ -197,14 +197,14 @@
         keyInfoSetOut = new TreeSet<AxKeyInfo>(apexDao.getAll(AxKeyInfo.class));
         assertTrue(keyInfoSetIn.equals(keyInfoSetOut));
 
-        apexDao.delete(keyInfoSetIn);
+        apexDao.deleteCollection(keyInfoSetIn);
         keyInfoSetOut = new TreeSet<AxKeyInfo>(apexDao.getAll(AxKeyInfo.class));
         assertEquals(0, keyInfoSetOut.size());
 
         keyInfoSetIn.add(keyInfo0);
         keyInfoSetIn.add(keyInfo1);
         keyInfoSetIn.add(keyInfo0);
-        apexDao.create(keyInfoSetIn);
+        apexDao.createCollection(keyInfoSetIn);
         keyInfoSetOut = new TreeSet<AxKeyInfo>(apexDao.getAll(AxKeyInfo.class));
         assertTrue(keyInfoSetIn.equals(keyInfoSetOut));
 
@@ -226,7 +226,7 @@
         keyInfoSetIn.add(keyInfo0);
         keyInfoSetIn.add(keyInfo1);
         keyInfoSetIn.add(keyInfo0);
-        apexDao.create(keyInfoSetIn);
+        apexDao.createCollection(keyInfoSetIn);
         keyInfoSetOut = new TreeSet<AxKeyInfo>(apexDao.getAll(AxKeyInfo.class));
         assertTrue(keyInfoSetIn.equals(keyInfoSetOut));
 
diff --git a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/dao/TestDaoMisc.java b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/dao/TestDaoMisc.java
index 9f5b72d..7966e8d 100644
--- a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/dao/TestDaoMisc.java
+++ b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/dao/TestDaoMisc.java
@@ -27,28 +27,25 @@
 import java.util.Properties;
 
 import org.junit.Test;
-import org.onap.policy.apex.model.basicmodel.dao.converters.CDATAConditioner;
-import org.onap.policy.apex.model.basicmodel.dao.converters.UUID2String;
+import org.onap.policy.apex.model.basicmodel.dao.converters.CDataConditioner;
+import org.onap.policy.apex.model.basicmodel.dao.converters.Uuid2String;
 
-/**
- * @author Liam Fallon (liam.fallon@ericsson.com)
- */
 public class TestDaoMisc {
 
     @Test
-    public void testUUID2StringMopUp() {
-        final UUID2String uuid2String = new UUID2String();
+    public void testUuid2StringMopUp() {
+        final Uuid2String uuid2String = new Uuid2String();
         assertEquals("", uuid2String.convertToDatabaseColumn(null));
     }
 
     @Test
     public void testCDataConditionerMopUp() {
-        assertNull(CDATAConditioner.clean(null));
+        assertNull(CDataConditioner.clean(null));
     }
 
     @Test
     public void testDaoFactory() {
-        final DAOParameters daoParameters = new DAOParameters();
+        final DaoParameters daoParameters = new DaoParameters();
 
         daoParameters.setPluginClass("somewhere.over.the.rainbow");
         try {
@@ -63,15 +60,14 @@
             new ApexDaoFactory().createApexDao(daoParameters);
             fail("test shold throw an exception here");
         } catch (final Exception e) {
-            assertEquals(
-                    "Specified Apex DAO plugin class \"java.lang.String\" does not implement the ApexDao interface",
-                    e.getMessage());
+            assertEquals("Specified Apex DAO plugin class \"java.lang.String\" "
+                            + "does not implement the ApexDao interface", e.getMessage());
         }
     }
 
     @Test
     public void testDaoParameters() {
-        final DAOParameters pars = new DAOParameters();
+        final DaoParameters pars = new DaoParameters();
         pars.setJdbcProperties(new Properties());
         assertEquals(0, pars.getJdbcProperties().size());
 
@@ -84,8 +80,7 @@
         pars.setPluginClass("somewhere.over.the.rainbow");
         assertEquals("somewhere.over.the.rainbow", pars.getPluginClass());
 
-        assertEquals(
-                "DAOParameters [pluginClass=somewhere.over.the.rainbow, persistenceUnit=Kansas, jdbcProperties={name=Dorothy}]",
-                pars.toString());
+        assertEquals("DAOParameters [pluginClass=somewhere.over.the.rainbow, "
+                        + "persistenceUnit=Kansas, jdbcProperties={name=Dorothy}]", pars.toString());
     }
 }
diff --git a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/AxModelWithReferences.java b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/AxModelWithReferences.java
index 3835905..8e52b39 100644
--- a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/AxModelWithReferences.java
+++ b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/AxModelWithReferences.java
@@ -31,7 +31,7 @@
 public class AxModelWithReferences extends AxModel {
     private static final long serialVersionUID = -8194956638511120008L;
 
-    private List<AxKey> extraKeyList = new ArrayList<>();
+    private List<AxKey> extrakeyList = new ArrayList<>();
     
     public AxModelWithReferences(final AxArtifactKey key) {
         super(key);
@@ -40,30 +40,33 @@
     @Override
     public List<AxKey> getKeys() {
         List<AxKey> keys = super.getKeys();
-        keys.addAll(extraKeyList);
+        keys.addAll(extrakeyList);
 
         return keys;
     }
 
-    public List<AxKey> getExtraKeyList() {
-        return extraKeyList;
+    public List<AxKey> getExtrakeyList() {
+        return extrakeyList;
     }
 
+    /**
+     * Set the reference key list.
+     */
     public void setReferenceKeyList() {
         List<AxKey> keys = super.getKeys();
         
         for (AxKey key: keys) {
-            AxArtifactKey aKey = (AxArtifactKey)key;
-            AxReferenceKey keyRef = new AxReferenceKey(aKey, aKey.getName());
-            extraKeyList.add(keyRef);
+            AxArtifactKey akey = (AxArtifactKey)key;
+            AxReferenceKey keyRef = new AxReferenceKey(akey, akey.getName());
+            extrakeyList.add(keyRef);
         }
     }
     
-    public void addKey(final AxKey aKey) {
-        extraKeyList.add(aKey);
+    public void addKey(final AxKey akey) {
+        extrakeyList.add(akey);
     }
     
-    public void removeKey(final AxKey aKey) {
-        extraKeyList.remove(aKey);
+    public void removeKey(final AxKey akey) {
+        extrakeyList.remove(akey);
     }
 }
diff --git a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestApexBasicModel.java b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestApexBasicModel.java
index d0423eb..69942b3 100644
--- a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestApexBasicModel.java
+++ b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestApexBasicModel.java
@@ -33,13 +33,18 @@
 import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
 import org.onap.policy.apex.model.basicmodel.concepts.AxModel;
 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
-import org.onap.policy.apex.model.basicmodel.dao.DAOParameters;
+import org.onap.policy.apex.model.basicmodel.dao.DaoParameters;
 import org.onap.policy.apex.model.basicmodel.test.TestApexModel;
 
 public class TestApexBasicModel {
     private Connection connection;
     TestApexModel<AxModel> testApexModel;
 
+    /**
+     * Set up the test.
+     * 
+     * @throws Exception any exception thrown by the test
+     */
     @Before
     public void setup() throws Exception {
         Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
@@ -88,46 +93,57 @@
     }
 
     @Test
-    public void testModelWriteReadXML() throws Exception {
-        testApexModel.testApexModelWriteReadXML();
+    public void testModelWriteReadXml() throws Exception {
+        testApexModel.testApexModelWriteReadXml();
     }
 
     @Test
-    public void testModelWriteReadJSON() throws Exception {
-        testApexModel.testApexModelWriteReadJSON();
+    public void testModelWriteReadJson() throws Exception {
+        testApexModel.testApexModelWriteReadJson();
     }
 
     @Test
-    public void testModelWriteReadJPA() throws Exception {
-        final DAOParameters daoParameters = new DAOParameters();
+    public void testModelWriteReadJpa() throws Exception {
+        final DaoParameters daoParameters = new DaoParameters();
         daoParameters.setPluginClass("org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao");
-        daoParameters.setPersistenceUnit("DAOTest");
+        daoParameters.setPersistenceUnit("DaoTest");
 
-        testApexModel.testApexModelWriteReadJPA(daoParameters);
+        testApexModel.testApexModelWriteReadJpa(daoParameters);
     }
 
     // As there are no real concepts in a basic model, this is as near to a valid model as we can get
     private static final String VALID_MODEL_STRING = "\n" + "***warnings issued during validation of model***\n"
-            + "AxArtifactKey:(name=FloatKIKey,version=0.0.1):org.onap.policy.apex.model.basicmodel.concepts.AxModel:WARNING:key not found for key information entry\n"
-            + "AxArtifactKey:(name=IntegerKIKey,version=0.0.1):org.onap.policy.apex.model.basicmodel.concepts.AxModel:WARNING:key not found for key information entry\n"
-            + "********************************";
+                    + "AxArtifactKey:(name=FloatKIKey,version=0.0.1):org.onap.policy.apex.model.basicmodel.concepts"
+                    + ".AxModel:WARNING:key not found for key information entry\n"
+                    + "AxArtifactKey:(name=IntegerKIKey,version=0.0.1):org.onap.policy.apex.model.basicmodel.concepts"
+                    + ".AxModel:WARNING:key not found for key information entry\n" + "********************************";
 
     private static final String WARNING_MODEL_STRING = "\n" + "***warnings issued during validation of model***\n"
-            + "AxArtifactKey:(name=FloatKIKey,version=0.0.1):org.onap.policy.apex.model.basicmodel.concepts.AxModel:WARNING:key not found for key information entry\n"
-            + "AxArtifactKey:(name=IntegerKIKey,version=0.0.1):org.onap.policy.apex.model.basicmodel.concepts.AxModel:WARNING:key not found for key information entry\n"
-            + "AxArtifactKey:(name=Unref0,version=0.0.1):org.onap.policy.apex.model.basicmodel.concepts.AxModel:WARNING:key not found for key information entry\n"
-            + "AxArtifactKey:(name=Unref1,version=0.0.1):org.onap.policy.apex.model.basicmodel.concepts.AxModel:WARNING:key not found for key information entry\n"
-            + "********************************";
+                    + "AxArtifactKey:(name=FloatKIKey,version=0.0.1):org.onap.policy.apex.model.basicmodel.concepts"
+                    + ".AxModel:WARNING:key not found for key information entry\n"
+                    + "AxArtifactKey:(name=IntegerKIKey,version=0.0.1):org.onap.policy.apex.model.basicmodel.concepts"
+                    + ".AxModel:WARNING:key not found for key information entry\n"
+                    + "AxArtifactKey:(name=Unref0,version=0.0.1):org.onap.policy.apex.model.basicmodel.concepts"
+                    + ".AxModel:WARNING:key not found for key information entry\n"
+                    + "AxArtifactKey:(name=Unref1,version=0.0.1):org.onap.policy.apex.model.basicmodel.concepts"
+                    + ".AxModel:WARNING:key not found for key information entry\n" + "********************************";
 
     private static final String INVALID_MODEL_STRING = "\n" + "***validation of model failed***\n"
-            + "AxArtifactKey:(name=BasicModelKey,version=0.0.1):org.onap.policy.apex.model.basicmodel.concepts.AxKeyInfo:WARNING:UUID is a zero UUID: 00000000-0000-0000-0000-000000000000\n"
-            + "AxArtifactKey:(name=KeyInfoMapKey,version=0.0.1):org.onap.policy.apex.model.basicmodel.concepts.AxKeyInfo:OBSERVATION:description is blank\n"
-            + "AxArtifactKey:(name=KeyInfoMapKey,version=0.0.1):org.onap.policy.apex.model.basicmodel.concepts.AxKeyInfo:WARNING:UUID is a zero UUID: 00000000-0000-0000-0000-000000000000\n"
-            + "AxArtifactKey:(name=KeyInfoMapKey,version=0.0.1):org.onap.policy.apex.model.basicmodel.concepts.AxKeyInformation:INVALID:duplicate UUID found on keyInfoMap entry AxArtifactKey:(name=KeyInfoMapKey,version=0.0.1):00000000-0000-0000-0000-000000000000\n"
-            + "********************************";
+                    + "AxArtifactKey:(name=BasicModelKey,version=0.0.1):org.onap.policy.apex.model.basicmodel.concepts."
+                    + "AxKeyInfo:WARNING:UUID is a zero UUID: 00000000-0000-0000-0000-000000000000\n"
+                    + "AxArtifactKey:(name=KeyInfoMapKey,version=0.0.1):org.onap.policy.apex.model.basicmodel.concepts."
+                    + "AxKeyInfo:OBSERVATION:description is blank\n"
+                    + "AxArtifactKey:(name=KeyInfoMapKey,version=0.0.1):org.onap.policy.apex.model.basicmodel.concepts."
+                    + "AxKeyInfo:WARNING:UUID is a zero UUID: 00000000-0000-0000-0000-000000000000\n"
+                    + "AxArtifactKey:(name=KeyInfoMapKey,version=0.0.1):org.onap.policy.apex.model.basicmodel.concepts."
+                    + "AxKeyInformation:INVALID:duplicate UUID found on keyInfoMap entry AxArtifactKey:"
+                    + "(name=KeyInfoMapKey,version=0.0.1):00000000-0000-0000-0000-000000000000\n"
+                    + "********************************";
 
     private static final String INVALID_MODEL_MALSTRUCTURED_STRING = "\n" + "***validation of model failed***\n"
-            + "AxArtifactKey:(name=BasicModelKey,version=0.0.1):org.onap.policy.apex.model.basicmodel.concepts.AxKeyInfo:WARNING:UUID is a zero UUID: 00000000-0000-0000-0000-000000000000\n"
-            + "AxArtifactKey:(name=BasicModelKey,version=0.0.1):org.onap.policy.apex.model.basicmodel.concepts.AxModel:INVALID:key information not found for key AxArtifactKey:(name=KeyInfoMapKey,version=0.0.1)\n"
-            + "********************************";
+                    + "AxArtifactKey:(name=BasicModelKey,version=0.0.1):org.onap.policy.apex.model.basicmodel.concepts."
+                    + "AxKeyInfo:WARNING:UUID is a zero UUID: 00000000-0000-0000-0000-000000000000\n"
+                    + "AxArtifactKey:(name=BasicModelKey,version=0.0.1):org.onap.policy.apex.model.basicmodel.concepts."
+                    + "AxModel:INVALID:key information not found for key "
+                    + "AxArtifactKey:(name=KeyInfoMapKey,version=0.0.1)\n" + "********************************";
 }
diff --git a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestApexBasicModelConcepts.java b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestApexBasicModelConcepts.java
index 1ab7a26..11cab6d 100644
--- a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestApexBasicModelConcepts.java
+++ b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestApexBasicModelConcepts.java
@@ -257,20 +257,20 @@
         mwr.removeKey(keyU);
 
         // Key Use on bad artifact key
-        final AxKeyUse keyBU = new AxKeyUse(new AxArtifactKey("SomeKey", "0.0.1"));
-        mwr.addKey(keyBU);
+        final AxKeyUse keyBadUsage = new AxKeyUse(new AxArtifactKey("SomeKey", "0.0.1"));
+        mwr.addKey(keyBadUsage);
         result = new AxValidationResult();
         result = mwr.validate(result);
         assertEquals(ValidationResult.INVALID, result.getValidationResult());
-        mwr.removeKey(keyBU);
+        mwr.removeKey(keyBadUsage);
 
         // Key Use on bad reference key
-        final AxKeyUse keyBRU = new AxKeyUse(new AxReferenceKey("SomeKey", "0.0.1", "Local"));
-        mwr.addKey(keyBRU);
+        final AxKeyUse keyBadReferenceUsage = new AxKeyUse(new AxReferenceKey("SomeKey", "0.0.1", "Local"));
+        mwr.addKey(keyBadReferenceUsage);
         result = new AxValidationResult();
         result = mwr.validate(result);
         assertEquals(ValidationResult.INVALID, result.getValidationResult());
-        mwr.removeKey(keyBRU);
+        mwr.removeKey(keyBadReferenceUsage);
 
         result = new AxValidationResult();
         result = mwr.validate(result);
diff --git a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestApexBasicModelCreator.java b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestApexBasicModelCreator.java
index 762c755..b11669f 100644
--- a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestApexBasicModelCreator.java
+++ b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestApexBasicModelCreator.java
@@ -38,13 +38,16 @@
         basicModel.setKeyInformation(new AxKeyInformation(new AxArtifactKey("KeyInfoMapKey", "0.0.1")));
 
         basicModel.getKeyInformation().getKeyInfoMap().put(basicModel.getKey(), new AxKeyInfo(basicModel.getKey()));
-        basicModel.getKeyInformation().getKeyInfoMap().put(basicModel.getKeyInformation().getKey(), new AxKeyInfo(basicModel.getKeyInformation().getKey()));
+        basicModel.getKeyInformation().getKeyInfoMap().put(basicModel.getKeyInformation().getKey(),
+                        new AxKeyInfo(basicModel.getKeyInformation().getKey()));
 
-        AxKeyInfo intKI = new AxKeyInfo(new AxArtifactKey("IntegerKIKey", "0.0.1"), UUID.randomUUID(), "IntegerKIKey description");
-        basicModel.getKeyInformation().getKeyInfoMap().put(intKI.getKey(), new AxKeyInfo(intKI.getKey()));
+        AxKeyInfo intKeyInfo = new AxKeyInfo(new AxArtifactKey("IntegerKIKey", "0.0.1"), UUID.randomUUID(),
+                        "IntegerKIKey description");
+        basicModel.getKeyInformation().getKeyInfoMap().put(intKeyInfo.getKey(), new AxKeyInfo(intKeyInfo.getKey()));
 
-        AxKeyInfo floatKI = new AxKeyInfo(new AxArtifactKey("FloatKIKey", "0.0.1"), UUID.randomUUID(), "FloatKIKey description");
-        basicModel.getKeyInformation().getKeyInfoMap().put(floatKI.getKey(), new AxKeyInfo(floatKI.getKey()));
+        AxKeyInfo floatKeyInfo = new AxKeyInfo(new AxArtifactKey("FloatKIKey", "0.0.1"), UUID.randomUUID(),
+                        "FloatKIKey description");
+        basicModel.getKeyInformation().getKeyInfoMap().put(floatKeyInfo.getKey(), new AxKeyInfo(floatKeyInfo.getKey()));
 
         return basicModel;
     }
@@ -57,10 +60,7 @@
         basicModel.setKey(new AxArtifactKey("BasicModelKey", "0.0.1"));
         basicModel.setKeyInformation(new AxKeyInformation(new AxArtifactKey("KeyInfoMapKey", "0.0.1")));
 
-        basicModel.getKeyInformation().getKeyInfoMap().put(
-                basicModel.getKey(),
-                new AxKeyInfo(
-                        basicModel.getKey(),
+        basicModel.getKeyInformation().getKeyInfoMap().put(basicModel.getKey(), new AxKeyInfo(basicModel.getKey(),
                         UUID.fromString("00000000-0000-0000-0000-000000000000"),
                         "\nbasic model description\nThis is a multi line description\nwith another line of text."));
 
@@ -98,29 +98,27 @@
         basicModel.setKey(new AxArtifactKey("BasicModelKey", "0.0.1"));
         basicModel.setKeyInformation(new AxKeyInformation(new AxArtifactKey("KeyInfoMapKey", "0.0.1")));
 
-        basicModel.getKeyInformation().getKeyInfoMap().put(
-                basicModel.getKey(),
-                new AxKeyInfo(
-                        basicModel.getKey(),
+        basicModel.getKeyInformation().getKeyInfoMap().put(basicModel.getKey(), new AxKeyInfo(basicModel.getKey(),
                         UUID.fromString("00000000-0000-0000-0000-000000000000"),
                         "nbasic model description\nThis is a multi line description\nwith another line of text."));
-        basicModel.getKeyInformation().getKeyInfoMap().put(
-                basicModel.getKeyInformation().getKey(),
-                new AxKeyInfo(
-                        basicModel.getKeyInformation().getKey(),
-                        UUID.fromString("00000000-0000-0000-0000-000000000000"),
-                        ""));
+        basicModel.getKeyInformation().getKeyInfoMap().put(basicModel.getKeyInformation().getKey(),
+                        new AxKeyInfo(basicModel.getKeyInformation().getKey(),
+                                        UUID.fromString("00000000-0000-0000-0000-000000000000"), ""));
 
         return basicModel;
     }
-    
+
+    /**
+     * Get the model with its references.
+     * @return the model with its references
+     */
     public final AxModelWithReferences getModelWithReferences() {
         AxModel model = getModel();
-        
+
         AxModelWithReferences modelWithReferences = new AxModelWithReferences(model.getKey());
         modelWithReferences.setKeyInformation(model.getKeyInformation());
         modelWithReferences.setReferenceKeyList();
-        
+
         return modelWithReferences;
     }
 }
diff --git a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestApexTestModelCreator0.java b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestApexTestModelCreator0.java
index ff95837..a3d841a 100644
--- a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestApexTestModelCreator0.java
+++ b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestApexTestModelCreator0.java
@@ -36,7 +36,8 @@
         basicModel.setKeyInformation(new AxKeyInformation(new AxArtifactKey("KeyInfoMapKey", "0.0.1")));
 
         basicModel.getKeyInformation().getKeyInfoMap().put(basicModel.getKey(), new AxKeyInfo(basicModel.getKey()));
-        basicModel.getKeyInformation().getKeyInfoMap().put(basicModel.getKeyInformation().getKey(), new AxKeyInfo(basicModel.getKeyInformation().getKey()));
+        basicModel.getKeyInformation().getKeyInfoMap().put(basicModel.getKeyInformation().getKey(),
+                        new AxKeyInfo(basicModel.getKeyInformation().getKey()));
 
         return basicModel;
     }
diff --git a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestApexTestModelCreator1.java b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestApexTestModelCreator1.java
index d2aa738..cbbe05a 100644
--- a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestApexTestModelCreator1.java
+++ b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestApexTestModelCreator1.java
@@ -57,18 +57,12 @@
         basicModel.setKey(new AxArtifactKey("BasicModelKey", "0.0.1"));
         basicModel.setKeyInformation(new AxKeyInformation(new AxArtifactKey("KeyInfoMapKey", "0.0.1")));
 
-        basicModel.getKeyInformation().getKeyInfoMap().put(
-                basicModel.getKey(),
-                new AxKeyInfo(
-                        basicModel.getKey(),
+        basicModel.getKeyInformation().getKeyInfoMap().put(basicModel.getKey(), new AxKeyInfo(basicModel.getKey(),
                         UUID.fromString("00000000-0000-0000-0000-000000000000"),
                         "nbasic model description\nThis is a multi line description\nwith another line of text."));
-        basicModel.getKeyInformation().getKeyInfoMap().put(
-                basicModel.getKeyInformation().getKey(),
-                new AxKeyInfo(
-                        basicModel.getKeyInformation().getKey(),
-                        UUID.fromString("00000000-0000-0000-0000-000000000000"),
-                        ""));
+        basicModel.getKeyInformation().getKeyInfoMap().put(basicModel.getKeyInformation().getKey(),
+                        new AxKeyInfo(basicModel.getKeyInformation().getKey(),
+                                        UUID.fromString("00000000-0000-0000-0000-000000000000"), ""));
 
         return basicModel;
     }
diff --git a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestApexTestModelCreator2.java b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestApexTestModelCreator2.java
index 85751bf..a7b7786 100644
--- a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestApexTestModelCreator2.java
+++ b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestApexTestModelCreator2.java
@@ -36,7 +36,8 @@
         basicModel.setKeyInformation(new AxKeyInformation(new AxArtifactKey("KeyInfoMapKey", "0.0.1")));
 
         basicModel.getKeyInformation().getKeyInfoMap().put(basicModel.getKey(), new AxKeyInfo(basicModel.getKey()));
-        basicModel.getKeyInformation().getKeyInfoMap().put(basicModel.getKeyInformation().getKey(), new AxKeyInfo(basicModel.getKeyInformation().getKey()));
+        basicModel.getKeyInformation().getKeyInfoMap().put(basicModel.getKeyInformation().getKey(),
+                        new AxKeyInfo(basicModel.getKeyInformation().getKey()));
         basicModel.getKeyInformation().get("BasicModel").setDescription("");
         return basicModel;
     }
diff --git a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestBasicModelTest.java b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestBasicModelTest.java
index 9ddd3cc..9ced9d8 100644
--- a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestBasicModelTest.java
+++ b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestBasicModelTest.java
@@ -29,15 +29,12 @@
 import org.onap.policy.apex.model.basicmodel.concepts.AxModel;
 import org.onap.policy.apex.model.basicmodel.test.TestApexModel;
 
-/**
- * @author Liam Fallon (liam.fallon@ericsson.com)
- */
 public class TestBasicModelTest {
 
     @Test
     public void testNormalModelCreator() throws ApexException {
-        final TestApexModel<AxModel> testApexModel =
-                new TestApexModel<AxModel>(AxModel.class, new TestApexBasicModelCreator());
+        final TestApexModel<AxModel> testApexModel = new TestApexModel<AxModel>(AxModel.class,
+                        new TestApexBasicModelCreator());
 
         testApexModel.testApexModelValid();
         try {
@@ -50,14 +47,14 @@
         testApexModel.testApexModelVaidateInvalidModel();
         testApexModel.testApexModelVaidateMalstructured();
 
-        testApexModel.testApexModelWriteReadJSON();
-        testApexModel.testApexModelWriteReadXML();
+        testApexModel.testApexModelWriteReadJson();
+        testApexModel.testApexModelWriteReadXml();
     }
 
     @Test
     public void testModelCreator0() throws ApexException {
-        final TestApexModel<AxModel> testApexModel =
-                new TestApexModel<AxModel>(AxModel.class, new TestApexTestModelCreator0());
+        final TestApexModel<AxModel> testApexModel = new TestApexModel<AxModel>(AxModel.class,
+                        new TestApexTestModelCreator0());
 
         testApexModel.testApexModelValid();
         try {
@@ -88,8 +85,8 @@
 
     @Test
     public void testModelCreator1() throws ApexException {
-        final TestApexModel<AxModel> testApexModel =
-                new TestApexModel<AxModel>(AxModel.class, new TestApexTestModelCreator1());
+        final TestApexModel<AxModel> testApexModel = new TestApexModel<AxModel>(AxModel.class,
+                        new TestApexTestModelCreator1());
 
         try {
             testApexModel.testApexModelValid();
@@ -115,8 +112,8 @@
 
     @Test
     public void testModelCreator2() throws ApexException {
-        final TestApexModel<AxModel> testApexModel =
-                new TestApexModel<AxModel>(AxModel.class, new TestApexTestModelCreator2());
+        final TestApexModel<AxModel> testApexModel = new TestApexModel<AxModel>(AxModel.class,
+                        new TestApexTestModelCreator2());
 
         testApexModel.testApexModelValid();
         testApexModel.testApexModelVaidateObservation();
@@ -129,19 +126,19 @@
     }
 
     @Test
-    public void testModelCreator1XMLJSON() throws ApexException {
-        final TestApexModel<AxModel> testApexModel =
-                new TestApexModel<AxModel>(AxModel.class, new TestApexTestModelCreator1());
+    public void testModelCreator1XmlJson() throws ApexException {
+        final TestApexModel<AxModel> testApexModel = new TestApexModel<AxModel>(AxModel.class,
+                        new TestApexTestModelCreator1());
 
         try {
-            testApexModel.testApexModelWriteReadJSON();
+            testApexModel.testApexModelWriteReadJson();
             fail("Test should throw an exception");
         } catch (final Exception e) {
             assertTrue(e.getMessage().startsWith("error processing file"));
         }
 
         try {
-            testApexModel.testApexModelWriteReadXML();
+            testApexModel.testApexModelWriteReadXml();
             fail("Test should throw an exception");
         } catch (final Exception e) {
             assertTrue(e.getMessage().startsWith("error processing file"));
diff --git a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestConceptGetter.java b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestConceptGetter.java
index 83545bf..f95c0b4 100644
--- a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestConceptGetter.java
+++ b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestConceptGetter.java
@@ -37,37 +37,55 @@
 import org.onap.policy.apex.model.basicmodel.handling.ApexModelFileWriter;
 import org.onap.policy.apex.model.basicmodel.handling.ApexModelReader;
 
-/**
- * @author Liam Fallon (liam.fallon@ericsson.com)
- */
 public class TestConceptGetter {
 
     @Test
     public void testConceptGetter() throws IOException, ApexException {
         AxModel basicModel = new TestApexBasicModelCreator().getModel();
         assertNotNull(basicModel);
-       
-        AxKeyInfo intKI01 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey01", "0.0.1"), UUID.randomUUID(), "IntegerKIKey01 description");
-        AxKeyInfo intKI11 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey11", "0.0.1"), UUID.randomUUID(), "IntegerKIKey11 description");
-        AxKeyInfo intKI21 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey21", "0.0.1"), UUID.randomUUID(), "IntegerKIKey21 description");
-        AxKeyInfo intKI22 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey22", "0.0.2"), UUID.randomUUID(), "IntegerKIKey22 description");
-        AxKeyInfo intKI23 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey23", "0.0.3"), UUID.randomUUID(), "IntegerKIKey23 description");
-        AxKeyInfo intKI24 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey24", "0.0.4"), UUID.randomUUID(), "IntegerKIKey24 description");
-        AxKeyInfo intKI25 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey25", "0.0.5"), UUID.randomUUID(), "IntegerKIKey25 description");
-        AxKeyInfo intKI26 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey26", "0.0.6"), UUID.randomUUID(), "IntegerKIKey26 description");
-        AxKeyInfo intKI31 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey31", "0.0.1"), UUID.randomUUID(), "IntegerKIKey31 description");
-        AxKeyInfo intKI41 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey41", "0.0.1"), UUID.randomUUID(), "IntegerKIKey41 description");
-        AxKeyInfo intKI51 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey51", "0.0.1"), UUID.randomUUID(), "IntegerKIKey51 description");
-        AxKeyInfo intKI52 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey52", "0.0.2"), UUID.randomUUID(), "IntegerKIKey52 description");
-        AxKeyInfo intKI53 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey53", "0.0.3"), UUID.randomUUID(), "IntegerKIKey53 description");
-        AxKeyInfo intKI54 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey54", "0.0.4"), UUID.randomUUID(), "IntegerKIKey54 description");
-        AxKeyInfo intKI61 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey61", "0.0.1"), UUID.randomUUID(), "IntegerKIKey61 description");
-        AxKeyInfo intKI62 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey62", "0.0.2"), UUID.randomUUID(), "IntegerKIKey62 description");
-        AxKeyInfo intKI63 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey63", "0.0.3"), UUID.randomUUID(), "IntegerKIKey63 description");
-        AxKeyInfo intKI64 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey64", "0.0.4"), UUID.randomUUID(), "IntegerKIKey64 description");
-        AxKeyInfo intKI71 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey71", "0.0.1"), UUID.randomUUID(), "IntegerKIKey71 description");
-        AxKeyInfo intKI81 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey81", "0.0.1"), UUID.randomUUID(), "IntegerKIKey81 description");
-        AxKeyInfo intKI91 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey91", "0.0.1"), UUID.randomUUID(), "IntegerKIKey91 description");
+
+        AxKeyInfo intKI01 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey01", "0.0.1"), UUID.randomUUID(),
+                        "IntegerKIKey01 description");
+        AxKeyInfo intKI11 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey11", "0.0.1"), UUID.randomUUID(),
+                        "IntegerKIKey11 description");
+        AxKeyInfo intKI21 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey21", "0.0.1"), UUID.randomUUID(),
+                        "IntegerKIKey21 description");
+        AxKeyInfo intKI22 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey22", "0.0.2"), UUID.randomUUID(),
+                        "IntegerKIKey22 description");
+        AxKeyInfo intKI23 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey23", "0.0.3"), UUID.randomUUID(),
+                        "IntegerKIKey23 description");
+        AxKeyInfo intKI24 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey24", "0.0.4"), UUID.randomUUID(),
+                        "IntegerKIKey24 description");
+        AxKeyInfo intKI25 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey25", "0.0.5"), UUID.randomUUID(),
+                        "IntegerKIKey25 description");
+        AxKeyInfo intKI26 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey26", "0.0.6"), UUID.randomUUID(),
+                        "IntegerKIKey26 description");
+        AxKeyInfo intKI31 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey31", "0.0.1"), UUID.randomUUID(),
+                        "IntegerKIKey31 description");
+        AxKeyInfo intKI41 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey41", "0.0.1"), UUID.randomUUID(),
+                        "IntegerKIKey41 description");
+        AxKeyInfo intKI51 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey51", "0.0.1"), UUID.randomUUID(),
+                        "IntegerKIKey51 description");
+        AxKeyInfo intKI52 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey52", "0.0.2"), UUID.randomUUID(),
+                        "IntegerKIKey52 description");
+        AxKeyInfo intKI53 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey53", "0.0.3"), UUID.randomUUID(),
+                        "IntegerKIKey53 description");
+        AxKeyInfo intKI54 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey54", "0.0.4"), UUID.randomUUID(),
+                        "IntegerKIKey54 description");
+        AxKeyInfo intKI61 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey61", "0.0.1"), UUID.randomUUID(),
+                        "IntegerKIKey61 description");
+        AxKeyInfo intKI62 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey62", "0.0.2"), UUID.randomUUID(),
+                        "IntegerKIKey62 description");
+        AxKeyInfo intKI63 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey63", "0.0.3"), UUID.randomUUID(),
+                        "IntegerKIKey63 description");
+        AxKeyInfo intKI64 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey64", "0.0.4"), UUID.randomUUID(),
+                        "IntegerKIKey64 description");
+        AxKeyInfo intKI71 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey71", "0.0.1"), UUID.randomUUID(),
+                        "IntegerKIKey71 description");
+        AxKeyInfo intKI81 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey81", "0.0.1"), UUID.randomUUID(),
+                        "IntegerKIKey81 description");
+        AxKeyInfo intKI91 = new AxKeyInfo(new AxArtifactKey("IntegerKIKey91", "0.0.1"), UUID.randomUUID(),
+                        "IntegerKIKey91 description");
         basicModel.getKeyInformation().getKeyInfoMap().put(intKI31.getKey(), intKI31);
         basicModel.getKeyInformation().getKeyInfoMap().put(intKI24.getKey(), intKI24);
         basicModel.getKeyInformation().getKeyInfoMap().put(intKI11.getKey(), intKI11);
@@ -90,20 +108,34 @@
         basicModel.getKeyInformation().getKeyInfoMap().put(intKI61.getKey(), intKI61);
         basicModel.getKeyInformation().getKeyInfoMap().put(intKI63.getKey(), intKI63);
 
-        AxKeyInfo floatKI01 = new AxKeyInfo(new AxArtifactKey("FloatKIKey01", "0.0.1"), UUID.randomUUID(), "IntegerKIKey01 description");
-        AxKeyInfo floatKI11 = new AxKeyInfo(new AxArtifactKey("FloatKIKey11", "0.0.1"), UUID.randomUUID(), "IntegerKIKey11 description");
-        AxKeyInfo floatKI21 = new AxKeyInfo(new AxArtifactKey("FloatKIKey21", "0.0.1"), UUID.randomUUID(), "IntegerKIKey21 description");
-        AxKeyInfo floatKI31 = new AxKeyInfo(new AxArtifactKey("FloatKIKey31", "0.0.1"), UUID.randomUUID(), "IntegerKIKey31 description");
-        AxKeyInfo floatKI41 = new AxKeyInfo(new AxArtifactKey("FloatKIKey41", "0.0.1"), UUID.randomUUID(), "IntegerKIKey41 description");
-        AxKeyInfo floatKI51 = new AxKeyInfo(new AxArtifactKey("FloatKIKey51", "0.0.1"), UUID.randomUUID(), "IntegerKIKey51 description");
-        AxKeyInfo floatKI61 = new AxKeyInfo(new AxArtifactKey("FloatKIKey61", "0.0.1"), UUID.randomUUID(), "IntegerKIKey61 description");
-        AxKeyInfo floatKI71 = new AxKeyInfo(new AxArtifactKey("FloatKIKey71", "0.0.1"), UUID.randomUUID(), "IntegerKIKey71 description");
-        AxKeyInfo floatKI81 = new AxKeyInfo(new AxArtifactKey("FloatKIKey81", "0.0.1"), UUID.randomUUID(), "IntegerKIKey81 description");
-        AxKeyInfo floatKI82 = new AxKeyInfo(new AxArtifactKey("FloatKIKey82", "0.0.2"), UUID.randomUUID(), "IntegerKIKey82 description");
-        AxKeyInfo floatKI83 = new AxKeyInfo(new AxArtifactKey("FloatKIKey83", "0.0.3"), UUID.randomUUID(), "IntegerKIKey83 description");
-        AxKeyInfo floatKI91 = new AxKeyInfo(new AxArtifactKey("FloatKIKey91", "0.0.1"), UUID.randomUUID(), "IntegerKIKey91 description");
-        AxKeyInfo floatKI92 = new AxKeyInfo(new AxArtifactKey("FloatKIKey92", "0.0.2"), UUID.randomUUID(), "IntegerKIKey92 description");
-        AxKeyInfo floatKI93 = new AxKeyInfo(new AxArtifactKey("FloatKIKey93", "0.0.3"), UUID.randomUUID(), "IntegerKIKey93 description");
+        AxKeyInfo floatKI01 = new AxKeyInfo(new AxArtifactKey("FloatKIKey01", "0.0.1"), UUID.randomUUID(),
+                        "IntegerKIKey01 description");
+        AxKeyInfo floatKI11 = new AxKeyInfo(new AxArtifactKey("FloatKIKey11", "0.0.1"), UUID.randomUUID(),
+                        "IntegerKIKey11 description");
+        AxKeyInfo floatKI21 = new AxKeyInfo(new AxArtifactKey("FloatKIKey21", "0.0.1"), UUID.randomUUID(),
+                        "IntegerKIKey21 description");
+        AxKeyInfo floatKI31 = new AxKeyInfo(new AxArtifactKey("FloatKIKey31", "0.0.1"), UUID.randomUUID(),
+                        "IntegerKIKey31 description");
+        AxKeyInfo floatKI41 = new AxKeyInfo(new AxArtifactKey("FloatKIKey41", "0.0.1"), UUID.randomUUID(),
+                        "IntegerKIKey41 description");
+        AxKeyInfo floatKI51 = new AxKeyInfo(new AxArtifactKey("FloatKIKey51", "0.0.1"), UUID.randomUUID(),
+                        "IntegerKIKey51 description");
+        AxKeyInfo floatKI61 = new AxKeyInfo(new AxArtifactKey("FloatKIKey61", "0.0.1"), UUID.randomUUID(),
+                        "IntegerKIKey61 description");
+        AxKeyInfo floatKI71 = new AxKeyInfo(new AxArtifactKey("FloatKIKey71", "0.0.1"), UUID.randomUUID(),
+                        "IntegerKIKey71 description");
+        AxKeyInfo floatKI81 = new AxKeyInfo(new AxArtifactKey("FloatKIKey81", "0.0.1"), UUID.randomUUID(),
+                        "IntegerKIKey81 description");
+        AxKeyInfo floatKI82 = new AxKeyInfo(new AxArtifactKey("FloatKIKey82", "0.0.2"), UUID.randomUUID(),
+                        "IntegerKIKey82 description");
+        AxKeyInfo floatKI83 = new AxKeyInfo(new AxArtifactKey("FloatKIKey83", "0.0.3"), UUID.randomUUID(),
+                        "IntegerKIKey83 description");
+        AxKeyInfo floatKI91 = new AxKeyInfo(new AxArtifactKey("FloatKIKey91", "0.0.1"), UUID.randomUUID(),
+                        "IntegerKIKey91 description");
+        AxKeyInfo floatKI92 = new AxKeyInfo(new AxArtifactKey("FloatKIKey92", "0.0.2"), UUID.randomUUID(),
+                        "IntegerKIKey92 description");
+        AxKeyInfo floatKI93 = new AxKeyInfo(new AxArtifactKey("FloatKIKey93", "0.0.3"), UUID.randomUUID(),
+                        "IntegerKIKey93 description");
         basicModel.getKeyInformation().getKeyInfoMap().put(floatKI11.getKey(), floatKI11);
         basicModel.getKeyInformation().getKeyInfoMap().put(floatKI83.getKey(), floatKI83);
         basicModel.getKeyInformation().getKeyInfoMap().put(floatKI51.getKey(), floatKI51);
@@ -124,9 +156,9 @@
         assertTrue(basicModel.getKeyInformation().get("IntegerKIKey62", "0.0.2").equals(intKI62));
         assertTrue(basicModel.getKeyInformation().get("IntegerKIKey21", "0.0.1").equals(intKI21));
         assertTrue(basicModel.getKeyInformation().get("IntegerKIKey61", "0.0.1").equals(intKI61));
-       
+
         assertNull(basicModel.getKeyInformation().get("NonExistantKey"));
-       
+
         assertTrue(basicModel.getKeyInformation().get("IntegerKIKey01").equals(intKI01));
         assertTrue(basicModel.getKeyInformation().get("IntegerKIKey11").equals(intKI11));
         assertTrue(basicModel.getKeyInformation().get("IntegerKIKey26").equals(intKI26));
@@ -137,7 +169,7 @@
         assertTrue(basicModel.getKeyInformation().get("IntegerKIKey71").equals(intKI71));
         assertTrue(basicModel.getKeyInformation().get("IntegerKIKey81").equals(intKI81));
         assertTrue(basicModel.getKeyInformation().get("IntegerKIKey91").equals(intKI91));
-       
+
         assertTrue(basicModel.getKeyInformation().get("FloatKIKey01").equals(floatKI01));
         assertTrue(basicModel.getKeyInformation().get("FloatKIKey11").equals(floatKI11));
         assertTrue(basicModel.getKeyInformation().get("FloatKIKey21").equals(floatKI21));
@@ -149,23 +181,22 @@
         assertTrue(basicModel.getKeyInformation().get("FloatKIKey83").equals(floatKI83));
         assertTrue(basicModel.getKeyInformation().get("FloatKIKey93").equals(floatKI93));
 
-   
         // Ensure marshalling and unmarshalling is OK
         ApexModelReader<AxModel> modelReader = new ApexModelReader<AxModel>(AxModel.class);
         ApexModelFileWriter<AxModel> modelWriter = new ApexModelFileWriter<AxModel>(true);
-       
+
         modelReader.setValidateFlag(false);
         modelWriter.setValidateFlag(false);
-       
-        File tempXMLFile = File.createTempFile("ApexModel", "xml");
-        modelWriter.apexModelWriteJSONFile(basicModel, AxModel.class, tempXMLFile.getCanonicalPath());
-       
-        FileInputStream xmlFileInputStream = new FileInputStream(tempXMLFile);
-        AxModel readXMLModel = modelReader.read(xmlFileInputStream);
+
+        File tempXmlFile = File.createTempFile("ApexModel", "xml");
+        modelWriter.apexModelWriteJsonFile(basicModel, AxModel.class, tempXmlFile.getCanonicalPath());
+
+        FileInputStream xmlFileInputStream = new FileInputStream(tempXmlFile);
+        AxModel readXmlModel = modelReader.read(xmlFileInputStream);
         xmlFileInputStream.close();
-        assertTrue(basicModel.equals(readXMLModel));
-        assertTrue(readXMLModel.getKeyInformation().get("IntegerKIKey91").equals(intKI91));
-        assertNotNull(readXMLModel.getKeyInformation().get("FloatKIKey"));
-        tempXMLFile.delete();
+        assertTrue(basicModel.equals(readXmlModel));
+        assertTrue(readXmlModel.getKeyInformation().get("IntegerKIKey91").equals(intKI91));
+        assertNotNull(readXmlModel.getKeyInformation().get("FloatKIKey"));
+        tempXmlFile.delete();
     }
 }
diff --git a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestExceptions.java b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestExceptions.java
index 5c89227..8b0196b 100644
--- a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestExceptions.java
+++ b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestExceptions.java
@@ -28,9 +28,6 @@
 import org.junit.Test;
 import org.onap.policy.apex.model.basicmodel.handling.ApexModelException;
 
-/**
- * @author Liam Fallon (liam.fallon@ericsson.com)
- */
 public class TestExceptions {
 
     @Test
diff --git a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestModelFileWriter.java b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestModelFileWriter.java
index ec4d0a5..3e860e3 100644
--- a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestModelFileWriter.java
+++ b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestModelFileWriter.java
@@ -31,15 +31,10 @@
 import org.onap.policy.apex.model.basicmodel.concepts.AxModel;
 import org.onap.policy.apex.model.basicmodel.handling.ApexModelFileWriter;
 
-/**
- * @author Liam Fallon (liam.fallon@ericsson.com)
- */
 public class TestModelFileWriter {
 
     @Test
     public void testModelFileWriter() throws IOException, ApexException {
-        AxModel model = new TestApexBasicModelCreator().getModel();
-
         ApexModelFileWriter<AxModel> modelFileWriter = new ApexModelFileWriter<>(true);
 
         modelFileWriter.setValidateFlag(true);
@@ -52,9 +47,10 @@
         File jsonTempFile = new File(tempDir.getAbsolutePath() + "/aaa/ApexFileWriterTest.json");
         File xmlTempFile = new File(tempDir.getAbsolutePath() + "/ccc/ApexFileWriterTest.xml");
         
-        modelFileWriter.apexModelWriteJSONFile(model, AxModel.class, jsonTempFile.getAbsolutePath());
+        AxModel model = new TestApexBasicModelCreator().getModel();
 
-        modelFileWriter.apexModelWriteXMLFile(model, AxModel.class, xmlTempFile.getAbsolutePath());
+        modelFileWriter.apexModelWriteJsonFile(model, AxModel.class, jsonTempFile.getAbsolutePath());
+        modelFileWriter.apexModelWriteXmlFile(model, AxModel.class, xmlTempFile.getAbsolutePath());
         
         jsonTempFile.delete();
         xmlTempFile.delete();
@@ -64,8 +60,8 @@
         jsonTempFile = new File(tempDir.getAbsolutePath() + "/aaa/bbb/ApexFileWriterTest.json");
         xmlTempFile = new File(tempDir.getAbsolutePath() + "/ccc/ddd/ApexFileWriterTest.xml");
         
-        modelFileWriter.apexModelWriteJSONFile(model, AxModel.class, jsonTempFile.getAbsolutePath());
-        modelFileWriter.apexModelWriteXMLFile(model, AxModel.class, xmlTempFile.getAbsolutePath());
+        modelFileWriter.apexModelWriteJsonFile(model, AxModel.class, jsonTempFile.getAbsolutePath());
+        modelFileWriter.apexModelWriteXmlFile(model, AxModel.class, xmlTempFile.getAbsolutePath());
                 
         jsonTempFile.delete();
         xmlTempFile.delete();
@@ -84,7 +80,7 @@
         jsonTempFile = new File(tempDir.getAbsolutePath() + "/aaa/bbb/ApexFileWriterTest.xml");
 
         try {
-            modelFileWriter.apexModelWriteJSONFile(model, AxModel.class, jsonTempFile.getAbsolutePath());
+            modelFileWriter.apexModelWriteJsonFile(model, AxModel.class, jsonTempFile.getAbsolutePath());
             fail("this test should throw an exception here");
         }
         catch (Exception e) {
@@ -92,7 +88,7 @@
         }
 
         try {
-            modelFileWriter.apexModelWriteXMLFile(model, AxModel.class, jsonTempFile.getAbsolutePath());
+            modelFileWriter.apexModelWriteXmlFile(model, AxModel.class, jsonTempFile.getAbsolutePath());
             fail("this test should throw an exception here");
         }
         catch (Exception e) {
@@ -110,7 +106,7 @@
         jsonTempFile = new File(tempDir.getAbsolutePath() + "/aaa/bbb/ApexFileWriterTest.xml");
 
         try {
-            modelFileWriter.apexModelWriteJSONFile(model, AxModel.class, jsonTempFile.getAbsolutePath());
+            modelFileWriter.apexModelWriteJsonFile(model, AxModel.class, jsonTempFile.getAbsolutePath());
             fail("this test should throw an exception here");
         }
         catch (Exception e) {
@@ -118,7 +114,7 @@
         }
 
         try {
-            modelFileWriter.apexModelWriteXMLFile(model, AxModel.class, jsonTempFile.getAbsolutePath());
+            modelFileWriter.apexModelWriteXmlFile(model, AxModel.class, jsonTempFile.getAbsolutePath());
             fail("this test should throw an exception here");
         }
         catch (Exception e) {
diff --git a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestModelReader.java b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestModelReader.java
index 140817e..1695a0b 100644
--- a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestModelReader.java
+++ b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestModelReader.java
@@ -39,9 +39,6 @@
 import org.onap.policy.apex.model.basicmodel.handling.ApexModelReader;
 import org.onap.policy.apex.model.basicmodel.handling.ApexModelWriter;
 
-/**
- * @author Liam Fallon (liam.fallon@ericsson.com)
- */
 public class TestModelReader {
 
     @Test
@@ -87,12 +84,12 @@
         
         modelWriter.setJsonOutput(false);
         
-        ByteArrayOutputStream baosXML = new ByteArrayOutputStream();
-        modelWriter.write(model, baosXML);
+        ByteArrayOutputStream baosXml = new ByteArrayOutputStream();
+        modelWriter.write(model, baosXml);
         
-        ByteArrayInputStream baisXML = new ByteArrayInputStream(baosXML.toByteArray());
-        AxModel readModelXML = modelReader.read(baisXML);
-        assertEquals(model, readModelXML);
+        ByteArrayInputStream baisXml = new ByteArrayInputStream(baosXml.toByteArray());
+        AxModel readModelXml = modelReader.read(baisXml);
+        assertEquals(model, readModelXml);
         
         String dummyString = "SomeDummyText";
         ByteArrayInputStream baisDummy = new ByteArrayInputStream(dummyString.getBytes());
diff --git a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestModelSaver.java b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestModelSaver.java
index 08f123c..634a929 100644
--- a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestModelSaver.java
+++ b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestModelSaver.java
@@ -30,22 +30,20 @@
 import org.onap.policy.apex.model.basicmodel.concepts.AxModel;
 import org.onap.policy.apex.model.basicmodel.handling.ApexModelSaver;
 
-/**
- * @author Liam Fallon (liam.fallon@ericsson.com)
- */
 public class TestModelSaver {
 
     @Test
     public void testModelSaver() throws IOException, ApexException {
         AxModel model = new TestApexBasicModelCreator().getModel();
-        
+
         Path tempPath = Files.createTempDirectory("ApexTest");
-        
-        ApexModelSaver<AxModel> modelSaver = new ApexModelSaver<AxModel>(AxModel.class, model, tempPath.toAbsolutePath().toString());
-        
-        modelSaver.apexModelWriteXML();
-        modelSaver.apexModelWriteJSON();
-        
+
+        ApexModelSaver<AxModel> modelSaver = new ApexModelSaver<AxModel>(AxModel.class, model,
+                        tempPath.toAbsolutePath().toString());
+
+        modelSaver.apexModelWriteXml();
+        modelSaver.apexModelWriteJson();
+
         Files.deleteIfExists(new File(tempPath.toAbsolutePath() + "/BasicModel.json").toPath());
         Files.deleteIfExists(new File(tempPath.toAbsolutePath() + "/BasicModel.xml").toPath());
         Files.deleteIfExists(tempPath);
diff --git a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestModelStringWriter.java b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestModelStringWriter.java
index d2a5046..d187e55 100644
--- a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestModelStringWriter.java
+++ b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestModelStringWriter.java
@@ -33,9 +33,6 @@
 import org.onap.policy.apex.model.basicmodel.concepts.AxModel;
 import org.onap.policy.apex.model.basicmodel.handling.ApexModelStringWriter;
 
-/**
- * @author Liam Fallon (liam.fallon@ericsson.com)
- */
 public class TestModelStringWriter {
 
     @Test
@@ -43,23 +40,23 @@
         AxModel basicModel = new TestApexBasicModelCreator().getModel();
         assertNotNull(basicModel);
        
-        AxKeyInfo intKI   = basicModel.getKeyInformation().get("IntegerKIKey");
-        AxKeyInfo floatKI = basicModel.getKeyInformation().get("FloatKIKey");
+        AxKeyInfo intKeyInfo   = basicModel.getKeyInformation().get("IntegerKIKey");
+        AxKeyInfo floatKeyInfo = basicModel.getKeyInformation().get("FloatKIKey");
 
         // Ensure marshalling is OK
         ApexModelStringWriter<AxKeyInfo> stringWriter = new ApexModelStringWriter<AxKeyInfo>(true);
         
-        assertNotNull(stringWriter.writeJSONString(intKI,   AxKeyInfo.class));
-        assertNotNull(stringWriter.writeJSONString(floatKI, AxKeyInfo.class));
+        assertNotNull(stringWriter.writeJsonString(intKeyInfo,   AxKeyInfo.class));
+        assertNotNull(stringWriter.writeJsonString(floatKeyInfo, AxKeyInfo.class));
        
-        assertNotNull(stringWriter.writeString(intKI,   AxKeyInfo.class, true));
-        assertNotNull(stringWriter.writeString(floatKI, AxKeyInfo.class, true));
+        assertNotNull(stringWriter.writeString(intKeyInfo,   AxKeyInfo.class, true));
+        assertNotNull(stringWriter.writeString(floatKeyInfo, AxKeyInfo.class, true));
        
-        assertNotNull(stringWriter.writeString(intKI,   AxKeyInfo.class, false));
-        assertNotNull(stringWriter.writeString(floatKI, AxKeyInfo.class, false));
+        assertNotNull(stringWriter.writeString(intKeyInfo,   AxKeyInfo.class, false));
+        assertNotNull(stringWriter.writeString(floatKeyInfo, AxKeyInfo.class, false));
         
-        assertNotNull(stringWriter.writeXMLString(intKI,   AxKeyInfo.class));
-        assertNotNull(stringWriter.writeXMLString(floatKI, AxKeyInfo.class));
+        assertNotNull(stringWriter.writeXmlString(intKeyInfo,   AxKeyInfo.class));
+        assertNotNull(stringWriter.writeXmlString(floatKeyInfo, AxKeyInfo.class));
         
         try {
             stringWriter.writeString(null, AxKeyInfo.class, true);
@@ -78,7 +75,7 @@
         }
         
         try {
-            stringWriter.writeJSONString(null, AxKeyInfo.class);
+            stringWriter.writeJsonString(null, AxKeyInfo.class);
             fail("test should thrown an exception here");
         }
         catch (Exception e) {
@@ -86,7 +83,7 @@
         }
         
         try {
-            stringWriter.writeXMLString(null, AxKeyInfo.class);
+            stringWriter.writeXmlString(null, AxKeyInfo.class);
             fail("test should thrown an exception here");
         }
         catch (Exception e) {
diff --git a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestModelWriter.java b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestModelWriter.java
index 8e5af45..648194a 100644
--- a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestModelWriter.java
+++ b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestModelWriter.java
@@ -33,15 +33,10 @@
 import org.onap.policy.apex.model.basicmodel.concepts.AxModel;
 import org.onap.policy.apex.model.basicmodel.handling.ApexModelWriter;
 
-/**
- * @author Liam Fallon (liam.fallon@ericsson.com)
- */
 public class TestModelWriter {
 
     @Test
     public void testModelWriter() throws IOException, ApexException {
-        AxModel model = new TestApexBasicModelCreator().getModel();
-        
         ApexModelWriter<AxModel> modelWriter = new ApexModelWriter<AxModel>(AxModel.class);
         
         modelWriter.setValidateFlag(true);
@@ -56,6 +51,8 @@
         
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
 
+        AxModel model = new TestApexBasicModelCreator().getModel();
+        
         modelWriter.write(model, baos);
         modelWriter.setJsonOutput(true);
         modelWriter.write(model, baos);
diff --git a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestSchemaGenerator.java b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestSchemaGenerator.java
index cdf3b46..36e4125 100644
--- a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestSchemaGenerator.java
+++ b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/handling/TestSchemaGenerator.java
@@ -31,9 +31,6 @@
 
 import org.junit.Test;
 
-/**
- * @author Liam Fallon (liam.fallon@ericsson.com)
- */
 public class TestSchemaGenerator {
 
     @Test
@@ -83,7 +80,7 @@
 
         final File tempFile = File.createTempFile("ApexSchemaGeneratorTest", "xsd");
         final String[] args5 =
-                { "org.onap.policy.apex.model.basicmodel.concepts.AxModel", tempFile.getCanonicalPath() };
+            { "org.onap.policy.apex.model.basicmodel.concepts.AxModel", tempFile.getCanonicalPath() };
 
         ApexSchemaGenerator.main(args5);
         assertTrue(tempFile.length() > 100);
diff --git a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/service/TestModelService.java b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/service/TestModelService.java
index 9c20d83..4f05de1 100644
--- a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/service/TestModelService.java
+++ b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/service/TestModelService.java
@@ -29,9 +29,6 @@
 import org.onap.policy.apex.model.basicmodel.concepts.AxKeyInformation;
 import org.onap.policy.apex.model.basicmodel.handling.TestApexBasicModelCreator;
 
-/**
- * @author Liam Fallon (liam.fallon@ericsson.com)
- */
 public class TestModelService {
 
     @Test
@@ -42,13 +39,12 @@
         try {
             ModelService.getModel(AxKeyInformation.class);
         } catch (final Exception e) {
-            assertEquals(
-                    "Model for org.onap.policy.apex.model.basicmodel.concepts.AxKeyInformation not found in model service",
-                    e.getMessage());
+            assertEquals("Model for org.onap.policy.apex.model.basicmodel.concepts.AxKeyInformation "
+                            + "not found in model service", e.getMessage());
         }
 
         ModelService.registerModel(AxKeyInformation.class,
-                new TestApexBasicModelCreator().getModel().getKeyInformation());
+                        new TestApexBasicModelCreator().getModel().getKeyInformation());
         assertTrue(ModelService.existsModel(AxKeyInformation.class));
         assertNotNull(ModelService.getModel(AxKeyInformation.class));
 
@@ -58,13 +54,12 @@
         try {
             ModelService.getModel(AxKeyInformation.class);
         } catch (final Exception e) {
-            assertEquals(
-                    "Model for org.onap.policy.apex.model.basicmodel.concepts.AxKeyInformation not found in model service",
-                    e.getMessage());
+            assertEquals("Model for org.onap.policy.apex.model.basicmodel.concepts.AxKeyInformation "
+                            + "not found in model service", e.getMessage());
         }
 
         ModelService.registerModel(AxKeyInformation.class,
-                new TestApexBasicModelCreator().getModel().getKeyInformation());
+                        new TestApexBasicModelCreator().getModel().getKeyInformation());
         assertTrue(ModelService.existsModel(AxKeyInformation.class));
         assertNotNull(ModelService.getModel(AxKeyInformation.class));
 
@@ -73,9 +68,8 @@
         try {
             ModelService.getModel(AxKeyInformation.class);
         } catch (final Exception e) {
-            assertEquals(
-                    "Model for org.onap.policy.apex.model.basicmodel.concepts.AxKeyInformation not found in model service",
-                    e.getMessage());
+            assertEquals("Model for org.onap.policy.apex.model.basicmodel.concepts.AxKeyInformation "
+                            + "not found in model service", e.getMessage());
         }
 
     }
diff --git a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/xml/TestAxReferenceKeyAdapter.java b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/xml/TestAxReferenceKeyAdapter.java
index bde0956..a7773c3 100644
--- a/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/xml/TestAxReferenceKeyAdapter.java
+++ b/model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/xml/TestAxReferenceKeyAdapter.java
@@ -27,9 +27,6 @@
 import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey;
 import org.onap.policy.apex.model.basicmodel.xml.AxReferenceKeyAdapter;
 
-/**
- * @author Liam Fallon (liam.fallon@ericsson.com)
- */
 public class TestAxReferenceKeyAdapter {
 
     @Test
@@ -37,10 +34,10 @@
         AxReferenceKeyAdapter arka = new AxReferenceKeyAdapter();
         assertNotNull(arka);
         
-        AxReferenceKey rKey = new AxReferenceKey("Name", "0.0.1", "PLN", "LN");
+        AxReferenceKey rkey = new AxReferenceKey("Name", "0.0.1", "PLN", "LN");
         
-        String rKeyString = arka.marshal(rKey);
-        assertEquals("LN", rKeyString);
-        assertEquals(rKey.getLocalName(),arka.unmarshal(rKeyString).getLocalName());
+        String rkeyString = arka.marshal(rkey);
+        assertEquals("LN", rkeyString);
+        assertEquals(rkey.getLocalName(),arka.unmarshal(rkeyString).getLocalName());
     }
 }
diff --git a/model/basic-model/src/test/resources/META-INF/persistence.xml b/model/basic-model/src/test/resources/META-INF/persistence.xml
index a7bf1f6..ffc6526 100644
--- a/model/basic-model/src/test/resources/META-INF/persistence.xml
+++ b/model/basic-model/src/test/resources/META-INF/persistence.xml
@@ -20,11 +20,11 @@
 -->
 
 <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0">
-    <persistence-unit name="DAOTest" transaction-type="RESOURCE_LOCAL">
+    <persistence-unit name="DaoTest" transaction-type="RESOURCE_LOCAL">
         <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
 
-        <class>org.onap.policy.apex.model.basicmodel.dao.converters.CDATAConditioner</class>
-        <class>org.onap.policy.apex.model.basicmodel.dao.converters.UUID2String</class>
+        <class>org.onap.policy.apex.model.basicmodel.dao.converters.CDataConditioner</class>
+        <class>org.onap.policy.apex.model.basicmodel.dao.converters.Uuid2String</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxKeyInfo</class>
diff --git a/model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextSchema.java b/model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextSchema.java
index 3abcebe..bf8289e 100644
--- a/model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextSchema.java
+++ b/model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextSchema.java
@@ -40,7 +40,7 @@
 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationMessage;
 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult.ValidationResult;
-import org.onap.policy.apex.model.basicmodel.dao.converters.CDATAConditioner;
+import org.onap.policy.apex.model.basicmodel.dao.converters.CDataConditioner;
 import org.onap.policy.apex.model.utilities.Assertions;
 
 /**
@@ -93,8 +93,8 @@
     private String schemaFlavour;
 
     @Column(name = "schemaDefinition", length = MAX_SCHEMA_SIZE)
-    @Convert(converter = CDATAConditioner.class)
-    @XmlJavaTypeAdapter(value = CDATAConditioner.class)
+    @Convert(converter = CDataConditioner.class)
+    @XmlJavaTypeAdapter(value = CDataConditioner.class)
     @XmlElement(name = "schemaDefinition", required = true)
     private String schemaDefinition;
 
@@ -343,8 +343,8 @@
         if (!schemaFlavour.equals(other.schemaFlavour)) {
             return false;
         }
-        final String thisSchema = CDATAConditioner.clean(schemaDefinition).replaceAll("\n", "");
-        final String otherSchema = CDATAConditioner.clean(other.schemaDefinition).replaceAll("\n", "");
+        final String thisSchema = CDataConditioner.clean(schemaDefinition).replaceAll("\n", "");
+        final String otherSchema = CDataConditioner.clean(other.schemaDefinition).replaceAll("\n", "");
         return thisSchema.equals(otherSchema);
     }
 
@@ -372,8 +372,8 @@
         if (!schemaFlavour.equals(other.schemaFlavour)) {
             return schemaFlavour.compareTo(other.schemaFlavour);
         }
-        final String thisSchema = CDATAConditioner.clean(schemaDefinition).replaceAll("\n", "");
-        final String otherSchema = CDATAConditioner.clean(other.schemaDefinition).replaceAll("\n", "");
+        final String thisSchema = CDataConditioner.clean(schemaDefinition).replaceAll("\n", "");
+        final String otherSchema = CDataConditioner.clean(other.schemaDefinition).replaceAll("\n", "");
         return thisSchema.compareTo(otherSchema);
     }
 }
diff --git a/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/TestContextAlbums.java b/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/TestContextAlbums.java
index 710c44e..839e198 100644
--- a/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/TestContextAlbums.java
+++ b/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/TestContextAlbums.java
@@ -53,8 +53,8 @@
 
         final AxArtifactKey newKey = new AxArtifactKey("NewAlbumName", "0.0.1");
         album.setKey(newKey);
-        assertEquals("NewAlbumName:0.0.1", album.getKey().getID());
-        assertEquals("NewAlbumName:0.0.1", album.getKeys().get(0).getID());
+        assertEquals("NewAlbumName:0.0.1", album.getKey().getId());
+        assertEquals("NewAlbumName:0.0.1", album.getKeys().get(0).getId());
         album.setKey(albumKey);
 
         try {
@@ -74,7 +74,7 @@
 
         final AxArtifactKey newSchemaKey = new AxArtifactKey("NewAlbumSchemaName", "0.0.1");
         album.setItemSchema(newSchemaKey);
-        assertEquals("NewAlbumSchemaName:0.0.1", album.getItemSchema().getID());
+        assertEquals("NewAlbumSchemaName:0.0.1", album.getItemSchema().getId());
         album.setItemSchema(albumSchemaKey);
 
         AxValidationResult result = new AxValidationResult();
diff --git a/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/TestContextSchemas.java b/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/TestContextSchemas.java
index e9e9564..02dfd6f 100644
--- a/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/TestContextSchemas.java
+++ b/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/TestContextSchemas.java
@@ -50,8 +50,8 @@
 
         final AxArtifactKey newKey = new AxArtifactKey("NewSchemaName", "0.0.1");
         schema.setKey(newKey);
-        assertEquals("NewSchemaName:0.0.1", schema.getKey().getID());
-        assertEquals("NewSchemaName:0.0.1", schema.getKeys().get(0).getID());
+        assertEquals("NewSchemaName:0.0.1", schema.getKey().getId());
+        assertEquals("NewSchemaName:0.0.1", schema.getKeys().get(0).getId());
 
         try {
             schema.setSchemaFlavour("");
diff --git a/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/handling/TestApexContextModel.java b/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/handling/TestApexContextModel.java
index 477755c..10609ec 100644
--- a/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/handling/TestApexContextModel.java
+++ b/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/handling/TestApexContextModel.java
@@ -30,7 +30,7 @@
 import org.junit.Before;
 import org.junit.Test;
 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
-import org.onap.policy.apex.model.basicmodel.dao.DAOParameters;
+import org.onap.policy.apex.model.basicmodel.dao.DaoParameters;
 import org.onap.policy.apex.model.basicmodel.test.TestApexModel;
 import org.onap.policy.apex.model.contextmodel.concepts.AxContextModel;
 
@@ -84,21 +84,21 @@
 
     @Test
     public void testModelWriteReadXML() throws Exception {
-        testApexModel.testApexModelWriteReadXML();
+        testApexModel.testApexModelWriteReadXml();
     }
 
     @Test
     public void testModelWriteReadJSON() throws Exception {
-        testApexModel.testApexModelWriteReadJSON();
+        testApexModel.testApexModelWriteReadJson();
     }
 
     @Test
     public void testModelWriteReadJPA() throws Exception {
-        final DAOParameters daoParameters = new DAOParameters();
-        daoParameters.setPluginClass("org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao");
-        daoParameters.setPersistenceUnit("DAOTest");
+        final DaoParameters DaoParameters = new DaoParameters();
+        DaoParameters.setPluginClass("org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao");
+        DaoParameters.setPersistenceUnit("DAOTest");
 
-        testApexModel.testApexModelWriteReadJPA(daoParameters);
+        testApexModel.testApexModelWriteReadJpa(DaoParameters);
     }
 
     private static final String VALID_MODEL_STRING = "***validation of model successful***";
diff --git a/model/context-model/src/test/resources/META-INF/persistence.xml b/model/context-model/src/test/resources/META-INF/persistence.xml
index ec93578..b7911ca 100644
--- a/model/context-model/src/test/resources/META-INF/persistence.xml
+++ b/model/context-model/src/test/resources/META-INF/persistence.xml
@@ -23,8 +23,8 @@
     <persistence-unit name="DAOTest" transaction-type="RESOURCE_LOCAL">
         <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
 
-        <class>org.onap.policy.apex.model.basicmodel.dao.converters.CDATAConditioner</class>
-        <class>org.onap.policy.apex.model.basicmodel.dao.converters.UUID2String</class>
+        <class>org.onap.policy.apex.model.basicmodel.dao.converters.CDataConditioner</class>
+        <class>org.onap.policy.apex.model.basicmodel.dao.converters.Uuid2String</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxConcept</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxKeyInfo</class>
diff --git a/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/concepts/TestEngineModel.java b/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/concepts/TestEngineModel.java
index 8653046..79537cf 100644
--- a/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/concepts/TestEngineModel.java
+++ b/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/concepts/TestEngineModel.java
@@ -70,8 +70,8 @@
         }
 
         model.setKey(modelKey);
-        assertEquals("ModelName:0.0.1", model.getKey().getID());
-        assertEquals("ModelName:0.0.1", model.getKeys().get(0).getID());
+        assertEquals("ModelName:0.0.1", model.getKey().getId());
+        assertEquals("ModelName:0.0.1", model.getKeys().get(0).getId());
 
         final long timestamp = System.currentTimeMillis();
         model.setTimestamp(timestamp);
diff --git a/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/concepts/TestEngineStats.java b/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/concepts/TestEngineStats.java
index 1cbe193..6346e59 100644
--- a/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/concepts/TestEngineStats.java
+++ b/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/concepts/TestEngineStats.java
@@ -54,8 +54,8 @@
         }
 
         stats.setKey(statsKey);
-        assertEquals("EngineKey:0.0.1:NULL:EngineStats", stats.getKey().getID());
-        assertEquals("EngineKey:0.0.1:NULL:EngineStats", stats.getKeys().get(0).getID());
+        assertEquals("EngineKey:0.0.1:NULL:EngineStats", stats.getKey().getId());
+        assertEquals("EngineKey:0.0.1:NULL:EngineStats", stats.getKeys().get(0).getId());
 
         stats.setAverageExecutionTime(123.45);
         assertEquals(new Double(123.45), new Double(stats.getAverageExecutionTime()));
diff --git a/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/handling/TestApexEngineModel.java b/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/handling/TestApexEngineModel.java
index c1e6f3f..c8076aa 100644
--- a/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/handling/TestApexEngineModel.java
+++ b/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/handling/TestApexEngineModel.java
@@ -30,7 +30,7 @@
 import org.junit.Before;
 import org.junit.Test;
 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
-import org.onap.policy.apex.model.basicmodel.dao.DAOParameters;
+import org.onap.policy.apex.model.basicmodel.dao.DaoParameters;
 import org.onap.policy.apex.model.basicmodel.test.TestApexModel;
 import org.onap.policy.apex.model.enginemodel.concepts.AxEngineModel;
 
@@ -72,21 +72,21 @@
 
     @Test
     public void testModelWriteReadXML() throws Exception {
-        testApexModel.testApexModelWriteReadXML();
+        testApexModel.testApexModelWriteReadXml();
     }
 
     @Test
     public void testModelWriteReadJSON() throws Exception {
-        testApexModel.testApexModelWriteReadJSON();
+        testApexModel.testApexModelWriteReadJson();
     }
 
     @Test
     public void testModelWriteReadJPA() throws Exception {
-        final DAOParameters daoParameters = new DAOParameters();
-        daoParameters.setPluginClass("org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao");
-        daoParameters.setPersistenceUnit("DAOTest");
+        final DaoParameters DaoParameters = new DaoParameters();
+        DaoParameters.setPluginClass("org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao");
+        DaoParameters.setPersistenceUnit("DAOTest");
 
-        testApexModel.testApexModelWriteReadJPA(daoParameters);
+        testApexModel.testApexModelWriteReadJpa(DaoParameters);
     }
 
     private static final String VALID_MODEL_STRING = "***validation of model successful***";
diff --git a/model/engine-model/src/test/resources/META-INF/persistence.xml b/model/engine-model/src/test/resources/META-INF/persistence.xml
index 717d1a5..a157cf3 100644
--- a/model/engine-model/src/test/resources/META-INF/persistence.xml
+++ b/model/engine-model/src/test/resources/META-INF/persistence.xml
@@ -23,8 +23,8 @@
     <persistence-unit name="DAOTest" transaction-type="RESOURCE_LOCAL">
         <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
 
-        <class>org.onap.policy.apex.model.basicmodel.dao.converters.CDATAConditioner</class>
-        <class>org.onap.policy.apex.model.basicmodel.dao.converters.UUID2String</class>
+        <class>org.onap.policy.apex.model.basicmodel.dao.converters.CDataConditioner</class>
+        <class>org.onap.policy.apex.model.basicmodel.dao.converters.Uuid2String</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxConcept</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxKeyInfo</class>
diff --git a/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/TestEvents.java b/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/TestEvents.java
index 5456dfa..309359f 100644
--- a/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/TestEvents.java
+++ b/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/TestEvents.java
@@ -60,8 +60,8 @@
 
         final AxArtifactKey eventKey = new AxArtifactKey("EventName", "0.0.1");
         event.setKey(eventKey);
-        assertEquals("EventName:0.0.1", event.getKey().getID());
-        assertEquals("EventName:0.0.1", event.getKeys().get(0).getID());
+        assertEquals("EventName:0.0.1", event.getKey().getId());
+        assertEquals("EventName:0.0.1", event.getKeys().get(0).getId());
 
         event.setNameSpace("namespace");
         assertEquals("namespace", event.getNameSpace());
@@ -86,13 +86,13 @@
 
         final AxArtifactKey newEventKey = new AxArtifactKey("NewEventName", "0.0.1");
         event.setKey(newEventKey);
-        assertEquals("NewEventName:0.0.1", event.getKey().getID());
-        assertEquals("NewEventName:0.0.1", event.getKeys().get(0).getID());
+        assertEquals("NewEventName:0.0.1", event.getKey().getId());
+        assertEquals("NewEventName:0.0.1", event.getKeys().get(0).getId());
         assertEquals("NewEventName:0.0.1",
-                event.getParameterMap().get("Field0").getKey().getParentArtifactKey().getID());
+                event.getParameterMap().get("Field0").getKey().getParentArtifactKey().getId());
         event.setKey(eventKey);
-        assertEquals("EventName:0.0.1", event.getKey().getID());
-        assertEquals("EventName:0.0.1", event.getKeys().get(0).getID());
+        assertEquals("EventName:0.0.1", event.getKey().getId());
+        assertEquals("EventName:0.0.1", event.getKeys().get(0).getId());
 
         assertTrue("Field0", event.getFields().contains(eventField));
         assertTrue(event.hasFields(new TreeSet<AxField>(parameterMap.values())));
@@ -223,7 +223,7 @@
 
         // Invalid, no events in event map
         events.setKey(new AxArtifactKey("EventsKey", "0.0.1"));
-        assertEquals("EventsKey:0.0.1", events.getKey().getID());
+        assertEquals("EventsKey:0.0.1", events.getKey().getId());
 
         result = new AxValidationResult();
         result = events.validate(result);
diff --git a/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/TestField.java b/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/TestField.java
index 11b8b74..8d2e8a6 100644
--- a/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/TestField.java
+++ b/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/TestField.java
@@ -68,12 +68,12 @@
 
         final AxReferenceKey fieldKey = new AxReferenceKey("FieldName", "0.0.1", "PLN", "LN");
         field.setKey(fieldKey);
-        assertEquals("FieldName:0.0.1:PLN:LN", field.getKey().getID());
-        assertEquals("FieldName:0.0.1:PLN:LN", field.getKeys().get(0).getID());
+        assertEquals("FieldName:0.0.1:PLN:LN", field.getKey().getId());
+        assertEquals("FieldName:0.0.1:PLN:LN", field.getKeys().get(0).getId());
 
         final AxArtifactKey schemaKey = new AxArtifactKey("SchemaName", "0.0.1");
         field.setSchema(schemaKey);
-        assertEquals("SchemaName:0.0.1", field.getSchema().getID());
+        assertEquals("SchemaName:0.0.1", field.getSchema().getId());
 
         assertEquals(false, field.getOptional());
         field.setOptional(true);
diff --git a/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/handling/TestApexEventModel.java b/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/handling/TestApexEventModel.java
index ee2638a..abb3a34 100644
--- a/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/handling/TestApexEventModel.java
+++ b/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/handling/TestApexEventModel.java
@@ -30,7 +30,7 @@
 import org.junit.Before;
 import org.junit.Test;
 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
-import org.onap.policy.apex.model.basicmodel.dao.DAOParameters;
+import org.onap.policy.apex.model.basicmodel.dao.DaoParameters;
 import org.onap.policy.apex.model.basicmodel.test.TestApexModel;
 import org.onap.policy.apex.model.eventmodel.concepts.AxEventModel;
 
@@ -84,21 +84,21 @@
 
     @Test
     public void testModelWriteReadXML() throws Exception {
-        testApexModel.testApexModelWriteReadXML();
+        testApexModel.testApexModelWriteReadXml();
     }
 
     @Test
     public void testModelWriteReadJSON() throws Exception {
-        testApexModel.testApexModelWriteReadJSON();
+        testApexModel.testApexModelWriteReadJson();
     }
 
     @Test
     public void testModelWriteReadJPA() throws Exception {
-        final DAOParameters daoParameters = new DAOParameters();
-        daoParameters.setPluginClass("org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao");
-        daoParameters.setPersistenceUnit("DAOTest");
+        final DaoParameters DaoParameters = new DaoParameters();
+        DaoParameters.setPluginClass("org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao");
+        DaoParameters.setPersistenceUnit("DAOTest");
 
-        testApexModel.testApexModelWriteReadJPA(daoParameters);
+        testApexModel.testApexModelWriteReadJpa(DaoParameters);
     }
 
     private static final String VALID_MODEL_STRING = "***validation of model successful***";
diff --git a/model/event-model/src/test/resources/META-INF/persistence.xml b/model/event-model/src/test/resources/META-INF/persistence.xml
index db32612..9e61cbd 100644
--- a/model/event-model/src/test/resources/META-INF/persistence.xml
+++ b/model/event-model/src/test/resources/META-INF/persistence.xml
@@ -23,8 +23,8 @@
     <persistence-unit name="DAOTest" transaction-type="RESOURCE_LOCAL">
         <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
 
-        <class>org.onap.policy.apex.model.basicmodel.dao.converters.CDATAConditioner</class>
-        <class>org.onap.policy.apex.model.basicmodel.dao.converters.UUID2String</class>
+        <class>org.onap.policy.apex.model.basicmodel.dao.converters.CDataConditioner</class>
+        <class>org.onap.policy.apex.model.basicmodel.dao.converters.Uuid2String</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxConcept</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxKeyInfo</class>
diff --git a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/ApexModel.java b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/ApexModel.java
index c9190b8..8b4d4a9 100644
--- a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/ApexModel.java
+++ b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/ApexModel.java
@@ -20,7 +20,7 @@
 
 package org.onap.policy.apex.model.modelapi;
 
-import org.onap.policy.apex.model.basicmodel.dao.DAOParameters;
+import org.onap.policy.apex.model.basicmodel.dao.DaoParameters;
 import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
 
 /**
@@ -67,18 +67,18 @@
      * @param modelName the name of the model to load
      * @param modelVersion the version of the model to load, loads the policy model from the database with this name, if more than one exist, an exception is
      *            thrown
-     * @param daoParameters the parameters to use to access the database over JDBC
+     * @param DaoParameters the parameters to use to access the database over JDBC
      * @return the result of the operation
      */
-    ApexAPIResult loadFromDatabase(String modelName, String modelVersion, DAOParameters daoParameters);
+    ApexAPIResult loadFromDatabase(String modelName, String modelVersion, DaoParameters DaoParameters);
 
     /**
      * Save an Apex model to a database.
      *
-     * @param daoParameters the parameters to use to access the database over JDBC
+     * @param DaoParameters the parameters to use to access the database over JDBC
      * @return the result of the operation
      */
-    ApexAPIResult saveToDatabase(DAOParameters daoParameters);
+    ApexAPIResult saveToDatabase(DaoParameters DaoParameters);
 
     /**
      * Read an APEX model from a location identified by a URL.
diff --git a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ApexModelImpl.java b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ApexModelImpl.java
index 738178d..429d3c6 100644
--- a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ApexModelImpl.java
+++ b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ApexModelImpl.java
@@ -22,7 +22,7 @@
 
 import java.util.Properties;
 
-import org.onap.policy.apex.model.basicmodel.dao.DAOParameters;
+import org.onap.policy.apex.model.basicmodel.dao.DaoParameters;
 import org.onap.policy.apex.model.modelapi.ApexAPIResult;
 import org.onap.policy.apex.model.modelapi.ApexModel;
 import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
@@ -1054,23 +1054,23 @@
      * (non-Javadoc)
      *
      * @see org.onap.policy.apex.model.modelapi.ApexModel#loadFromDatabase(java.lang.String,
-     * java.lang.String, org.onap.policy.apex.model.basicmodel.dao.DAOParameters)
+     * java.lang.String, org.onap.policy.apex.model.basicmodel.dao.DaoParameters)
      */
     @Override
     public ApexAPIResult loadFromDatabase(final String modelName, final String modelVersion,
-            final DAOParameters daoParameters) {
-        return modelHandlerFacade.loadFromDatabase(modelName, modelVersion, daoParameters);
+            final DaoParameters DaoParameters) {
+        return modelHandlerFacade.loadFromDatabase(modelName, modelVersion, DaoParameters);
     }
 
     /*
      * (non-Javadoc)
      *
      * @see org.onap.policy.apex.model.modelapi.ApexModel#saveToDatabase(org.onap.policy.apex.model.
-     * basicmodel. dao.DAOParameters)
+     * basicmodel. dao.DaoParameters)
      */
     @Override
-    public ApexAPIResult saveToDatabase(final DAOParameters daoParameters) {
-        return modelHandlerFacade.saveToDatabase(daoParameters);
+    public ApexAPIResult saveToDatabase(final DaoParameters DaoParameters) {
+        return modelHandlerFacade.saveToDatabase(DaoParameters);
     }
 
     /*
diff --git a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ContextAlbumFacade.java b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ContextAlbumFacade.java
index afd518d..8402425 100644
--- a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ContextAlbumFacade.java
+++ b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ContextAlbumFacade.java
@@ -100,7 +100,7 @@
 
             if (apexModel.getPolicyModel().getAlbums().getAlbumsMap().containsKey(key)) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS,
-                        CONCEPT + key.getID() + " already exists");
+                        CONCEPT + key.getId() + " already exists");
             }
 
             final AxContextSchema schema =
@@ -229,7 +229,7 @@
                     return new ApexAPIResult();
                 } else {
                     return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                            CONCEPT + key.getID() + DOES_NOT_EXIST);
+                            CONCEPT + key.getId() + DOES_NOT_EXIST);
                 }
             }
 
diff --git a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ContextSchemaFacade.java b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ContextSchemaFacade.java
index 3f7f756..620f229 100644
--- a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ContextSchemaFacade.java
+++ b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ContextSchemaFacade.java
@@ -96,7 +96,7 @@
             }
 
             if (apexModel.getPolicyModel().getSchemas().getSchemasMap().containsKey(key)) {
-                return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, CONCEPT + key.getID() + ALREADY_EXISTS);
+                return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, CONCEPT + key.getId() + ALREADY_EXISTS);
             }
 
             apexModel.getPolicyModel().getSchemas().getSchemasMap().put(key, new AxContextSchema(key, schemaFlavour, schemaDefinition));
@@ -189,7 +189,7 @@
                             new ApexModelStringWriter<AxContextSchema>(false).writeString(removedSchema, AxContextSchema.class, jsonMode));
                 }
                 else {
-                    return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, CONCEPT + key.getID() + DOES_NOT_EXIST);
+                    return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, CONCEPT + key.getId() + DOES_NOT_EXIST);
                 }
             }
 
diff --git a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/EventFacade.java b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/EventFacade.java
index 095d4f9..4706ff7 100644
--- a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/EventFacade.java
+++ b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/EventFacade.java
@@ -99,7 +99,7 @@
             }
 
             if (apexModel.getPolicyModel().getEvents().getEventMap().containsKey(key)) {
-                return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, CONCEPT + key.getID() + ALREADY_EXISTS);
+                return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, CONCEPT + key.getId() + ALREADY_EXISTS);
             }
 
             final AxEvent event = new AxEvent(key);
@@ -200,7 +200,7 @@
                             .writeString(removedEvent, AxEvent.class, jsonMode));
                 } else {
                     return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                            CONCEPT + key.getID() + DOES_NOT_EXIST);
+                            CONCEPT + key.getId() + DOES_NOT_EXIST);
                 }
             }
 
@@ -278,7 +278,7 @@
 
             if (event.getParameterMap().containsKey(refKey.getLocalName())) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS,
-                        CONCEPT + refKey.getID() + ALREADY_EXISTS);
+                        CONCEPT + refKey.getId() + ALREADY_EXISTS);
             }
 
             final AxContextSchema schema =
@@ -323,7 +323,7 @@
             } else {
                 if (event.getParameterMap().size() == 0) {
                     return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                            "no parameters defined on event " + event.getKey().getID());
+                            "no parameters defined on event " + event.getKey().getId());
                 }
 
                 final ApexAPIResult result = new ApexAPIResult();
@@ -368,7 +368,7 @@
             } else {
                 if (event.getParameterMap().size() == 0) {
                     return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                            "no parameters defined on event " + event.getKey().getID());
+                            "no parameters defined on event " + event.getKey().getId());
                 }
 
                 for (final AxField eventPar : event.getParameterMap().values()) {
diff --git a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/KeyInformationFacade.java b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/KeyInformationFacade.java
index d9b9cef..e3e3db0 100644
--- a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/KeyInformationFacade.java
+++ b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/KeyInformationFacade.java
@@ -88,7 +88,7 @@
             }
 
             if (apexModel.getPolicyModel().getKeyInformation().getKeyInfoMap().containsKey(key)) {
-                return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, CONCEPT + key.getID() + ALREADY_EXISTS);
+                return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, CONCEPT + key.getId() + ALREADY_EXISTS);
             }
 
             final AxKeyInfo keyInfo = new AxKeyInfo(key);
@@ -99,7 +99,7 @@
                 keyInfo.setUuid(UUID.fromString(uuid));
             } else {
                 // generate a reproducible UUID
-                keyInfo.setUuid(AxKeyInfo.generateReproducibleUUID(keyInfo.getID() + keyInfo.getDescription()));
+                keyInfo.setUuid(AxKeyInfo.generateReproducibleUuid(keyInfo.getId() + keyInfo.getDescription()));
             }
             apexModel.getPolicyModel().getKeyInformation().getKeyInfoMap().put(key, keyInfo);
             return new ApexAPIResult();
@@ -135,7 +135,7 @@
                 keyInfo.setUuid(UUID.fromString(uuid));
             } else {
                 // generate a reproducible UUID
-                keyInfo.setUuid(AxKeyInfo.generateReproducibleUUID(keyInfo.getID() + keyInfo.getDescription()));
+                keyInfo.setUuid(AxKeyInfo.generateReproducibleUuid(keyInfo.getId() + keyInfo.getDescription()));
             }
 
             return new ApexAPIResult();
@@ -190,7 +190,7 @@
                             .writeString(removedKeyInfo, AxKeyInfo.class, jsonMode));
                 } else {
                     return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                            CONCEPT + key.getID() + DOES_NOT_EXIST);
+                            CONCEPT + key.getId() + DOES_NOT_EXIST);
                 }
             }
 
diff --git a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ModelFacade.java b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ModelFacade.java
index 2a6dd3e..65be2ae 100644
--- a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ModelFacade.java
+++ b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ModelFacade.java
@@ -98,7 +98,7 @@
 
             if (!apexModel.getPolicyModel().getKey().equals(AxArtifactKey.getNullKey())) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS,
-                        CONCEPT + apexModel.getPolicyModel().getKey().getID() + ALREADY_CREATED);
+                        CONCEPT + apexModel.getPolicyModel().getKey().getId() + ALREADY_CREATED);
             }
 
             apexModel.setPolicyModel(new AxPolicyModel(key));
@@ -137,13 +137,13 @@
                     key.setVersion(defaultVersion);
                 } else {
                     return new ApexAPIResult(ApexAPIResult.RESULT.FAILED,
-                            CONCEPT + apexModel.getPolicyModel().getKey().getID() + NO_VERSION_SPECIFIED);
+                            CONCEPT + apexModel.getPolicyModel().getKey().getId() + NO_VERSION_SPECIFIED);
                 }
             }
 
             if (apexModel.getPolicyModel().getKey().equals(AxArtifactKey.getNullKey())) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                        CONCEPT + apexModel.getPolicyModel().getKey().getID() + DOES_NOT_EXIST);
+                        CONCEPT + apexModel.getPolicyModel().getKey().getId() + DOES_NOT_EXIST);
             }
 
             return keyInformationFacade.updateKeyInformation(name, version, uuid, description);
diff --git a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ModelHandlerFacade.java b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ModelHandlerFacade.java
index b422d84..5e54744 100644
--- a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ModelHandlerFacade.java
+++ b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/ModelHandlerFacade.java
@@ -39,7 +39,7 @@
 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
 import org.onap.policy.apex.model.basicmodel.dao.ApexDao;
 import org.onap.policy.apex.model.basicmodel.dao.ApexDaoFactory;
-import org.onap.policy.apex.model.basicmodel.dao.DAOParameters;
+import org.onap.policy.apex.model.basicmodel.dao.DaoParameters;
 import org.onap.policy.apex.model.basicmodel.handling.ApexModelException;
 import org.onap.policy.apex.model.basicmodel.handling.ApexModelFileWriter;
 import org.onap.policy.apex.model.basicmodel.handling.ApexModelReader;
@@ -106,7 +106,7 @@
 
         if (!apexModel.getPolicyModel().getKey().equals(AxArtifactKey.getNullKey())) {
             return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS,
-                    MODEL + apexModel.getPolicyModel().getKey().getID() + ALREADY_LOADED);
+                    MODEL + apexModel.getPolicyModel().getKey().getId() + ALREADY_LOADED);
         }
 
         ApexAPIResult result = new ApexAPIResult();
@@ -127,7 +127,7 @@
 
         if (!apexModel.getPolicyModel().getKey().equals(AxArtifactKey.getNullKey())) {
             return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS,
-                    MODEL + apexModel.getPolicyModel().getKey().getID() + ALREADY_LOADED);
+                    MODEL + apexModel.getPolicyModel().getKey().getId() + ALREADY_LOADED);
         }
 
         ApexAPIResult result = new ApexAPIResult();
@@ -152,9 +152,9 @@
 
         try {
             if (xmlFlag) {
-                apexModelFileWriter.apexModelWriteXMLFile(apexModel.getPolicyModel(), AxPolicyModel.class, fileName);
+                apexModelFileWriter.apexModelWriteXmlFile(apexModel.getPolicyModel(), AxPolicyModel.class, fileName);
             } else {
-                apexModelFileWriter.apexModelWriteJSONFile(apexModel.getPolicyModel(), AxPolicyModel.class, fileName);
+                apexModelFileWriter.apexModelWriteJsonFile(apexModel.getPolicyModel(), AxPolicyModel.class, fileName);
             }
             return new ApexAPIResult();
         } catch (ApexException e) {
@@ -168,23 +168,23 @@
      * @param modelName the name of the model to load
      * @param modelVersion the version of the model to load, loads the policy model from the
      *        database with this name, if more than one exist, an exception is thrown
-     * @param daoParameters the parameters to use to access the database over JDBC
+     * @param DaoParameters the parameters to use to access the database over JDBC
      * @return the result of the operation
      */
     public ApexAPIResult loadFromDatabase(final String modelName, final String modelVersion,
-            final DAOParameters daoParameters) {
+            final DaoParameters DaoParameters) {
         Assertions.argumentNotNull(modelName, "modelName may not be null");
-        Assertions.argumentNotNull(daoParameters, "daoParameters may not be null");
+        Assertions.argumentNotNull(DaoParameters, "DaoParameters may not be null");
 
         if (!apexModel.getPolicyModel().getKey().equals(AxArtifactKey.getNullKey())) {
             return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS,
-                    MODEL + apexModel.getPolicyModel().getKey().getID() + ALREADY_LOADED);
+                    MODEL + apexModel.getPolicyModel().getKey().getId() + ALREADY_LOADED);
         }
 
         ApexDao apexDao = null;
         try {
-            apexDao = new ApexDaoFactory().createApexDao(daoParameters);
-            apexDao.init(daoParameters);
+            apexDao = new ApexDaoFactory().createApexDao(DaoParameters);
+            apexDao.init(DaoParameters);
 
             // Single specific model requested
             if (modelVersion != null) {
@@ -249,15 +249,15 @@
     /**
      * Save an Apex model to a database.
      *
-     * @param daoParameters the parameters to use to access the database over JDBC
+     * @param DaoParameters the parameters to use to access the database over JDBC
      * @return the result of the operation
      */
-    public ApexAPIResult saveToDatabase(final DAOParameters daoParameters) {
+    public ApexAPIResult saveToDatabase(final DaoParameters DaoParameters) {
         ApexDao apexDao = null;
 
         try {
-            apexDao = new ApexDaoFactory().createApexDao(daoParameters);
-            apexDao.init(daoParameters);
+            apexDao = new ApexDaoFactory().createApexDao(DaoParameters);
+            apexDao.init(DaoParameters);
 
             apexDao.create(apexModel.getPolicyModel());
             return new ApexAPIResult();
@@ -281,7 +281,7 @@
 
         if (!apexModel.getPolicyModel().getKey().equals(AxArtifactKey.getNullKey())) {
             return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS,
-                    MODEL + apexModel.getPolicyModel().getKey().getID() + ALREADY_LOADED);
+                    MODEL + apexModel.getPolicyModel().getKey().getId() + ALREADY_LOADED);
         }
 
         URL apexModelURL;
@@ -468,7 +468,7 @@
                     PolicyModelSplitter.getSubPolicyModel(apexModel.getPolicyModel(), requiredPolicySet, false);
 
             ApexModelFileWriter<AxPolicyModel> apexModelFileWriter = new ApexModelFileWriter<>(false);
-            apexModelFileWriter.apexModelWriteJSONFile(splitPolicyModel, AxPolicyModel.class, targetModelName);
+            apexModelFileWriter.apexModelWriteJsonFile(splitPolicyModel, AxPolicyModel.class, targetModelName);
             return new ApexAPIResult();
         } catch (ApexException e) {
             return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e);
@@ -503,7 +503,7 @@
             return splitResult;
         } catch (Exception e) {
             return new ApexAPIResult(ApexAPIResult.RESULT.FAILED,
-                    "split of policy model " + apexModel.getPolicyModel().getID() + " failed", e);
+                    "split of policy model " + apexModel.getPolicyModel().getId() + " failed", e);
         } finally {
             if (tempSplitPolicyFile != null) {
                 try {
diff --git a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/PolicyFacade.java b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/PolicyFacade.java
index 97bf3da..1fe6d35 100644
--- a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/PolicyFacade.java
+++ b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/PolicyFacade.java
@@ -116,7 +116,7 @@
             }
 
             if (apexModel.getPolicyModel().getPolicies().getPolicyMap().containsKey(key)) {
-                return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, CONCEPT + key.getID() + ALREADY_EXISTS);
+                return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, CONCEPT + key.getId() + ALREADY_EXISTS);
             }
 
             final AxPolicy policy = new AxPolicy(key);
@@ -211,7 +211,7 @@
                             .writeString(removedPolicy, AxPolicy.class, jsonMode));
                 } else {
                     return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                            CONCEPT + key.getID() + DOES_NOT_EXIST);
+                            CONCEPT + key.getId() + DOES_NOT_EXIST);
                 }
             }
 
@@ -291,7 +291,7 @@
 
             if (policy.getStateMap().containsKey(refKey.getLocalName())) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS,
-                        CONCEPT + refKey.getID() + ALREADY_EXISTS);
+                        CONCEPT + refKey.getId() + ALREADY_EXISTS);
             }
 
             final AxEvent triggerEvent = apexModel.getPolicyModel().getEvents().get(triggerName, triggerVersion);
@@ -345,7 +345,7 @@
             final AxState state = policy.getStateMap().get(stateName);
             if (state == null) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                        CONCEPT + policy.getKey().getID() + ':' + stateName + DOES_NOT_EXIST);
+                        CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST);
             }
 
             if (triggerName != null) {
@@ -401,7 +401,7 @@
             } else {
                 if (policy.getStateMap().size() == 0) {
                     return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                            "no states defined on policy " + policy.getKey().getID());
+                            "no states defined on policy " + policy.getKey().getId());
                 }
                 final ApexAPIResult result = new ApexAPIResult();
                 for (final AxState state : policy.getStateMap().values()) {
@@ -445,7 +445,7 @@
             } else {
                 if (policy.getStateMap().size() == 0) {
                     return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                            "no states defined on policy " + policy.getKey().getID());
+                            "no states defined on policy " + policy.getKey().getId());
                 }
                 for (final AxState state : policy.getStateMap().values()) {
                     result.addMessage(
@@ -484,7 +484,7 @@
             final AxState state = policy.getStateMap().get(stateName);
             if (state == null) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                        CONCEPT + policy.getKey().getID() + ':' + stateName + DOES_NOT_EXIST);
+                        CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST);
             }
 
             // There is only one logic item associated with a state so we use a hard coded logic
@@ -493,7 +493,7 @@
 
             if (!state.getTaskSelectionLogic().getKey().getLocalName().equals(AxKey.NULL_KEY_NAME)) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS,
-                        CONCEPT + refKey.getID() + ALREADY_EXISTS);
+                        CONCEPT + refKey.getId() + ALREADY_EXISTS);
             }
 
             state.setTaskSelectionLogic(new AxTaskSelectionLogic(refKey, logicFlavour, logic));
@@ -527,12 +527,12 @@
             final AxState state = policy.getStateMap().get(stateName);
             if (state == null) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                        CONCEPT + policy.getKey().getID() + ':' + stateName + DOES_NOT_EXIST);
+                        CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST);
             }
 
             if (state.getTaskSelectionLogic().getKey().getLocalName().equals(AxKey.NULL_KEY_NAME)) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                        CONCEPT + state.getTaskSelectionLogic().getKey().getID() + DOES_NOT_EXIST);
+                        CONCEPT + state.getTaskSelectionLogic().getKey().getId() + DOES_NOT_EXIST);
             }
 
             final AxTaskSelectionLogic taskSelectionLogic = state.getTaskSelectionLogic();
@@ -571,7 +571,7 @@
             final AxState state = policy.getStateMap().get(stateName);
             if (state == null) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                        CONCEPT + policy.getKey().getID() + ':' + stateName + DOES_NOT_EXIST);
+                        CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST);
             }
 
             return new ApexAPIResult(ApexAPIResult.RESULT.SUCCESS,
@@ -604,12 +604,12 @@
             final AxState state = policy.getStateMap().get(stateName);
             if (state == null) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                        CONCEPT + policy.getKey().getID() + ':' + stateName + DOES_NOT_EXIST);
+                        CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST);
             }
 
             if (state.getTaskSelectionLogic().getKey().getLocalName().equals(AxKey.NULL_KEY_NAME)) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                        CONCEPT + state.getTaskSelectionLogic().getKey().getID() + DOES_NOT_EXIST);
+                        CONCEPT + state.getTaskSelectionLogic().getKey().getId() + DOES_NOT_EXIST);
             }
 
             final ApexAPIResult result = new ApexAPIResult();
@@ -651,13 +651,13 @@
             final AxState state = policy.getStateMap().get(stateName);
             if (state == null) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                        "State concept " + policy.getKey().getID() + ':' + stateName + DOES_NOT_EXIST);
+                        "State concept " + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST);
             }
 
             final AxReferenceKey refKey = new AxReferenceKey(state.getKey(), outputName);
             if (state.getStateOutputs().containsKey(refKey.getLocalName())) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS,
-                        "Output concept " + refKey.getID() + ALREADY_EXISTS);
+                        "Output concept " + refKey.getId() + ALREADY_EXISTS);
             }
 
             final AxEvent event = apexModel.getPolicyModel().getEvents().get(eventName, eventVersion);
@@ -676,7 +676,7 @@
 
                 if (!policy.getStateMap().containsKey(nextState)) {
                     return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                            "Next state concept " + nextStateKey.getID() + DOES_NOT_EXIST);
+                            "Next state concept " + nextStateKey.getId() + DOES_NOT_EXIST);
                 }
             }
 
@@ -710,7 +710,7 @@
             final AxState state = policy.getStateMap().get(stateName);
             if (state == null) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                        CONCEPT + policy.getKey().getID() + ':' + stateName + DOES_NOT_EXIST);
+                        CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST);
             }
 
             if (outputName != null) {
@@ -721,12 +721,12 @@
                                     AxStateOutput.class, jsonMode));
                 } else {
                     return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                            CONCEPT + state.getKey().getID() + ':' + outputName + DOES_NOT_EXIST);
+                            CONCEPT + state.getKey().getId() + ':' + outputName + DOES_NOT_EXIST);
                 }
             } else {
                 if (state.getStateOutputs().size() == 0) {
                     return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                            "no state output concepts exist for state " + state.getKey().getID());
+                            "no state output concepts exist for state " + state.getKey().getId());
                 }
 
                 final ApexAPIResult result = new ApexAPIResult();
@@ -765,7 +765,7 @@
             final AxState state = policy.getStateMap().get(stateName);
             if (state == null) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                        CONCEPT + policy.getKey().getID() + ':' + stateName + DOES_NOT_EXIST);
+                        CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST);
             }
 
             if (outputName != null) {
@@ -778,12 +778,12 @@
                     return result;
                 } else {
                     return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                            CONCEPT + state.getKey().getID() + ':' + outputName + DOES_NOT_EXIST);
+                            CONCEPT + state.getKey().getId() + ':' + outputName + DOES_NOT_EXIST);
                 }
             } else {
                 if (state.getStateOutputs().size() == 0) {
                     return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                            "no state output concepts exist for state " + state.getKey().getID());
+                            "no state output concepts exist for state " + state.getKey().getId());
                 }
 
                 final ApexAPIResult result = new ApexAPIResult();
@@ -827,14 +827,14 @@
             final AxState state = policy.getStateMap().get(stateName);
             if (state == null) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                        CONCEPT + policy.getKey().getID() + ':' + stateName + DOES_NOT_EXIST);
+                        CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST);
             }
 
             final AxReferenceKey refKey = new AxReferenceKey(state.getKey(), finalizerLogicName);
 
             if (state.getStateFinalizerLogicMap().containsKey(refKey.getLocalName())) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS,
-                        CONCEPT + refKey.getID() + ALREADY_EXISTS);
+                        CONCEPT + refKey.getId() + ALREADY_EXISTS);
             }
 
             state.getStateFinalizerLogicMap().put(finalizerLogicName,
@@ -872,7 +872,7 @@
             final AxState state = policy.getStateMap().get(stateName);
             if (state == null) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                        CONCEPT + policy.getKey().getID() + ':' + stateName + DOES_NOT_EXIST);
+                        CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST);
             }
 
             final AxReferenceKey refKey = new AxReferenceKey(state.getKey(), finalizerLogicName);
@@ -880,7 +880,7 @@
                     state.getStateFinalizerLogicMap().get(refKey.getKey().getLocalName());
             if (stateFinalizerLogic == null) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                        STATE_FINALIZER_LOGIC + refKey.getID() + DOES_NOT_EXIST);
+                        STATE_FINALIZER_LOGIC + refKey.getId() + DOES_NOT_EXIST);
             }
 
             if (logicFlavour != null) {
@@ -919,7 +919,7 @@
             final AxState state = policy.getStateMap().get(stateName);
             if (state == null) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                        CONCEPT + policy.getKey().getID() + ':' + stateName + DOES_NOT_EXIST);
+                        CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST);
             }
 
             if (finalizerLogicName != null) {
@@ -928,7 +928,7 @@
                         state.getStateFinalizerLogicMap().get(refKey.getKey().getLocalName());
                 if (stateFinalizerLogic == null) {
                     return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                            STATE_FINALIZER_LOGIC + refKey.getID() + DOES_NOT_EXIST);
+                            STATE_FINALIZER_LOGIC + refKey.getId() + DOES_NOT_EXIST);
                 }
 
                 return new ApexAPIResult(ApexAPIResult.RESULT.SUCCESS,
@@ -937,7 +937,7 @@
             } else {
                 if (state.getStateFinalizerLogicMap().size() == 0) {
                     return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                            "no state finalizer logic defined on state " + state.getKey().getID());
+                            "no state finalizer logic defined on state " + state.getKey().getId());
                 }
                 final ApexAPIResult result = new ApexAPIResult();
                 for (final AxStateFinalizerLogic stateFinalizerLogic : state.getStateFinalizerLogicMap().values()) {
@@ -974,7 +974,7 @@
             final AxState state = policy.getStateMap().get(stateName);
             if (state == null) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                        CONCEPT + policy.getKey().getID() + ':' + stateName + DOES_NOT_EXIST);
+                        CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST);
             }
 
             if (finalizerLogicName != null) {
@@ -983,7 +983,7 @@
                         state.getStateFinalizerLogicMap().get(refKey.getKey().getLocalName());
                 if (stateFinalizerLogic == null) {
                     return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                            STATE_FINALIZER_LOGIC + refKey.getID() + DOES_NOT_EXIST);
+                            STATE_FINALIZER_LOGIC + refKey.getId() + DOES_NOT_EXIST);
                 }
 
                 final ApexAPIResult result = new ApexAPIResult();
@@ -994,7 +994,7 @@
             } else {
                 if (state.getStateFinalizerLogicMap().size() == 0) {
                     return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                            "no state finalizer logic defined on state " + state.getKey().getID());
+                            "no state finalizer logic defined on state " + state.getKey().getId());
                 }
 
                 final ApexAPIResult result = new ApexAPIResult();
@@ -1042,7 +1042,7 @@
             final AxState state = policy.getStateMap().get(stateName);
             if (state == null) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                        CONCEPT + policy.getKey().getID() + ':' + stateName + DOES_NOT_EXIST);
+                        CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST);
             }
 
             final AxTask task = apexModel.getPolicyModel().getTasks().get(taskName, taskVersion);
@@ -1052,7 +1052,7 @@
             }
 
             if (state.getTaskReferences().containsKey(task.getKey())) {
-                return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, "task " + task.getKey().getID()
+                return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, "task " + task.getKey().getId()
                         + " already has reference with output " + state.getTaskReferences().get(task.getKey()));
             }
 
@@ -1070,12 +1070,12 @@
             if (stateTaskOutputType.equals(AxStateTaskOutputType.DIRECT)) {
                 if (!state.getStateOutputs().containsKey(outputRefKey.getLocalName())) {
                     return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                            "state output concept " + outputRefKey.getID() + DOES_NOT_EXIST);
+                            "state output concept " + outputRefKey.getId() + DOES_NOT_EXIST);
                 }
             } else if (stateTaskOutputType.equals(AxStateTaskOutputType.LOGIC)) {
                 if (!state.getStateFinalizerLogicMap().containsKey(outputRefKey.getLocalName())) {
                     return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                            "state finalizer logic concept " + outputRefKey.getID() + DOES_NOT_EXIST);
+                            "state finalizer logic concept " + outputRefKey.getId() + DOES_NOT_EXIST);
                 }
             } else {
                 return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, "output type " + outputType + " invalid");
@@ -1114,7 +1114,7 @@
             final AxState state = policy.getStateMap().get(stateName);
             if (state == null) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                        CONCEPT + policy.getKey().getID() + ':' + stateName + DOES_NOT_EXIST);
+                        CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST);
             }
 
             final ApexAPIResult result = new ApexAPIResult();
@@ -1138,7 +1138,7 @@
                 return result;
             } else {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                        "no task references found for state " + state.getKey().getID());
+                        "no task references found for state " + state.getKey().getId());
             }
         } catch (final Exception e) {
             return new ApexAPIResult(ApexAPIResult.RESULT.FAILED, e);
@@ -1169,7 +1169,7 @@
             final AxState state = policy.getStateMap().get(stateName);
             if (state == null) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                        CONCEPT + policy.getKey().getID() + ':' + stateName + DOES_NOT_EXIST);
+                        CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST);
             }
 
             final Set<AxArtifactKey> deleteSet = new TreeSet<>();
@@ -1183,7 +1183,7 @@
             }
             if (deleteSet.isEmpty()) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                        CONCEPT + taskName + ':' + taskVersion + DOES_NOT_EXIST_ON_STATE + state.getKey().getID());
+                        CONCEPT + taskName + ':' + taskVersion + DOES_NOT_EXIST_ON_STATE + state.getKey().getId());
             }
 
             final ApexAPIResult result = new ApexAPIResult();
@@ -1223,7 +1223,7 @@
             final AxState state = policy.getStateMap().get(stateName);
             if (state == null) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                        CONCEPT + policy.getKey().getID() + ':' + stateName + DOES_NOT_EXIST);
+                        CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST);
             }
 
             final AxContextAlbum contextAlbum =
@@ -1235,7 +1235,7 @@
 
             if (state.getContextAlbumReferences().contains(contextAlbum.getKey())) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, "concept album reference for concept "
-                        + contextAlbum.getKey().getID() + " already exists in state");
+                        + contextAlbum.getKey().getId() + " already exists in state");
             }
 
             state.getContextAlbumReferences().add(contextAlbum.getKey());
@@ -1271,7 +1271,7 @@
             final AxState state = policy.getStateMap().get(stateName);
             if (state == null) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                        CONCEPT + policy.getKey().getID() + ':' + stateName + DOES_NOT_EXIST);
+                        CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST);
             }
 
             final ApexAPIResult result = new ApexAPIResult();
@@ -1287,7 +1287,7 @@
             }
             if (!found) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, CONCEPT + contextAlbumName + ':'
-                        + contextAlbumVersion + DOES_NOT_EXIST_ON_STATE + state.getKey().getID());
+                        + contextAlbumVersion + DOES_NOT_EXIST_ON_STATE + state.getKey().getId());
             }
             return result;
         } catch (final Exception e) {
@@ -1321,7 +1321,7 @@
             final AxState state = policy.getStateMap().get(stateName);
             if (state == null) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                        CONCEPT + policy.getKey().getID() + ':' + stateName + DOES_NOT_EXIST);
+                        CONCEPT + policy.getKey().getId() + ':' + stateName + DOES_NOT_EXIST);
             }
 
             final Set<AxArtifactKey> deleteSet = new TreeSet<>();
@@ -1337,7 +1337,7 @@
             }
             if (deleteSet.isEmpty()) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST, CONCEPT + contextAlbumName + ':'
-                        + contextAlbumVersion + DOES_NOT_EXIST_ON_STATE + state.getKey().getID());
+                        + contextAlbumVersion + DOES_NOT_EXIST_ON_STATE + state.getKey().getId());
             }
 
             final ApexAPIResult result = new ApexAPIResult();
diff --git a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/TaskFacade.java b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/TaskFacade.java
index dd00da7..5cb2e74 100644
--- a/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/TaskFacade.java
+++ b/model/model-api/src/main/java/org/onap/policy/apex/model/modelapi/impl/TaskFacade.java
@@ -101,7 +101,7 @@
             }
 
             if (apexModel.getPolicyModel().getTasks().getTaskMap().containsKey(key)) {
-                return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, CONCEPT + key.getID() + ALREADY_EXISTS);
+                return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, CONCEPT + key.getId() + ALREADY_EXISTS);
             }
 
             apexModel.getPolicyModel().getTasks().getTaskMap().put(key, new AxTask(key));
@@ -182,7 +182,7 @@
                             new ApexModelStringWriter<AxTask>(false).writeString(removedTask, AxTask.class, jsonMode));
                 } else {
                     return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                            CONCEPT + key.getID() + DOES_NOT_EXIST);
+                            CONCEPT + key.getId() + DOES_NOT_EXIST);
                 }
             }
 
@@ -256,7 +256,7 @@
 
             if (!task.getTaskLogic().getKey().getLocalName().equals(AxKey.NULL_KEY_NAME)) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS,
-                        CONCEPT + refKey.getID() + ALREADY_EXISTS);
+                        CONCEPT + refKey.getId() + ALREADY_EXISTS);
             }
 
             task.setTaskLogic(new AxTaskLogic(refKey, logicFlavour, logic));
@@ -286,7 +286,7 @@
 
             if (task.getTaskLogic().getKey().getLocalName().equals(AxKey.NULL_KEY_NAME)) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                        CONCEPT + task.getTaskLogic().getKey().getID() + DOES_NOT_EXIST);
+                        CONCEPT + task.getTaskLogic().getKey().getId() + DOES_NOT_EXIST);
             }
 
             final AxTaskLogic taskLogic = task.getTaskLogic();
@@ -342,7 +342,7 @@
 
             if (task.getTaskLogic().getKey().getLocalName().equals(AxKey.NULL_KEY_NAME)) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                        CONCEPT + task.getTaskLogic().getKey().getID() + DOES_NOT_EXIST);
+                        CONCEPT + task.getTaskLogic().getKey().getId() + DOES_NOT_EXIST);
             }
 
             final ApexAPIResult result = new ApexAPIResult();
@@ -383,7 +383,7 @@
 
             if (task.getInputFields().containsKey(refKey.getLocalName())) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS,
-                        CONCEPT + refKey.getID() + ALREADY_EXISTS);
+                        CONCEPT + refKey.getId() + ALREADY_EXISTS);
             }
 
             final AxContextSchema schema =
@@ -430,7 +430,7 @@
             } else {
                 if (task.getInputFields().size() == 0) {
                     return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                            "no input fields defined on task " + task.getKey().getID());
+                            "no input fields defined on task " + task.getKey().getId());
                 }
 
                 final ApexAPIResult result = new ApexAPIResult();
@@ -476,7 +476,7 @@
             } else {
                 if (task.getInputFields().size() == 0) {
                     return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                            "no input fields defined on task " + task.getKey().getID());
+                            "no input fields defined on task " + task.getKey().getId());
                 }
 
                 for (final AxInputField field : task.getInputFields().values()) {
@@ -520,7 +520,7 @@
 
             if (task.getOutputFields().containsKey(refKey.getLocalName())) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS,
-                        CONCEPT + refKey.getID() + ALREADY_EXISTS);
+                        CONCEPT + refKey.getId() + ALREADY_EXISTS);
             }
 
             final AxContextSchema schema =
@@ -567,7 +567,7 @@
             } else {
                 if (task.getOutputFields().size() == 0) {
                     return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                            "no output fields defined on task " + task.getKey().getID());
+                            "no output fields defined on task " + task.getKey().getId());
                 }
 
                 final ApexAPIResult result = new ApexAPIResult();
@@ -612,7 +612,7 @@
             } else {
                 if (task.getOutputFields().size() == 0) {
                     return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                            "no output fields defined on task " + task.getKey().getID());
+                            "no output fields defined on task " + task.getKey().getId());
                 }
 
                 for (final AxOutputField field : task.getOutputFields().values()) {
@@ -651,7 +651,7 @@
 
             if (task.getTaskParameters().containsKey(refKey.getLocalName())) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS,
-                        CONCEPT + refKey.getID() + ALREADY_EXISTS);
+                        CONCEPT + refKey.getId() + ALREADY_EXISTS);
             }
 
             task.getTaskParameters().put(refKey.getLocalName(), new AxTaskParameter(refKey, defaultValue));
@@ -690,7 +690,7 @@
             } else {
                 if (task.getTaskParameters().size() == 0) {
                     return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                            "no task parameters defined on task " + task.getKey().getID());
+                            "no task parameters defined on task " + task.getKey().getId());
                 }
 
                 final ApexAPIResult result = new ApexAPIResult();
@@ -735,7 +735,7 @@
             } else {
                 if (task.getTaskParameters().size() == 0) {
                     return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_DOES_NOT_EXIST,
-                            "no task parameters defined on task " + task.getKey().getID());
+                            "no task parameters defined on task " + task.getKey().getId());
                 }
 
                 for (final AxTaskParameter parameter : task.getTaskParameters().values()) {
@@ -778,7 +778,7 @@
 
             if (task.getContextAlbumReferences().contains(contextAlbum.getKey())) {
                 return new ApexAPIResult(ApexAPIResult.RESULT.CONCEPT_EXISTS, "context album reference for concept "
-                        + contextAlbum.getKey().getID() + " already exists in task");
+                        + contextAlbum.getKey().getId() + " already exists in task");
             }
 
             task.getContextAlbumReferences().add(contextAlbum.getKey());
diff --git a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApexModelAPI.java b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApexModelAPI.java
index 6834124..c3521d3 100644
--- a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApexModelAPI.java
+++ b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestApexModelAPI.java
@@ -35,7 +35,7 @@
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
-import org.onap.policy.apex.model.basicmodel.dao.DAOParameters;
+import org.onap.policy.apex.model.basicmodel.dao.DaoParameters;
 import org.onap.policy.apex.model.modelapi.impl.ApexModelImpl;
 import org.onap.policy.apex.model.utilities.TextFileUtils;
 
@@ -114,29 +114,29 @@
         ApexAPIResult result = apexModel.loadFromFile("src/test/resources/models/PolicyModel.json");
         assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS));
 
-        final DAOParameters daoParameters = new DAOParameters();
-        daoParameters.setPluginClass("org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao");
-        daoParameters.setPersistenceUnit("DAOTest");
+        final DaoParameters DaoParameters = new DaoParameters();
+        DaoParameters.setPluginClass("org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao");
+        DaoParameters.setPersistenceUnit("DAOTest");
 
-        result = apexModel.saveToDatabase(daoParameters);
+        result = apexModel.saveToDatabase(DaoParameters);
         assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS));
 
         result = apexModel.deleteModel();
         assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS));
 
-        result = apexModel.loadFromDatabase("PolicyModel", "0.0.1", daoParameters);
+        result = apexModel.loadFromDatabase("PolicyModel", "0.0.1", DaoParameters);
         assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS));
 
         result = apexModel.deleteModel();
         assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS));
 
-        result = apexModel.loadFromDatabase("PolicyModel", null, daoParameters);
+        result = apexModel.loadFromDatabase("PolicyModel", null, DaoParameters);
         assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS));
 
         result = apexModel.deleteModel();
         assertTrue(result.getResult().equals(ApexAPIResult.RESULT.SUCCESS));
 
-        result = apexModel.loadFromDatabase("VPNPolicyModel", "0.0.1", daoParameters);
+        result = apexModel.loadFromDatabase("VPNPolicyModel", "0.0.1", DaoParameters);
         assertTrue(result.getResult().equals(ApexAPIResult.RESULT.FAILED));
     }
 
diff --git a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestModelHandlerFacade.java b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestModelHandlerFacade.java
index f13b8df..7439cd3 100644
--- a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestModelHandlerFacade.java
+++ b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/TestModelHandlerFacade.java
@@ -29,7 +29,7 @@
 import java.util.Properties;
 
 import org.junit.Test;
-import org.onap.policy.apex.model.basicmodel.dao.DAOParameters;
+import org.onap.policy.apex.model.basicmodel.dao.DaoParameters;
 import org.onap.policy.apex.model.modelapi.impl.ModelHandlerFacade;
 import org.onap.policy.apex.model.utilities.TextFileUtils;
 
@@ -77,17 +77,17 @@
         result = mhf.loadFromString(modelString);
         assertEquals(ApexAPIResult.RESULT.CONCEPT_EXISTS, result.getResult());
 
-        final DAOParameters daoParameters = new DAOParameters();
-        result = mhf.loadFromDatabase("SomeModel", null, daoParameters);
+        final DaoParameters DaoParameters = new DaoParameters();
+        result = mhf.loadFromDatabase("SomeModel", null, DaoParameters);
         assertEquals(ApexAPIResult.RESULT.CONCEPT_EXISTS, result.getResult());
 
         result = apexModel.deleteModel();
         assertEquals(ApexAPIResult.RESULT.SUCCESS, result.getResult());
 
-        result = mhf.loadFromDatabase("SomeModel", null, daoParameters);
+        result = mhf.loadFromDatabase("SomeModel", null, DaoParameters);
         assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult());
 
-        result = mhf.saveToDatabase(daoParameters);
+        result = mhf.saveToDatabase(DaoParameters);
         assertEquals(ApexAPIResult.RESULT.FAILED, result.getResult());
 
         result = mhf.readFromURL("blah://somewhere/over/the/rainbow");
diff --git a/model/model-api/src/test/resources/META-INF/persistence.xml b/model/model-api/src/test/resources/META-INF/persistence.xml
index 3db7417..f834e0f 100644
--- a/model/model-api/src/test/resources/META-INF/persistence.xml
+++ b/model/model-api/src/test/resources/META-INF/persistence.xml
@@ -23,8 +23,8 @@
     <persistence-unit name="DAOTest" transaction-type="RESOURCE_LOCAL">
         <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
 
-        <class>org.onap.policy.apex.model.basicmodel.dao.converters.CDATAConditioner</class>
-        <class>org.onap.policy.apex.model.basicmodel.dao.converters.UUID2String</class>
+        <class>org.onap.policy.apex.model.basicmodel.dao.converters.CDataConditioner</class>
+        <class>org.onap.policy.apex.model.basicmodel.dao.converters.Uuid2String</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxConcept</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxKeyInfo</class>
diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxLogic.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxLogic.java
index a537d90..2fc4467 100644
--- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxLogic.java
+++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxLogic.java
@@ -42,7 +42,7 @@
 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationMessage;
 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult.ValidationResult;
-import org.onap.policy.apex.model.basicmodel.dao.converters.CDATAConditioner;
+import org.onap.policy.apex.model.basicmodel.dao.converters.CDataConditioner;
 import org.onap.policy.apex.model.basicmodel.xml.AxReferenceKeyAdapter;
 import org.onap.policy.apex.model.utilities.Assertions;
 
@@ -99,8 +99,8 @@
     private String logicFlavour;
 
     @Column(name = "logic", length = MAX_LOGIC_SIZE)
-    @Convert(converter = CDATAConditioner.class)
-    @XmlJavaTypeAdapter(value = CDATAConditioner.class)
+    @Convert(converter = CDataConditioner.class)
+    @XmlJavaTypeAdapter(value = CDataConditioner.class)
     @XmlElement(required = true)
     private String logic;
 
@@ -385,8 +385,8 @@
         if (!logicFlavour.equals(other.logicFlavour)) {
             return false;
         }
-        final String thislogic = CDATAConditioner.clean(logic).replaceAll("\n", "");
-        final String otherlogic = CDATAConditioner.clean(other.logic).replaceAll("\n", "");
+        final String thislogic = CDataConditioner.clean(logic).replaceAll("\n", "");
+        final String otherlogic = CDataConditioner.clean(other.logic).replaceAll("\n", "");
         return thislogic.equals(otherlogic);
     }
 
diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicy.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicy.java
index ff7e4a2..8b87c41 100644
--- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicy.java
+++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicy.java
@@ -303,7 +303,7 @@
 
         // Validation continues from this point only if all validation checks this far have been
         // passed
-        if (!result.isOK()) {
+        if (!result.isOk()) {
             return result;
         }
 
@@ -361,7 +361,7 @@
                     && !stateMap.containsKey(stateOutput.getNextState().getLocalName())) {
                 result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
                         " nextState of state " + stateEntry.getKey() + " not found in StateMap: "
-                                + stateOutput.getNextState().getID()));
+                                + stateOutput.getNextState().getId()));
             }
         }
 
diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicyModel.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicyModel.java
index f6000b1..ad465a4 100644
--- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicyModel.java
+++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicyModel.java
@@ -382,7 +382,7 @@
                 if (getSchemas().get(field.getSchema()) == null) {
                     result.addValidationMessage(
                             new AxValidationMessage(event.getKey(), this.getClass(), ValidationResult.INVALID,
-                                    "event field data type " + field.getSchema().getID() + DOES_NOT_EXIST));
+                                    "event field data type " + field.getSchema().getId() + DOES_NOT_EXIST));
                 }
             }
         }
@@ -400,7 +400,7 @@
             if (getSchemas().get(contextAlbum.getItemSchema()) == null) {
                 result.addValidationMessage(
                         new AxValidationMessage(contextAlbum.getKey(), this.getClass(), ValidationResult.INVALID,
-                                "context album schema " + contextAlbum.getItemSchema().getID() + DOES_NOT_EXIST));
+                                "context album schema " + contextAlbum.getItemSchema().getId() + DOES_NOT_EXIST));
             }
         }
         return result;
@@ -431,20 +431,20 @@
             if (getSchemas().get(field.getSchema()) == null) {
                 result.addValidationMessage(
                         new AxValidationMessage(task.getKey(), this.getClass(), ValidationResult.INVALID,
-                                "task input field schema " + field.getSchema().getID() + DOES_NOT_EXIST));
+                                "task input field schema " + field.getSchema().getId() + DOES_NOT_EXIST));
             }
         }
         for (final AxField field : task.getOutputFieldSet()) {
             if (getSchemas().get(field.getSchema()) == null) {
                 result.addValidationMessage(
                         new AxValidationMessage(task.getKey(), this.getClass(), ValidationResult.INVALID,
-                                "task output field schema " + field.getSchema().getID() + DOES_NOT_EXIST));
+                                "task output field schema " + field.getSchema().getId() + DOES_NOT_EXIST));
             }
         }
         for (final AxArtifactKey contextAlbumKey : task.getContextAlbumReferences()) {
             if (albums.get(contextAlbumKey) == null) {
                 result.addValidationMessage(new AxValidationMessage(task.getKey(), this.getClass(),
-                        ValidationResult.INVALID, "task context album " + contextAlbumKey.getID() + DOES_NOT_EXIST));
+                        ValidationResult.INVALID, "task context album " + contextAlbumKey.getId() + DOES_NOT_EXIST));
             }
         }
         return result;
@@ -476,20 +476,20 @@
         for (final AxArtifactKey contextAlbumKey : state.getContextAlbumReferences()) {
             if (albums.get(contextAlbumKey) == null) {
                 result.addValidationMessage(new AxValidationMessage(state.getKey(), this.getClass(),
-                        ValidationResult.INVALID, "state context album " + contextAlbumKey.getID() + DOES_NOT_EXIST));
+                        ValidationResult.INVALID, "state context album " + contextAlbumKey.getId() + DOES_NOT_EXIST));
             }
         }
 
         final AxEvent triggerEvent = events.getEventMap().get(state.getTrigger());
         if (triggerEvent == null) {
             result.addValidationMessage(new AxValidationMessage(state.getKey(), this.getClass(),
-                    ValidationResult.INVALID, "state trigger event " + state.getTrigger().getID() + DOES_NOT_EXIST));
+                    ValidationResult.INVALID, "state trigger event " + state.getTrigger().getId() + DOES_NOT_EXIST));
         }
 
         final AxTask defaultTask = tasks.getTaskMap().get(state.getDefaultTask());
         if (defaultTask == null) {
             result.addValidationMessage(new AxValidationMessage(state.getKey(), this.getClass(),
-                    ValidationResult.INVALID, "state default task " + state.getDefaultTask().getID() + DOES_NOT_EXIST));
+                    ValidationResult.INVALID, "state default task " + state.getDefaultTask().getId() + DOES_NOT_EXIST));
         }
 
         // Check task input fields and event fields are compatible for default tasks with no task
@@ -501,15 +501,15 @@
             for (final AxField unhandledTaskInputField : unhandledTaskInputFields) {
                 result.addValidationMessage(new AxValidationMessage(state.getKey(), this.getClass(),
                         ValidationResult.INVALID, "task input field " + unhandledTaskInputField + " for task "
-                                + defaultTask.getID() + " not in trigger event " + triggerEvent.getID()));
+                                + defaultTask.getId() + " not in trigger event " + triggerEvent.getId()));
             }
         }
 
         for (final AxStateOutput stateOutput : state.getStateOutputs().values()) {
             if (events.getEventMap().get(stateOutput.getOutgingEvent()) == null) {
                 result.addValidationMessage(new AxValidationMessage(stateOutput.getKey(), this.getClass(),
-                        ValidationResult.INVALID, "output event " + stateOutput.getOutgingEvent().getID()
-                                + " for state output " + stateOutput.getID() + DOES_NOT_EXIST));
+                        ValidationResult.INVALID, "output event " + stateOutput.getOutgingEvent().getId()
+                                + " for state output " + stateOutput.getId() + DOES_NOT_EXIST));
             }
         }
 
@@ -534,7 +534,7 @@
             final AxTask usedTask = tasks.getTaskMap().get(taskRefEntry.getKey());
             if (usedTask == null) {
                 result.addValidationMessage(new AxValidationMessage(state.getKey(), this.getClass(),
-                        ValidationResult.INVALID, "state task " + taskRefEntry.getKey().getID() + DOES_NOT_EXIST));
+                        ValidationResult.INVALID, "state task " + taskRefEntry.getKey().getId() + DOES_NOT_EXIST));
             } else {
                 AxStateOutput stateOutput =
                         state.getStateOutputs().get(taskRefEntry.getValue().getOutput().getKey().getLocalName());
@@ -556,14 +556,14 @@
             final AxStateOutput stateOutput, AxValidationResult result) {
         if (stateOutput == null) {
             result.addValidationMessage(new AxValidationMessage(state.getKey(), this.getClass(),
-                    ValidationResult.INVALID, "state output on task reference for task " + task.getID() + " is null"));
+                    ValidationResult.INVALID, "state output on task reference for task " + task.getId() + " is null"));
 
         } else {
             final AxEvent usedEvent = events.getEventMap().get(stateOutput.getOutgingEvent());
             if (usedEvent == null) {
                 result.addValidationMessage(new AxValidationMessage(stateOutput.getKey(), this.getClass(),
-                        ValidationResult.INVALID, "output event " + stateOutput.getOutgingEvent().getID()
-                                + " for state output " + stateOutput.getID() + DOES_NOT_EXIST));
+                        ValidationResult.INVALID, "output event " + stateOutput.getOutgingEvent().getId()
+                                + " for state output " + stateOutput.getId() + DOES_NOT_EXIST));
             }
 
             if (task != null && usedEvent != null) {
@@ -572,7 +572,7 @@
                 for (final AxField unhandledTaskOutputField : unhandledTaskOutputFields) {
                     result.addValidationMessage(new AxValidationMessage(state.getKey(), this.getClass(),
                             ValidationResult.INVALID, "task output field " + unhandledTaskOutputField + " for task "
-                                    + task.getID() + " not in output event " + usedEvent.getID()));
+                                    + task.getId() + " not in output event " + usedEvent.getId()));
                 }
             }
         }
diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxState.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxState.java
index 895232e..6851e48 100644
--- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxState.java
+++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxState.java
@@ -685,7 +685,7 @@
         if (!taskSelectionLogic.getKey().equals(AxReferenceKey.getNullKey())) {
             if (!taskSelectionLogic.getKey().getParentReferenceKey().equals(key)) {
                 result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
-                        "taskSelectionLogic key " + taskSelectionLogic.getKey().getID() + DOES_NOT_EQUAL_STATE_KEY));
+                        "taskSelectionLogic key " + taskSelectionLogic.getKey().getId() + DOES_NOT_EQUAL_STATE_KEY));
             }
             result = taskSelectionLogic.validate(result);
         }
@@ -707,7 +707,7 @@
             } else {
                 if (!stateFinalizerLogicEntry.getValue().getKey().getParentReferenceKey().equals(key)) {
                     result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
-                            "stateFinalizerLogic parent key " + stateFinalizerLogicEntry.getValue().getKey().getID()
+                            "stateFinalizerLogic parent key " + stateFinalizerLogicEntry.getValue().getKey().getId()
                                     + DOES_NOT_EQUAL_STATE_KEY));
                 }
 
@@ -778,7 +778,7 @@
             Set<String> stateFinalizerLogicNameSet, AxValidationResult result) {
         if (!taskReference.getKey().getParentReferenceKey().equals(key)) {
             result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
-                    "stateTaskReference parent key " + taskReference.getKey().getID() + DOES_NOT_EQUAL_STATE_KEY));
+                    "stateTaskReference parent key " + taskReference.getKey().getId() + DOES_NOT_EQUAL_STATE_KEY));
         }
 
         if (taskReference.getStateTaskOutputType().equals(AxStateTaskOutputType.DIRECT)) {
diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTaskReference.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTaskReference.java
index 011af6c..8a43e37 100644
--- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTaskReference.java
+++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTaskReference.java
@@ -269,7 +269,7 @@
 
         if (output.equals(AxReferenceKey.getNullKey())) {
             result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
-                    "output key " + output.getID() + " is a null key"));
+                    "output key " + output.getId() + " is a null key"));
         }
         result = output.validate(result);
 
diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTree.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTree.java
index 30076ca..478608c 100644
--- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTree.java
+++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTree.java
@@ -73,7 +73,7 @@
 
             // Check for state tree loops
             if (referencedStateNameSet.contains(nextState.getKey())) {
-                throw new PolicyRuntimeException("loop detected in state tree for policy " + policy.getID() + " state "
+                throw new PolicyRuntimeException("loop detected in state tree for policy " + policy.getId() + " state "
                         + thisState.getKey().getLocalName() + ", next state " + nextState.getKey().getLocalName()
                         + " referenced more than once");
             }
diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTask.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTask.java
index b1f26f6..f263316 100644
--- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTask.java
+++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTask.java
@@ -483,7 +483,7 @@
 
         if (!taskLogic.getKey().getParentArtifactKey().equals(key)) {
             result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
-                    "taskLogic parent key " + taskLogic.getKey().getID() + DOES_NOT_EQUAL_TASK_KEY));
+                    "taskLogic parent key " + taskLogic.getKey().getId() + DOES_NOT_EQUAL_TASK_KEY));
         }
 
         return taskLogic.validate(result);
diff --git a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyAnalysisResult.java b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyAnalysisResult.java
index d59af7c..2f5cd43 100644
--- a/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyAnalysisResult.java
+++ b/model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/handling/PolicyAnalysisResult.java
@@ -212,7 +212,7 @@
         builder.append('\n');
         for (final Entry<? extends AxKey, Set<AxKey>> usageEntry : usageMap.entrySet()) {
             builder.append(" ");
-            builder.append(usageEntry.getKey().getID());
+            builder.append(usageEntry.getKey().getId());
             if (usageEntry.getValue().isEmpty()) {
                 builder.append(" (unused)\n");
                 continue;
@@ -221,7 +221,7 @@
             builder.append('\n');
             for (final AxKey usageKey : usageEntry.getValue()) {
                 builder.append("  ");
-                builder.append(usageKey.getID());
+                builder.append(usageKey.getId());
                 builder.append("\n");
             }
         }
diff --git a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/DummyLogicReader.java b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/DummyLogicReader.java
index 28f70f4..093ed48 100644
--- a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/DummyLogicReader.java
+++ b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/DummyLogicReader.java
@@ -23,9 +23,6 @@
 import org.onap.policy.apex.model.policymodel.concepts.AxLogic;
 import org.onap.policy.apex.model.policymodel.concepts.AxLogicReader;
 
-/**
- * @author Liam Fallon (liam.fallon@ericsson.com)
- */
 public class DummyLogicReader implements AxLogicReader {
 
     /*
diff --git a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TestLogic.java b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TestLogic.java
index a415a1c..3b1fc6b 100644
--- a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TestLogic.java
+++ b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TestLogic.java
@@ -83,8 +83,8 @@
 
         final AxReferenceKey logicKey = new AxReferenceKey("LogicParentName", "0.0.1", "PLN", "LN");
         logic.setKey(logicKey);
-        assertEquals("LogicParentName:0.0.1:PLN:LN", logic.getKey().getID());
-        assertEquals("LogicParentName:0.0.1:PLN:LN", logic.getKeys().get(0).getID());
+        assertEquals("LogicParentName:0.0.1:PLN:LN", logic.getKey().getId());
+        assertEquals("LogicParentName:0.0.1:PLN:LN", logic.getKeys().get(0).getId());
 
         logic.setLogicFlavour("LogicFlavour");
         assertEquals("LogicFlavour", logic.getLogicFlavour());
diff --git a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TestPolicies.java b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TestPolicies.java
index 9da944b..b2a3911 100644
--- a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TestPolicies.java
+++ b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TestPolicies.java
@@ -76,8 +76,8 @@
         }
 
         policy.setKey(policyKey);
-        assertEquals("PolicyName:0.0.1", policy.getKey().getID());
-        assertEquals("PolicyName:0.0.1", policy.getKeys().get(0).getID());
+        assertEquals("PolicyName:0.0.1", policy.getKey().getId());
+        assertEquals("PolicyName:0.0.1", policy.getKeys().get(0).getId());
 
         try {
             policy.setTemplate(null);
@@ -109,7 +109,7 @@
         policy.setFirstState("FirstState");
         assertEquals("FirstState", policy.getFirstState());
 
-        assertEquals("PolicyName:0.0.1", policy.getKeys().get(0).getID());
+        assertEquals("PolicyName:0.0.1", policy.getKeys().get(0).getId());
 
         policy = new TestApexPolicyModelCreator().getModel().getPolicies().get("policy");
 
@@ -269,7 +269,7 @@
 
         // Invalid, no events in event map
         policies.setKey(new AxArtifactKey("PoliciesKey", "0.0.1"));
-        assertEquals("PoliciesKey:0.0.1", policies.getKey().getID());
+        assertEquals("PoliciesKey:0.0.1", policies.getKey().getId());
 
         result = new AxValidationResult();
         result = policies.validate(result);
diff --git a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TestPolicyModel.java b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TestPolicyModel.java
index db1d1ee..5df831c 100644
--- a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TestPolicyModel.java
+++ b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TestPolicyModel.java
@@ -75,7 +75,7 @@
         model.register();
 
         assertNotNull(model.getContextModel());
-        assertEquals("ModelKey:0.0.1", model.getKeys().get(0).getID());
+        assertEquals("ModelKey:0.0.1", model.getKeys().get(0).getId());
 
         model.clean();
         assertNotNull(model);
diff --git a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TestState.java b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TestState.java
index 1d62ae6..c53fff1 100644
--- a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TestState.java
+++ b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TestState.java
@@ -86,8 +86,8 @@
         }
 
         state.setKey(stateKey);
-        assertEquals("PolicyName:0.0.1:NULL:StateName", state.getKey().getID());
-        assertEquals("PolicyName:0.0.1:NULL:StateName", state.getKeys().get(0).getID());
+        assertEquals("PolicyName:0.0.1:NULL:StateName", state.getKey().getId());
+        assertEquals("PolicyName:0.0.1:NULL:StateName", state.getKeys().get(0).getId());
 
         final AxStateOutput so0 = new AxStateOutput(new AxReferenceKey(stateKey, "SO0"), triggerKey, new AxReferenceKey());
         final AxStateOutput soU = new AxStateOutput(new AxReferenceKey(stateKey, "SOU"), triggerKey, stateKeyNext);
diff --git a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TestStateOutput.java b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TestStateOutput.java
index 5911d41..5306b76 100644
--- a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TestStateOutput.java
+++ b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TestStateOutput.java
@@ -60,8 +60,8 @@
         }
 
         so.setKey(soKey);
-        assertEquals("SOStateParent:0.0.1:SOState:SOName", so.getKey().getID());
-        assertEquals("SOStateParent:0.0.1:SOState:SOName", so.getKeys().get(0).getID());
+        assertEquals("SOStateParent:0.0.1:SOState:SOName", so.getKey().getId());
+        assertEquals("SOStateParent:0.0.1:SOState:SOName", so.getKeys().get(0).getId());
 
         try {
             so.setNextState(null);
diff --git a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TestStateTaskReference.java b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TestStateTaskReference.java
index c85fda4..eeaf19e 100644
--- a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TestStateTaskReference.java
+++ b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TestStateTaskReference.java
@@ -62,8 +62,8 @@
         }
 
         stRef.setKey(stRefKey);
-        assertEquals("StateParent:0.0.1:SOState:SOName", stRef.getKey().getID());
-        assertEquals("StateParent:0.0.1:SOState:SOName", stRef.getKeys().get(0).getID());
+        assertEquals("StateParent:0.0.1:SOState:SOName", stRef.getKey().getId());
+        assertEquals("StateParent:0.0.1:SOState:SOName", stRef.getKeys().get(0).getId());
 
         try {
             stRef.setStateTaskOutputType(null);
diff --git a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TestTaskParameter.java b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TestTaskParameter.java
index 63906ad..ff6ab42 100644
--- a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TestTaskParameter.java
+++ b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TestTaskParameter.java
@@ -49,8 +49,8 @@
 
         final AxReferenceKey parKey = new AxReferenceKey("ParParentName", "0.0.1", "PLN", "LN");
         par.setKey(parKey);
-        assertEquals("ParParentName:0.0.1:PLN:LN", par.getKey().getID());
-        assertEquals("ParParentName:0.0.1:PLN:LN", par.getKeys().get(0).getID());
+        assertEquals("ParParentName:0.0.1:PLN:LN", par.getKey().getId());
+        assertEquals("ParParentName:0.0.1:PLN:LN", par.getKeys().get(0).getId());
 
         par.setDefaultValue("DefaultValue");
         assertEquals("DefaultValue", par.getTaskParameterValue());
diff --git a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TestTasks.java b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TestTasks.java
index 967e4e0..78691ac 100644
--- a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TestTasks.java
+++ b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TestTasks.java
@@ -67,8 +67,8 @@
 
         final AxArtifactKey taskKey = new AxArtifactKey("TaskName", "0.0.1");
         task.setKey(taskKey);
-        assertEquals("TaskName:0.0.1", task.getKey().getID());
-        assertEquals("TaskName:0.0.1", task.getKeys().get(0).getID());
+        assertEquals("TaskName:0.0.1", task.getKey().getId());
+        assertEquals("TaskName:0.0.1", task.getKeys().get(0).getId());
 
         final AxArtifactKey f0SchemaKey = new AxArtifactKey("FS0", "0.0.1");
 
@@ -114,8 +114,8 @@
         assertEquals(tl, task.getTaskLogic());
 
         task.setKey(taskKey);
-        assertEquals("TaskName:0.0.1", task.getKey().getID());
-        assertEquals("TaskName:0.0.1", task.getKeys().get(0).getID());
+        assertEquals("TaskName:0.0.1", task.getKey().getId());
+        assertEquals("TaskName:0.0.1", task.getKeys().get(0).getId());
 
         task.afterUnmarshal(null, null);
         assertEquals(1, task.getTaskParameters().size());
@@ -256,7 +256,7 @@
 
         // Invalid, no tasks in task map
         tasks.setKey(new AxArtifactKey("TasksKey", "0.0.1"));
-        assertEquals("TasksKey:0.0.1", tasks.getKey().getID());
+        assertEquals("TasksKey:0.0.1", tasks.getKey().getId());
 
         result = new AxValidationResult();
         result = tasks.validate(result);
diff --git a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/handling/TestApexPolicyModel.java b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/handling/TestApexPolicyModel.java
index b3fd4a1..5dfeede 100644
--- a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/handling/TestApexPolicyModel.java
+++ b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/handling/TestApexPolicyModel.java
@@ -31,7 +31,7 @@
 import org.junit.Before;
 import org.junit.Test;
 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
-import org.onap.policy.apex.model.basicmodel.dao.DAOParameters;
+import org.onap.policy.apex.model.basicmodel.dao.DaoParameters;
 import org.onap.policy.apex.model.basicmodel.test.TestApexModel;
 import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
 
@@ -86,21 +86,21 @@
 
     @Test
     public void testModelWriteReadXML() throws Exception {
-        testApexModel.testApexModelWriteReadXML();
+        testApexModel.testApexModelWriteReadXml();
     }
 
     @Test
     public void testModelWriteReadJSON() throws Exception {
-        testApexModel.testApexModelWriteReadJSON();
+        testApexModel.testApexModelWriteReadJson();
     }
 
     @Test
     public void testModelWriteReadJPA() throws Exception {
-        final DAOParameters daoParameters = new DAOParameters();
-        daoParameters.setPluginClass("org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao");
-        daoParameters.setPersistenceUnit("DAOTest");
+        final DaoParameters DaoParameters = new DaoParameters();
+        DaoParameters.setPluginClass("org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao");
+        DaoParameters.setPersistenceUnit("DAOTest");
 
-        testApexModel.testApexModelWriteReadJPA(daoParameters);
+        testApexModel.testApexModelWriteReadJpa(DaoParameters);
     }
 
     private static final String VALID_MODEL_STRING = "***validation of model successful***";
diff --git a/model/policy-model/src/test/resources/META-INF/persistence.xml b/model/policy-model/src/test/resources/META-INF/persistence.xml
index 6131c82..cd9a420 100644
--- a/model/policy-model/src/test/resources/META-INF/persistence.xml
+++ b/model/policy-model/src/test/resources/META-INF/persistence.xml
@@ -23,8 +23,8 @@
     <persistence-unit name="DAOTest" transaction-type="RESOURCE_LOCAL">
         <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
 
-        <class>org.onap.policy.apex.model.basicmodel.dao.converters.CDATAConditioner</class>
-        <class>org.onap.policy.apex.model.basicmodel.dao.converters.UUID2String</class>
+        <class>org.onap.policy.apex.model.basicmodel.dao.converters.CDataConditioner</class>
+        <class>org.onap.policy.apex.model.basicmodel.dao.converters.Uuid2String</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxConcept</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxKeyInfo</class>
diff --git a/model/utilities/src/main/java/org/onap/policy/apex/model/utilities/TextFileUtils.java b/model/utilities/src/main/java/org/onap/policy/apex/model/utilities/TextFileUtils.java
index 97face9..29e31d6 100644
--- a/model/utilities/src/main/java/org/onap/policy/apex/model/utilities/TextFileUtils.java
+++ b/model/utilities/src/main/java/org/onap/policy/apex/model/utilities/TextFileUtils.java
@@ -103,7 +103,8 @@
             if (charsRead > 0) {
                 builder.append(chars, 0, charsRead);
             }
-        } while (charsRead > 0);
+        }
+        while (charsRead > 0);
         return builder.toString();
     }
 }
diff --git a/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/CollectionUtilitiesTest.java b/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/CollectionUtilitiesTest.java
index 4682d98..e9ddc11 100644
--- a/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/CollectionUtilitiesTest.java
+++ b/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/CollectionUtilitiesTest.java
@@ -28,24 +28,22 @@
 import org.junit.Test;
 import org.onap.policy.apex.model.utilities.CollectionUtils;
 
-/**
- * @author Liam Fallon (liam.fallon@ericsson.com)
- */
 public class CollectionUtilitiesTest {
 
     @Test
     public void testNullLists() {
-        List<String> leftList  = new ArrayList<String>();
-        List<String> rightList = new ArrayList<String>();
-        
         int result = 0;
         
         result = CollectionUtils.compareLists(null, null);
         assertEquals(0, result);
 
+        List<String> leftList  = new ArrayList<String>();
+
         result = CollectionUtils.compareLists(leftList, null);
         assertEquals(-1, result);
 
+        List<String> rightList = new ArrayList<String>();
+        
         result = CollectionUtils.compareLists(null, rightList);
         assertEquals(1, result);
 
@@ -73,8 +71,8 @@
         result = CollectionUtils.compareLists(leftList, rightList);
         assertEquals(-1, result);
         
-        leftList.remove(leftList.size() -1);
-        rightList.remove(rightList.size() -1);
+        leftList.remove(leftList.size() - 1);
+        rightList.remove(rightList.size() - 1);
         result = CollectionUtils.compareLists(leftList, rightList);
         assertEquals(0, result);
 
@@ -83,8 +81,8 @@
         result = CollectionUtils.compareLists(leftList, rightList);
         assertEquals(1, result);
         
-        leftList.remove(leftList.size() -1);
-        rightList.remove(rightList.size() -1);
+        leftList.remove(leftList.size() - 1);
+        rightList.remove(rightList.size() - 1);
         result = CollectionUtils.compareLists(leftList, rightList);
         assertEquals(0, result);
     }
diff --git a/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/DirectoryUtilsTest.java b/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/DirectoryUtilsTest.java
index 84e9733..95839cd 100644
--- a/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/DirectoryUtilsTest.java
+++ b/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/DirectoryUtilsTest.java
@@ -29,9 +29,6 @@
 import org.onap.policy.apex.model.utilities.DirectoryUtils;
 import org.onap.policy.apex.model.utilities.TextFileUtils;
 
-/**
- * @author Liam Fallon (liam.fallon@ericsson.com)
- */
 public class DirectoryUtilsTest {
 
     @Test
diff --git a/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/json/JSONHandlerTest.java b/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/json/JsonHandlerTest.java
similarity index 98%
rename from model/utilities/src/test/java/org/onap/policy/apex/model/utilities/json/JSONHandlerTest.java
rename to model/utilities/src/test/java/org/onap/policy/apex/model/utilities/json/JsonHandlerTest.java
index b8e2ceb..c9db6c3 100644
--- a/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/json/JSONHandlerTest.java
+++ b/model/utilities/src/test/java/org/onap/policy/apex/model/utilities/json/JsonHandlerTest.java
@@ -17,10 +17,13 @@
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
+
 package org.onap.policy.apex.model.utilities.json;
 
 import static org.junit.Assert.assertEquals;
 
+import com.google.gson.GsonBuilder;
+
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
@@ -28,9 +31,7 @@
 
 import org.junit.Test;
 
-import com.google.gson.GsonBuilder;
-
-public class JSONHandlerTest {
+public class JsonHandlerTest {
 
     private static final String VALUE = "value";
 
diff --git a/plugins/plugins-context/plugins-context-distribution/plugins-context-distribution-hazelcast/src/main/java/org/onap/policy/apex/plugins/context/distribution/hazelcast/HazelcastContextDistributor.java b/plugins/plugins-context/plugins-context-distribution/plugins-context-distribution-hazelcast/src/main/java/org/onap/policy/apex/plugins/context/distribution/hazelcast/HazelcastContextDistributor.java
index 2b17b17..9d35c30 100644
--- a/plugins/plugins-context/plugins-context-distribution/plugins-context-distribution-hazelcast/src/main/java/org/onap/policy/apex/plugins/context/distribution/hazelcast/HazelcastContextDistributor.java
+++ b/plugins/plugins-context/plugins-context-distribution/plugins-context-distribution-hazelcast/src/main/java/org/onap/policy/apex/plugins/context/distribution/hazelcast/HazelcastContextDistributor.java
@@ -85,8 +85,8 @@
     @Override
     public Map<String, Object> getContextAlbumMap(final AxArtifactKey contextAlbumKey) {
         // Get the map from Hazelcast
-        LOGGER.info("HazelcastContextDistributor: create album: " + contextAlbumKey.getID());
-        return hazelcastInstance.getMap(contextAlbumKey.getID());
+        LOGGER.info("HazelcastContextDistributor: create album: " + contextAlbumKey.getId());
+        return hazelcastInstance.getMap(contextAlbumKey.getId());
     }
 
     /*
diff --git a/plugins/plugins-context/plugins-context-distribution/plugins-context-distribution-infinispan/src/main/java/org/onap/policy/apex/plugins/context/distribution/infinispan/InfinispanContextDistributor.java b/plugins/plugins-context/plugins-context-distribution/plugins-context-distribution-infinispan/src/main/java/org/onap/policy/apex/plugins/context/distribution/infinispan/InfinispanContextDistributor.java
index d6a04dd..9f1327d 100644
--- a/plugins/plugins-context/plugins-context-distribution/plugins-context-distribution-infinispan/src/main/java/org/onap/policy/apex/plugins/context/distribution/infinispan/InfinispanContextDistributor.java
+++ b/plugins/plugins-context/plugins-context-distribution/plugins-context-distribution-infinispan/src/main/java/org/onap/policy/apex/plugins/context/distribution/infinispan/InfinispanContextDistributor.java
@@ -91,11 +91,11 @@
      */
     @Override
     public Map<String, Object> getContextAlbumMap(final AxArtifactKey contextAlbumKey) {
-        LOGGER.info("InfinispanContextDistributor: create album: " + contextAlbumKey.getID());
+        LOGGER.info("InfinispanContextDistributor: create album: " + contextAlbumKey.getId());
 
         // Get the Cache from Infinispan
         final Cache<String, Object> infinispanCache =
-                infinispanManager.getCacheManager().getCache(contextAlbumKey.getID().replace(':', '_'));
+                infinispanManager.getCacheManager().getCache(contextAlbumKey.getId().replace(':', '_'));
 
         return infinispanCache;
     }
diff --git a/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroBytesObjectMapper.java b/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroBytesObjectMapper.java
index dc281a5..20e701b 100644
--- a/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroBytesObjectMapper.java
+++ b/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroBytesObjectMapper.java
@@ -102,7 +102,7 @@
         // The Avro object should be a Utf8 object
         if (!(avroObject instanceof ByteBuffer)) {
             final String returnString =
-                    userKey.getID() + ": object \"" + avroObject + "\" of class \"" + avroObject.getClass()
+                    userKey.getId() + ": object \"" + avroObject + "\" of class \"" + avroObject.getClass()
                             + "\" cannot be decoded to an object of class \"" + schemaClass.getCanonicalName() + "\"";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
@@ -127,7 +127,7 @@
     @Override
     public Object mapToAvro(final Object object) {
         if (object == null) {
-            final String returnString = userKey.getID() + ": cannot encode a null object of class \""
+            final String returnString = userKey.getId() + ": cannot encode a null object of class \""
                     + schemaClass.getCanonicalName() + "\"";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
@@ -135,7 +135,7 @@
 
         // The incoming object should be a byte array
         if (!(object instanceof byte[])) {
-            final String returnString = userKey.getID() + ": object \"" + object + "\" of class \"" + object.getClass()
+            final String returnString = userKey.getId() + ": object \"" + object + "\" of class \"" + object.getClass()
                     + "\" cannot be decoded to an object of class \"" + schemaClass.getCanonicalName() + "\"";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
diff --git a/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroDirectObjectMapper.java b/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroDirectObjectMapper.java
index acf64c3..35e811d 100644
--- a/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroDirectObjectMapper.java
+++ b/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroDirectObjectMapper.java
@@ -132,7 +132,7 @@
         // the decoded object is always returned as a null
         if (!schemaClass.isAssignableFrom(avroObject.getClass())) {
             final String returnString =
-                    userKey.getID() + ": object \"" + avroObject + "\" of class \"" + avroObject.getClass()
+                    userKey.getId() + ": object \"" + avroObject + "\" of class \"" + avroObject.getClass()
                             + "\" cannot be decoded to an object of class \"" + schemaClass.getCanonicalName() + "\"";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
@@ -152,7 +152,7 @@
         // Null values are only allowed if the schema class is null
         if (object == null) {
             if (schemaClass != null) {
-                final String returnString = userKey.getID() + ": cannot encode a null object of class \""
+                final String returnString = userKey.getId() + ": cannot encode a null object of class \""
                         + schemaClass.getCanonicalName() + "\"";
                 LOGGER.warn(returnString);
                 throw new ContextRuntimeException(returnString);
diff --git a/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroObjectMapperFactory.java b/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroObjectMapperFactory.java
index 22152a8..a48ca80 100644
--- a/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroObjectMapperFactory.java
+++ b/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroObjectMapperFactory.java
@@ -79,7 +79,7 @@
             // currently only support unions with 2 types, one of which is NULL
             final Schema nullschema = Schema.create(Schema.Type.NULL);
             if (types.size() != 2 || !types.contains(nullschema)) {
-                final String resultSting = userKey.getID()
+                final String resultSting = userKey.getId()
                         + ": Apex currently only supports UNION schemas with 2 options, one must be NULL";
                 LOGGER.warn(resultSting);
                 throw new ContextRuntimeException(resultSting);
@@ -91,7 +91,7 @@
                 schema = types.get(1);
             }
             if (Schema.Type.NULL.equals(schema.getType())) {
-                final String resultSting = userKey.getID()
+                final String resultSting = userKey.getId()
                         + ": Apex currently only supports UNION schema2 with 2 options, only one can be NULL, and the other cannot be another UNION";
                 LOGGER.warn(resultSting);
                 throw new ContextRuntimeException(resultSting);
@@ -103,7 +103,7 @@
         // Check that there is a definition for the mapper for this type
         if (!AVRO_OBJECT_MAPPER_MAP.containsKey(avroType) || AVRO_OBJECT_MAPPER_MAP.get(avroType) == null) {
             final String resultSting =
-                    userKey.getID() + ": no Avro object mapper defined for Avro type \"" + avroType + "\"";
+                    userKey.getId() + ": no Avro object mapper defined for Avro type \"" + avroType + "\"";
             LOGGER.warn(resultSting);
             throw new ContextRuntimeException(resultSting);
         }
@@ -117,7 +117,7 @@
             }
 
         } catch (final Exception e) {
-            final String resultSting = userKey.getID() + ": could not create an Avro object mapper of type \""
+            final String resultSting = userKey.getId() + ": could not create an Avro object mapper of type \""
                     + AVRO_OBJECT_MAPPER_MAP.get(avroType) + "\" for Avro type \"" + avroType + "\" : " + e;
             LOGGER.warn(resultSting, e);
             throw new ContextRuntimeException(resultSting, e);
diff --git a/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroSchemaHelper.java b/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroSchemaHelper.java
index 5fba274..df430b6 100644
--- a/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroSchemaHelper.java
+++ b/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroSchemaHelper.java
@@ -66,7 +66,7 @@
         try {
             avroSchema = new Schema.Parser().parse(schema.getSchema());
         } catch (final Exception e) {
-            final String resultSting = userKey.getID() + ": avro context schema \"" + schema.getID()
+            final String resultSting = userKey.getId() + ": avro context schema \"" + schema.getId()
                     + "\" schema is invalid: " + e.getMessage() + ", schema: " + schema.getSchema();
             LOGGER.warn(resultSting);
             throw new ContextRuntimeException(resultSting);
@@ -121,7 +121,7 @@
             return createNewInstance(elementJsonString);
         }
         else {
-            final String returnString = getUserKey().getID() + ": the object \"" + incomingObject
+            final String returnString = getUserKey().getId() + ": the object \"" + incomingObject
             + "\" is not an instance of JsonObject";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
@@ -146,7 +146,7 @@
             final JsonDecoder jsonDecoder = DecoderFactory.get().jsonDecoder(avroSchema, objectString);
             decodedObject = new GenericDatumReader<GenericRecord>(avroSchema).read(null, jsonDecoder);
         } catch (final Exception e) {
-            final String returnString = getUserKey().getID() + ": object \"" + objectString
+            final String returnString = getUserKey().getId() + ": object \"" + objectString
                     + "\" Avro unmarshalling failed: " + e.getMessage();
             LOGGER.warn(returnString, e);
             throw new ContextRuntimeException(returnString, e);
@@ -185,7 +185,7 @@
                 return (String) object;
             }
         } catch (final ClassCastException e) {
-            final String returnString = getUserKey().getID() + ": object \"" + object + "\" of type \""
+            final String returnString = getUserKey().getId() + ": object \"" + object + "\" of type \""
                     + (object != null ? object.getClass().getCanonicalName() : "null") + "\" must be assignable to \""
                     + getSchemaClass().getCanonicalName()
                     + "\" or be a Json string representation of it for Avro unmarshalling";
@@ -218,7 +218,7 @@
             return new String(output.toByteArray());
         } catch (final Exception e) {
             final String returnString =
-                    getUserKey().getID() + ": object \"" + object + "\" Avro marshalling failed: " + e.getMessage();
+                    getUserKey().getId() + ": object \"" + object + "\" Avro marshalling failed: " + e.getMessage();
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString, e);
         }
diff --git a/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroStringObjectMapper.java b/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroStringObjectMapper.java
index cb3625f..09d1d9f 100644
--- a/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroStringObjectMapper.java
+++ b/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroStringObjectMapper.java
@@ -101,7 +101,7 @@
         // The Avro object should be a Utf8 object
         if (!(avroObject instanceof Utf8)) {
             final String returnString =
-                    userKey.getID() + ": object \"" + avroObject + "\" of class \"" + avroObject.getClass()
+                    userKey.getId() + ": object \"" + avroObject + "\" of class \"" + avroObject.getClass()
                             + "\" cannot be decoded to an object of class \"" + schemaClass.getCanonicalName() + "\"";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
@@ -119,7 +119,7 @@
     @Override
     public Object mapToAvro(final Object object) {
         if (object == null) {
-            final String returnString = userKey.getID() + ": cannot encode a null object of class \""
+            final String returnString = userKey.getId() + ": cannot encode a null object of class \""
                     + schemaClass.getCanonicalName() + "\"";
             LOGGER.warn(returnString);
             throw new ContextRuntimeException(returnString);
diff --git a/plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-yaml/src/main/java/org/onap/policy/apex/plugins/event/protocol/yaml/Apex2YamlEventConverter.java b/plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-yaml/src/main/java/org/onap/policy/apex/plugins/event/protocol/yaml/Apex2YamlEventConverter.java
index 689b1e7..f81c3a9 100644
--- a/plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-yaml/src/main/java/org/onap/policy/apex/plugins/event/protocol/yaml/Apex2YamlEventConverter.java
+++ b/plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-yaml/src/main/java/org/onap/policy/apex/plugins/event/protocol/yaml/Apex2YamlEventConverter.java
@@ -165,7 +165,7 @@
 
             if (!apexEvent.containsKey(fieldName)) {
                 if (!eventField.getOptional()) {
-                    final String errorMessage = "error parsing " + eventDefinition.getID() + " event to Json. "
+                    final String errorMessage = "error parsing " + eventDefinition.getId() + " event to Json. "
                                     + "Field \"" + fieldName + "\" is missing, but is mandatory. Fields: " + apexEvent;
                     LOGGER.debug(errorMessage);
                     throw new ApexEventRuntimeException(errorMessage);
@@ -204,7 +204,7 @@
             final String fieldName = eventField.getKey().getLocalName();
             if (!yamlMap.containsKey(fieldName)) {
                 if (!eventField.getOptional()) {
-                    final String errorMessage = "error parsing " + eventDefinition.getID() + " event from Json. "
+                    final String errorMessage = "error parsing " + eventDefinition.getId() + " event from Json. "
                                     + "Field \"" + fieldName + "\" is missing, but is mandatory.";
                     LOGGER.debug(errorMessage);
                     throw new ApexEventException(errorMessage);
diff --git a/plugins/plugins-executor/plugins-executor-java/src/main/java/org/onap/policy/apex/plugins/executor/java/JavaStateFinalizerExecutor.java b/plugins/plugins-executor/plugins-executor-java/src/main/java/org/onap/policy/apex/plugins/executor/java/JavaStateFinalizerExecutor.java
index 52b7873..4fff290 100644
--- a/plugins/plugins-executor/plugins-executor-java/src/main/java/org/onap/policy/apex/plugins/executor/java/JavaStateFinalizerExecutor.java
+++ b/plugins/plugins-executor/plugins-executor-java/src/main/java/org/onap/policy/apex/plugins/executor/java/JavaStateFinalizerExecutor.java
@@ -88,10 +88,10 @@
                     new Class[] { StateFinalizerExecutionContext.class });
             returnValue = (boolean) method.invoke(stateFinalizerLogicObject, getExecutionContext());
         } catch (final Exception e) {
-            LOGGER.error("execute: state finalizer logic failed to run for state finalizer  \"" + getSubject().getID()
+            LOGGER.error("execute: state finalizer logic failed to run for state finalizer  \"" + getSubject().getId()
                     + "\"");
             throw new StateMachineException(
-                    "state finalizer logic failed to run for state finalizer  \"" + getSubject().getID() + "\"", e);
+                    "state finalizer logic failed to run for state finalizer  \"" + getSubject().getId() + "\"", e);
         }
 
         // Do the execution post work
@@ -112,7 +112,7 @@
      */
     @Override
     public void cleanUp() throws StateMachineException {
-        LOGGER.debug("cleanUp:" + getSubject().getID() + "," + getSubject().getLogicFlavour() + ","
+        LOGGER.debug("cleanUp:" + getSubject().getId() + "," + getSubject().getLogicFlavour() + ","
                 + getSubject().getLogic());
     }
 }
diff --git a/plugins/plugins-executor/plugins-executor-java/src/main/java/org/onap/policy/apex/plugins/executor/java/JavaTaskExecutor.java b/plugins/plugins-executor/plugins-executor-java/src/main/java/org/onap/policy/apex/plugins/executor/java/JavaTaskExecutor.java
index 6343f1a..753f08b 100644
--- a/plugins/plugins-executor/plugins-executor-java/src/main/java/org/onap/policy/apex/plugins/executor/java/JavaTaskExecutor.java
+++ b/plugins/plugins-executor/plugins-executor-java/src/main/java/org/onap/policy/apex/plugins/executor/java/JavaTaskExecutor.java
@@ -88,9 +88,9 @@
                     new Class[] { TaskExecutionContext.class });
             returnValue = (boolean) method.invoke(taskLogicObject, getExecutionContext());
         } catch (final Exception e) {
-            LOGGER.error("execute: task logic failed to run for task  \"" + getSubject().getKey().getID() + "\"");
+            LOGGER.error("execute: task logic failed to run for task  \"" + getSubject().getKey().getId() + "\"");
             throw new StateMachineException(
-                    "task logic failed to run for task  \"" + getSubject().getKey().getID() + "\"", e);
+                    "task logic failed to run for task  \"" + getSubject().getKey().getId() + "\"", e);
         }
 
         // Do the execution post work
@@ -111,7 +111,7 @@
      */
     @Override
     public void cleanUp() throws StateMachineException {
-        LOGGER.debug("cleanUp:" + getSubject().getKey().getID() + "," + getSubject().getTaskLogic().getLogicFlavour()
+        LOGGER.debug("cleanUp:" + getSubject().getKey().getId() + "," + getSubject().getTaskLogic().getLogicFlavour()
                 + "," + getSubject().getTaskLogic().getLogic());
     }
 }
diff --git a/plugins/plugins-executor/plugins-executor-java/src/main/java/org/onap/policy/apex/plugins/executor/java/JavaTaskSelectExecutor.java b/plugins/plugins-executor/plugins-executor-java/src/main/java/org/onap/policy/apex/plugins/executor/java/JavaTaskSelectExecutor.java
index ee33c52..a42ff2c 100644
--- a/plugins/plugins-executor/plugins-executor-java/src/main/java/org/onap/policy/apex/plugins/executor/java/JavaTaskSelectExecutor.java
+++ b/plugins/plugins-executor/plugins-executor-java/src/main/java/org/onap/policy/apex/plugins/executor/java/JavaTaskSelectExecutor.java
@@ -89,10 +89,10 @@
             returnValue = (boolean) method.invoke(taskSelectionLogicObject, getExecutionContext());
         } catch (final Exception e) {
             LOGGER.error(
-                    "execute: task selection logic failed to run for state  \"" + getSubject().getKey().getID() + "\"",
+                    "execute: task selection logic failed to run for state  \"" + getSubject().getKey().getId() + "\"",
                     e);
             throw new StateMachineException(
-                    "task selection logic failed to run for state  \"" + getSubject().getKey().getID() + "\"", e);
+                    "task selection logic failed to run for state  \"" + getSubject().getKey().getId() + "\"", e);
         }
 
         // Do the execution post work
@@ -113,7 +113,7 @@
      */
     @Override
     public void cleanUp() throws StateMachineException {
-        LOGGER.debug("cleanUp:" + getSubject().getKey().getID() + ","
+        LOGGER.debug("cleanUp:" + getSubject().getKey().getId() + ","
                 + getSubject().getTaskSelectionLogic().getLogicFlavour() + ","
                 + getSubject().getTaskSelectionLogic().getLogic());
     }
diff --git a/plugins/plugins-executor/plugins-executor-javascript/src/main/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptStateFinalizerExecutor.java b/plugins/plugins-executor/plugins-executor-javascript/src/main/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptStateFinalizerExecutor.java
index 66c0363..7b91c59 100644
--- a/plugins/plugins-executor/plugins-executor-javascript/src/main/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptStateFinalizerExecutor.java
+++ b/plugins/plugins-executor/plugins-executor-javascript/src/main/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptStateFinalizerExecutor.java
@@ -61,9 +61,9 @@
             compiled = ((Compilable) engine).compile(getSubject().getLogic());
         } catch (final ScriptException e) {
             LOGGER.error("execute: state finalizer logic failed to compile for state finalizer  \""
-                    + getSubject().getKey().getID() + "\"");
+                    + getSubject().getKey().getId() + "\"");
             throw new StateMachineException("state finalizer logic failed to compile for state finalizer  \""
-                    + getSubject().getKey().getID() + "\"", e);
+                    + getSubject().getKey().getId() + "\"", e);
         }
     }
 
@@ -95,9 +95,9 @@
             }
         } catch (final ScriptException e) {
             LOGGER.error("execute: state finalizer logic failed to run for state finalizer  \""
-                    + getSubject().getKey().getID() + "\"");
+                    + getSubject().getKey().getId() + "\"");
             throw new StateMachineException("state finalizer logic failed to run for state finalizer  \""
-                    + getSubject().getKey().getID() + "\"", e);
+                    + getSubject().getKey().getId() + "\"", e);
         }
 
         returnValue = (boolean) engine.get("returnValue");
@@ -120,7 +120,7 @@
      */
     @Override
     public void cleanUp() throws StateMachineException {
-        LOGGER.debug("cleanUp:" + getSubject().getKey().getID() + "," + getSubject().getLogicFlavour() + ","
+        LOGGER.debug("cleanUp:" + getSubject().getKey().getId() + "," + getSubject().getLogicFlavour() + ","
                 + getSubject().getLogic());
         engine = null;
     }
diff --git a/plugins/plugins-executor/plugins-executor-javascript/src/main/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptTaskExecutor.java b/plugins/plugins-executor/plugins-executor-javascript/src/main/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptTaskExecutor.java
index 80f744b..38be929 100644
--- a/plugins/plugins-executor/plugins-executor-javascript/src/main/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptTaskExecutor.java
+++ b/plugins/plugins-executor/plugins-executor-javascript/src/main/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptTaskExecutor.java
@@ -60,9 +60,9 @@
         try {
             compiled = ((Compilable) engine).compile(getSubject().getTaskLogic().getLogic());
         } catch (final ScriptException e) {
-            LOGGER.error("execute: task logic failed to compile for task  \"" + getSubject().getKey().getID() + "\"");
+            LOGGER.error("execute: task logic failed to compile for task  \"" + getSubject().getKey().getId() + "\"");
             throw new StateMachineException(
-                    "task logic failed to compile for task  \"" + getSubject().getKey().getID() + "\"", e);
+                    "task logic failed to compile for task  \"" + getSubject().getKey().getId() + "\"", e);
         }
     }
 
@@ -93,25 +93,25 @@
                 compiled.eval(engine.getContext());
             }
         } catch (final ScriptException e) {
-            LOGGER.error("execute: task logic failed to run for task  \"" + getSubject().getKey().getID() + "\"");
+            LOGGER.error("execute: task logic failed to run for task  \"" + getSubject().getKey().getId() + "\"");
             throw new StateMachineException(
-                    "task logic failed to run for task  \"" + getSubject().getKey().getID() + "\"", e);
+                    "task logic failed to run for task  \"" + getSubject().getKey().getId() + "\"", e);
         }
 
         try {
             final Object ret = engine.get("returnValue");
             if (ret == null) {
                 LOGGER.error("execute: task logic failed to set a return value for task  \""
-                        + getSubject().getKey().getID() + "\"");
+                        + getSubject().getKey().getId() + "\"");
                 throw new StateMachineException("execute: task logic failed to set a return value for task  \""
-                        + getSubject().getKey().getID() + "\"");
+                        + getSubject().getKey().getId() + "\"");
             }
             returnValue = (Boolean) ret;
         } catch (NullPointerException | ClassCastException e) {
             LOGGER.error("execute: task selection logic failed to set a correct return value for state  \""
-                    + getSubject().getKey().getID() + "\"", e);
+                    + getSubject().getKey().getId() + "\"", e);
             throw new StateMachineException("execute: task selection logic failed to set a return value for state  \""
-                    + getSubject().getKey().getID() + "\"", e);
+                    + getSubject().getKey().getId() + "\"", e);
         }
 
         // Do the execution post work
@@ -132,7 +132,7 @@
      */
     @Override
     public void cleanUp() throws StateMachineException {
-        LOGGER.debug("cleanUp:" + getSubject().getKey().getID() + "," + getSubject().getTaskLogic().getLogicFlavour()
+        LOGGER.debug("cleanUp:" + getSubject().getKey().getId() + "," + getSubject().getTaskLogic().getLogicFlavour()
                 + "," + getSubject().getTaskLogic().getLogic());
         engine = null;
     }
diff --git a/plugins/plugins-executor/plugins-executor-javascript/src/main/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptTaskSelectExecutor.java b/plugins/plugins-executor/plugins-executor-javascript/src/main/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptTaskSelectExecutor.java
index aa9c665..570b33b 100644
--- a/plugins/plugins-executor/plugins-executor-javascript/src/main/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptTaskSelectExecutor.java
+++ b/plugins/plugins-executor/plugins-executor-javascript/src/main/java/org/onap/policy/apex/plugins/executor/javascript/JavascriptTaskSelectExecutor.java
@@ -60,10 +60,10 @@
         try {
             compiled = ((Compilable) engine).compile(getSubject().getTaskSelectionLogic().getLogic());
         } catch (final ScriptException e) {
-            LOGGER.error("execute: task selection logic failed to compile for state  \"" + getSubject().getKey().getID()
+            LOGGER.error("execute: task selection logic failed to compile for state  \"" + getSubject().getKey().getId()
                     + "\"");
             throw new StateMachineException(
-                    "task selection logic failed to compile for state  \"" + getSubject().getKey().getID() + "\"", e);
+                    "task selection logic failed to compile for state  \"" + getSubject().getKey().getId() + "\"", e);
         }
 
     }
@@ -96,26 +96,26 @@
             }
         } catch (final ScriptException e) {
             LOGGER.error(
-                    "execute: task selection logic failed to run for state  \"" + getSubject().getKey().getID() + "\"");
+                    "execute: task selection logic failed to run for state  \"" + getSubject().getKey().getId() + "\"");
             throw new StateMachineException(
-                    "task selection logic failed to run for state  \"" + getSubject().getKey().getID() + "\"", e);
+                    "task selection logic failed to run for state  \"" + getSubject().getKey().getId() + "\"", e);
         }
 
         try {
             final Object ret = engine.get("returnValue");
             if (ret == null) {
                 LOGGER.error("execute: task selection logic failed to set a return value for state  \""
-                        + getSubject().getKey().getID() + "\"");
+                        + getSubject().getKey().getId() + "\"");
                 throw new StateMachineException(
                         "execute: task selection logic failed to set a return value for state  \""
-                                + getSubject().getKey().getID() + "\"");
+                                + getSubject().getKey().getId() + "\"");
             }
             returnValue = (Boolean) ret;
         } catch (NullPointerException | ClassCastException e) {
             LOGGER.error("execute: task selection logic failed to set a correct return value for state  \""
-                    + getSubject().getKey().getID() + "\"", e);
+                    + getSubject().getKey().getId() + "\"", e);
             throw new StateMachineException("execute: task selection logic failed to set a return value for state  \""
-                    + getSubject().getKey().getID() + "\"", e);
+                    + getSubject().getKey().getId() + "\"", e);
         }
 
         // Do the execution post work
@@ -136,7 +136,7 @@
      */
     @Override
     public void cleanUp() throws StateMachineException {
-        LOGGER.debug("cleanUp:" + getSubject().getKey().getID() + ","
+        LOGGER.debug("cleanUp:" + getSubject().getKey().getId() + ","
                 + getSubject().getTaskSelectionLogic().getLogicFlavour() + ","
                 + getSubject().getTaskSelectionLogic().getLogic());
         engine = null;
diff --git a/plugins/plugins-executor/plugins-executor-jruby/src/main/java/org/onap/policy/apex/plugins/executor/jruby/JrubyStateFinalizerExecutor.java b/plugins/plugins-executor/plugins-executor-jruby/src/main/java/org/onap/policy/apex/plugins/executor/jruby/JrubyStateFinalizerExecutor.java
index 41ad359..f8f66e5 100644
--- a/plugins/plugins-executor/plugins-executor-jruby/src/main/java/org/onap/policy/apex/plugins/executor/jruby/JrubyStateFinalizerExecutor.java
+++ b/plugins/plugins-executor/plugins-executor-jruby/src/main/java/org/onap/policy/apex/plugins/executor/jruby/JrubyStateFinalizerExecutor.java
@@ -113,7 +113,7 @@
      */
     @Override
     public void cleanUp() throws StateMachineException {
-        LOGGER.debug("cleanUp:" + getSubject().getKey().getID() + "," + getSubject().getLogicFlavour() + ","
+        LOGGER.debug("cleanUp:" + getSubject().getKey().getId() + "," + getSubject().getLogicFlavour() + ","
                 + getSubject().getLogic());
         container.terminate();
         container = null;
diff --git a/plugins/plugins-executor/plugins-executor-jruby/src/main/java/org/onap/policy/apex/plugins/executor/jruby/JrubyTaskExecutor.java b/plugins/plugins-executor/plugins-executor-jruby/src/main/java/org/onap/policy/apex/plugins/executor/jruby/JrubyTaskExecutor.java
index 8db650f..56b28d0 100644
--- a/plugins/plugins-executor/plugins-executor-jruby/src/main/java/org/onap/policy/apex/plugins/executor/jruby/JrubyTaskExecutor.java
+++ b/plugins/plugins-executor/plugins-executor-jruby/src/main/java/org/onap/policy/apex/plugins/executor/jruby/JrubyTaskExecutor.java
@@ -113,7 +113,7 @@
      */
     @Override
     public void cleanUp() throws StateMachineException {
-        LOGGER.debug("cleanUp:" + getSubject().getKey().getID() + "," + getSubject().getTaskLogic().getLogicFlavour()
+        LOGGER.debug("cleanUp:" + getSubject().getKey().getId() + "," + getSubject().getTaskLogic().getLogicFlavour()
                 + "," + getSubject().getTaskLogic().getLogic());
         container.terminate();
         container = null;
diff --git a/plugins/plugins-executor/plugins-executor-jruby/src/main/java/org/onap/policy/apex/plugins/executor/jruby/JrubyTaskSelectExecutor.java b/plugins/plugins-executor/plugins-executor-jruby/src/main/java/org/onap/policy/apex/plugins/executor/jruby/JrubyTaskSelectExecutor.java
index 85c7ba0..8405f4e 100644
--- a/plugins/plugins-executor/plugins-executor-jruby/src/main/java/org/onap/policy/apex/plugins/executor/jruby/JrubyTaskSelectExecutor.java
+++ b/plugins/plugins-executor/plugins-executor-jruby/src/main/java/org/onap/policy/apex/plugins/executor/jruby/JrubyTaskSelectExecutor.java
@@ -114,7 +114,7 @@
      */
     @Override
     public void cleanUp() throws StateMachineException {
-        LOGGER.debug("cleanUp:" + getSubject().getKey().getID() + ","
+        LOGGER.debug("cleanUp:" + getSubject().getKey().getId() + ","
                 + getSubject().getTaskSelectionLogic().getLogicFlavour() + ","
                 + getSubject().getTaskSelectionLogic().getLogic());
         container.terminate();
diff --git a/plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonTaskExecutor.java b/plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonTaskExecutor.java
index 71dce58..e1c0f09 100644
--- a/plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonTaskExecutor.java
+++ b/plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonTaskExecutor.java
@@ -67,8 +67,8 @@
                 compiled = Py.compile_flags(logic, filename, CompileMode.exec, new CompilerFlags());
             }
         } catch (final PyException e) {
-            LOGGER.warn("failed to compile Jython code for task " + getSubject().getKey().getID(), e);
-            throw new StateMachineException("failed to compile Jython code for task " + getSubject().getKey().getID(),
+            LOGGER.warn("failed to compile Jython code for task " + getSubject().getKey().getId(), e);
+            throw new StateMachineException("failed to compile Jython code for task " + getSubject().getKey().getId(),
                     e);
         }
 
@@ -104,24 +104,24 @@
                     final Object ret = interpreter.get("returnValue", java.lang.Boolean.class);
                     if (ret == null) {
                         LOGGER.error("execute: task logic failed to set a return value for task  \""
-                                + getSubject().getKey().getID() + "\"");
+                                + getSubject().getKey().getId() + "\"");
                         throw new StateMachineException("execute: task logic failed to set a return value for task  \""
-                                + getSubject().getKey().getID() + "\"");
+                                + getSubject().getKey().getId() + "\"");
                     }
                     returnValue = (Boolean) ret;
                 } catch (NullPointerException | ClassCastException e) {
                     LOGGER.error("execute: task selection logic failed to set a correct return value for state  \""
-                            + getSubject().getKey().getID() + "\"", e);
+                            + getSubject().getKey().getId() + "\"", e);
                     throw new StateMachineException(
                             "execute: task selection logic failed to set a return value for state  \""
-                                    + getSubject().getKey().getID() + "\"",
+                                    + getSubject().getKey().getId() + "\"",
                             e);
                 }
             }
             /* */
         } catch (final Exception e) {
-            LOGGER.warn("failed to execute Jython code for task " + getSubject().getKey().getID(), e);
-            throw new StateMachineException("failed to execute Jython code for task " + getSubject().getKey().getID(),
+            LOGGER.warn("failed to execute Jython code for task " + getSubject().getKey().getId(), e);
+            throw new StateMachineException("failed to execute Jython code for task " + getSubject().getKey().getId(),
                     e);
         }
 
@@ -144,7 +144,7 @@
     @Override
     public void cleanUp() throws StateMachineException {
         interpreter.cleanup();
-        LOGGER.debug("cleanUp:" + getSubject().getKey().getID() + "," + getSubject().getTaskLogic().getLogicFlavour()
+        LOGGER.debug("cleanUp:" + getSubject().getKey().getId() + "," + getSubject().getTaskLogic().getLogicFlavour()
                 + "," + getSubject().getTaskLogic().getLogic());
     }
 }
diff --git a/plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonTaskSelectExecutor.java b/plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonTaskSelectExecutor.java
index d28001d..4f4d38a 100644
--- a/plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonTaskSelectExecutor.java
+++ b/plugins/plugins-executor/plugins-executor-jython/src/main/java/org/onap/policy/apex/plugins/executor/jython/JythonTaskSelectExecutor.java
@@ -66,10 +66,10 @@
                 compiled = Py.compile_flags(logic, filename, CompileMode.exec, new CompilerFlags());
             }
         } catch (final PyException e) {
-            LOGGER.warn("failed to compile Jython code for task selection logic in " + getSubject().getKey().getID(),
+            LOGGER.warn("failed to compile Jython code for task selection logic in " + getSubject().getKey().getId(),
                     e);
             throw new StateMachineException(
-                    "failed to compile Jython code for task selection logic in " + getSubject().getKey().getID(), e);
+                    "failed to compile Jython code for task selection logic in " + getSubject().getKey().getId(), e);
         }
 
     }
@@ -104,27 +104,27 @@
                     final Object ret = interpreter.get("returnValue", java.lang.Boolean.class);
                     if (ret == null) {
                         LOGGER.error("execute: task selection logic failed to set a return value for state  \""
-                                + getSubject().getKey().getID() + "\"");
+                                + getSubject().getKey().getId() + "\"");
                         throw new StateMachineException(
                                 "execute: task selection logic failed to set a return value for state  \""
-                                        + getSubject().getKey().getID() + "\"");
+                                        + getSubject().getKey().getId() + "\"");
                     }
                     returnValue = (Boolean) ret;
                 } catch (NullPointerException | ClassCastException e) {
                     LOGGER.error("execute: task selection logic failed to set a correct return value for state  \""
-                            + getSubject().getKey().getID() + "\"", e);
+                            + getSubject().getKey().getId() + "\"", e);
                     throw new StateMachineException(
                             "execute: task selection logic failed to set a return value for state  \""
-                                    + getSubject().getKey().getID() + "\"",
+                                    + getSubject().getKey().getId() + "\"",
                             e);
                 }
             }
             /* */
         } catch (final Exception e) {
-            LOGGER.warn("failed to execute Jython code for task selection logic in " + getSubject().getKey().getID(),
+            LOGGER.warn("failed to execute Jython code for task selection logic in " + getSubject().getKey().getId(),
                     e);
             throw new StateMachineException(
-                    "failed to execute Jython code for task selection logic in " + getSubject().getKey().getID(), e);
+                    "failed to execute Jython code for task selection logic in " + getSubject().getKey().getId(), e);
         }
 
         // Do the execution post work
@@ -146,7 +146,7 @@
     @Override
     public void cleanUp() throws StateMachineException {
         interpreter.cleanup();
-        LOGGER.debug("cleanUp:" + getSubject().getKey().getID() + ","
+        LOGGER.debug("cleanUp:" + getSubject().getKey().getId() + ","
                 + getSubject().getTaskSelectionLogic().getLogicFlavour() + ","
                 + getSubject().getTaskSelectionLogic().getLogic());
     }
diff --git a/plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelStateFinalizerExecutor.java b/plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelStateFinalizerExecutor.java
index 8cd76a9..ea39c6d 100644
--- a/plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelStateFinalizerExecutor.java
+++ b/plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelStateFinalizerExecutor.java
@@ -59,8 +59,8 @@
         try {
             compiled = MVEL.compileExpression(getSubject().getLogic());
         } catch (final Exception e) {
-            LOGGER.warn("failed to compile MVEL code for state " + getSubject().getKey().getID(), e);
-            throw new StateMachineException("failed to compile MVEL code for state " + getSubject().getKey().getID(),
+            LOGGER.warn("failed to compile MVEL code for state " + getSubject().getKey().getId(), e);
+            throw new StateMachineException("failed to compile MVEL code for state " + getSubject().getKey().getId(),
                     e);
         }
     }
@@ -89,8 +89,8 @@
             returnValue =
                     (boolean) MVEL.executeExpression(compiled, getExecutionContext(), new HashMap<String, Object>());
         } catch (final Exception e) {
-            LOGGER.warn("failed to execute MVEL code for state " + getSubject().getKey().getID(), e);
-            throw new StateMachineException("failed to execute MVEL code for state " + getSubject().getKey().getID(),
+            LOGGER.warn("failed to execute MVEL code for state " + getSubject().getKey().getId(), e);
+            throw new StateMachineException("failed to execute MVEL code for state " + getSubject().getKey().getId(),
                     e);
         }
 
@@ -112,7 +112,7 @@
      */
     @Override
     public void cleanUp() throws StateMachineException {
-        LOGGER.debug("cleanUp:" + getSubject().getKey().getID() + "," + getSubject().getLogicFlavour() + ","
+        LOGGER.debug("cleanUp:" + getSubject().getKey().getId() + "," + getSubject().getLogicFlavour() + ","
                 + getSubject().getLogic());
     }
 }
diff --git a/plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelTaskExecutor.java b/plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelTaskExecutor.java
index 8599eab..966a800 100644
--- a/plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelTaskExecutor.java
+++ b/plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelTaskExecutor.java
@@ -59,8 +59,8 @@
         try {
             compiled = MVEL.compileExpression(getSubject().getTaskLogic().getLogic());
         } catch (final Exception e) {
-            LOGGER.warn("failed to compile MVEL code for task " + getSubject().getKey().getID(), e);
-            throw new StateMachineException("failed to compile MVEL code for task " + getSubject().getKey().getID(), e);
+            LOGGER.warn("failed to compile MVEL code for task " + getSubject().getKey().getId(), e);
+            throw new StateMachineException("failed to compile MVEL code for task " + getSubject().getKey().getId(), e);
         }
         argumentNotNull(compiled, "MVEL task not compiled.");
     }
@@ -89,8 +89,8 @@
             returnValue =
                     (boolean) MVEL.executeExpression(compiled, getExecutionContext(), new HashMap<String, Object>());
         } catch (final Exception e) {
-            LOGGER.warn("failed to execute MVEL code for task " + getSubject().getKey().getID(), e);
-            throw new StateMachineException("failed to execute MVEL code for task " + getSubject().getKey().getID(), e);
+            LOGGER.warn("failed to execute MVEL code for task " + getSubject().getKey().getId(), e);
+            throw new StateMachineException("failed to execute MVEL code for task " + getSubject().getKey().getId(), e);
         }
 
         // Do the execution post work
@@ -111,7 +111,7 @@
      */
     @Override
     public void cleanUp() throws StateMachineException {
-        LOGGER.debug("cleanUp:" + getSubject().getKey().getID() + "," + getSubject().getTaskLogic().getLogicFlavour()
+        LOGGER.debug("cleanUp:" + getSubject().getKey().getId() + "," + getSubject().getTaskLogic().getLogicFlavour()
                 + "," + getSubject().getTaskLogic().getLogic());
     }
 }
diff --git a/plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelTaskSelectExecutor.java b/plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelTaskSelectExecutor.java
index 3cb5d9b..4991fba 100644
--- a/plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelTaskSelectExecutor.java
+++ b/plugins/plugins-executor/plugins-executor-mvel/src/main/java/org/onap/policy/apex/plugins/executor/mvel/MvelTaskSelectExecutor.java
@@ -60,8 +60,8 @@
         try {
             compiled = MVEL.compileExpression(getSubject().getTaskSelectionLogic().getLogic());
         } catch (final Exception e) {
-            LOGGER.warn("failed to compile MVEL code for state " + getSubject().getKey().getID(), e);
-            throw new StateMachineException("failed to compile MVEL code for state " + getSubject().getKey().getID(),
+            LOGGER.warn("failed to compile MVEL code for state " + getSubject().getKey().getId(), e);
+            throw new StateMachineException("failed to compile MVEL code for state " + getSubject().getKey().getId(),
                     e);
         }
     }
@@ -90,8 +90,8 @@
             returnValue =
                     (boolean) MVEL.executeExpression(compiled, getExecutionContext(), new HashMap<String, Object>());
         } catch (final Exception e) {
-            LOGGER.warn("failed to execute MVEL code for state " + getSubject().getKey().getID(), e);
-            throw new StateMachineException("failed to execute MVEL code for state " + getSubject().getKey().getID(),
+            LOGGER.warn("failed to execute MVEL code for state " + getSubject().getKey().getId(), e);
+            throw new StateMachineException("failed to execute MVEL code for state " + getSubject().getKey().getId(),
                     e);
         }
 
@@ -113,7 +113,7 @@
      */
     @Override
     public void cleanUp() throws StateMachineException {
-        LOGGER.debug("cleanUp:" + getSubject().getKey().getID() + ","
+        LOGGER.debug("cleanUp:" + getSubject().getKey().getId() + ","
                 + getSubject().getTaskSelectionLogic().getLogicFlavour() + ","
                 + getSubject().getTaskSelectionLogic().getLogic());
     }
diff --git a/plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-eclipselink/src/test/java/org/onap/policy/apex/plugins/persistence/jpa/eclipselink/EclipselinkApexDaoTest.java b/plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-eclipselink/src/test/java/org/onap/policy/apex/plugins/persistence/jpa/eclipselink/EclipselinkApexDaoTest.java
index d33621e..4a27bcf 100644
--- a/plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-eclipselink/src/test/java/org/onap/policy/apex/plugins/persistence/jpa/eclipselink/EclipselinkApexDaoTest.java
+++ b/plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-eclipselink/src/test/java/org/onap/policy/apex/plugins/persistence/jpa/eclipselink/EclipselinkApexDaoTest.java
@@ -37,7 +37,7 @@
 import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
 import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
 import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey;
-import org.onap.policy.apex.model.basicmodel.dao.DAOParameters;
+import org.onap.policy.apex.model.basicmodel.dao.DaoParameters;
 
 /**
  * Junit tests for class EclipselinkApexDao
@@ -51,16 +51,16 @@
     private static final List<AxArtifactKey> TEST_ARTIKEYS = Arrays.asList(new AxArtifactKey[] {
             new AxArtifactKey("ABC", "0.0.1"), new AxArtifactKey("DEF", "0.1.1"), new AxArtifactKey("XYZ", "1.1.1")});
 
-    private final DAOParameters daoParameters = new DAOParameters();
+    private final DaoParameters DaoParameters = new DaoParameters();
 
     private EclipselinkApexDao eclipselinkApexDao = null;
 
     @Before
     public void setup() throws ApexException {
-        daoParameters.setPluginClass(EclipselinkApexDao.class.getCanonicalName());
-        daoParameters.setPersistenceUnit("DAOTest");
+        DaoParameters.setPluginClass(EclipselinkApexDao.class.getCanonicalName());
+        DaoParameters.setPersistenceUnit("DAOTest");
         eclipselinkApexDao = new EclipselinkApexDao();
-        eclipselinkApexDao.init(daoParameters);
+        eclipselinkApexDao.init(DaoParameters);
     }
 
     @After
diff --git a/plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-hibernate/src/main/java/org/onap/policy/apex/plugins/persistence/jpa/hibernate/HibernateApexDao.java b/plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-hibernate/src/main/java/org/onap/policy/apex/plugins/persistence/jpa/hibernate/HibernateApexDao.java
index 2d60e37..087535d 100644
--- a/plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-hibernate/src/main/java/org/onap/policy/apex/plugins/persistence/jpa/hibernate/HibernateApexDao.java
+++ b/plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-hibernate/src/main/java/org/onap/policy/apex/plugins/persistence/jpa/hibernate/HibernateApexDao.java
@@ -239,7 +239,7 @@
         }
         if (ret.size() > 1) {
             throw new IllegalArgumentException("More than one result was returned for search for " + aClass
-                    + " with key " + key.getID() + ": " + ret);
+                    + " with key " + key.getId() + ": " + ret);
         }
         return ret.get(0);
     }
@@ -269,7 +269,7 @@
         }
         if (ret.size() > 1) {
             throw new IllegalArgumentException("More than one result was returned for search for " + aClass
-                    + " with key " + key.getID() + ": " + ret);
+                    + " with key " + key.getId() + ": " + ret);
         }
         return ret.get(0);
     }
diff --git a/plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-hibernate/src/test/java/org/onap/policy/apex/plugins/persistence/jpa/hibernate/HibernateApexDaoTest.java b/plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-hibernate/src/test/java/org/onap/policy/apex/plugins/persistence/jpa/hibernate/HibernateApexDaoTest.java
index 851332b..1f100fd 100644
--- a/plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-hibernate/src/test/java/org/onap/policy/apex/plugins/persistence/jpa/hibernate/HibernateApexDaoTest.java
+++ b/plugins/plugins-persistence/plugins-persistence-jpa/plugins-persistence-jpa-hibernate/src/test/java/org/onap/policy/apex/plugins/persistence/jpa/hibernate/HibernateApexDaoTest.java
@@ -37,7 +37,7 @@
 import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
 import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
 import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey;
-import org.onap.policy.apex.model.basicmodel.dao.DAOParameters;
+import org.onap.policy.apex.model.basicmodel.dao.DaoParameters;
 
 /**
  * Junit test for class HibernateApexDao
@@ -51,16 +51,16 @@
     private static final List<AxArtifactKey> TEST_ARTIKEYS = Arrays.asList(new AxArtifactKey[] {
             new AxArtifactKey("ABC", "0.0.1"), new AxArtifactKey("DEF", "0.1.1"), new AxArtifactKey("XYZ", "1.1.1")});
 
-    private final DAOParameters daoParameters = new DAOParameters();
+    private final DaoParameters DaoParameters = new DaoParameters();
 
     private HibernateApexDao hibernateApexDao = null;
 
     @Before
     public void setupDAO() throws ApexException {
-        daoParameters.setPluginClass(HibernateApexDao.class.getCanonicalName());
-        daoParameters.setPersistenceUnit("DAOTest");
+        DaoParameters.setPluginClass(HibernateApexDao.class.getCanonicalName());
+        DaoParameters.setPersistenceUnit("DAOTest");
         hibernateApexDao = new HibernateApexDao();
-        hibernateApexDao.init(daoParameters);
+        hibernateApexDao.init(DaoParameters);
     }
 
     @After
diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/engdep/EngDepMessageListener.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/engdep/EngDepMessageListener.java
index 1bc88a4..3840e91 100644
--- a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/engdep/EngDepMessageListener.java
+++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/engdep/EngDepMessageListener.java
@@ -203,90 +203,90 @@
             switch (enDepAction) {
                 case GET_ENGINE_SERVICE_INFO:
                     final GetEngineServiceInfo engineServiceInformationMessage = (GetEngineServiceInfo) message;
-                    LOGGER.debug("getting engine service information for engine service " + apexService.getKey().getID()
+                    LOGGER.debug("getting engine service information for engine service " + apexService.getKey().getId()
                             + " . . .");
                     // Send a reply with the engine service information
                     sendServiceInfoReply(webSocket, engineServiceInformationMessage, apexService.getKey(),
                             apexService.getEngineKeys(), apexService.getApexModelKey());
                     LOGGER.debug(
-                            "returned engine service information for engine service " + apexService.getKey().getID());
+                            "returned engine service information for engine service " + apexService.getKey().getId());
                     break;
 
                 case UPDATE_MODEL:
                     final UpdateModel updateModelMessage = (UpdateModel) message;
-                    LOGGER.debug("updating model in engine {} . . .", updateModelMessage.getTarget().getID());
+                    LOGGER.debug("updating model in engine {} . . .", updateModelMessage.getTarget().getId());
                     // Update the model
                     apexService.updateModel(updateModelMessage.getTarget(), updateModelMessage.getMessageData(),
                             updateModelMessage.isForceInstall());
                     // Send a reply indicating the message action worked
                     sendReply(webSocket, updateModelMessage, true,
-                            "updated model in engine " + updateModelMessage.getTarget().getID());
-                    LOGGER.debug("updated model in engine service {}", updateModelMessage.getTarget().getID());
+                            "updated model in engine " + updateModelMessage.getTarget().getId());
+                    LOGGER.debug("updated model in engine service {}", updateModelMessage.getTarget().getId());
                     break;
 
                 case START_ENGINE:
                     final StartEngine startEngineMessage = (StartEngine) message;
-                    LOGGER.debug("starting engine {} . . .", startEngineMessage.getTarget().getID());
+                    LOGGER.debug("starting engine {} . . .", startEngineMessage.getTarget().getId());
                     // Start the engine
                     apexService.start(startEngineMessage.getTarget());
                     // Send a reply indicating the message action worked
                     sendReply(webSocket, startEngineMessage, true,
-                            "started engine " + startEngineMessage.getTarget().getID());
-                    LOGGER.debug("started engine {}", startEngineMessage.getTarget().getID());
+                            "started engine " + startEngineMessage.getTarget().getId());
+                    LOGGER.debug("started engine {}", startEngineMessage.getTarget().getId());
                     break;
 
                 case STOP_ENGINE:
                     final StopEngine stopEngineMessage = (StopEngine) message;
-                    LOGGER.debug("stopping engine {} . . .", stopEngineMessage.getTarget().getID());
+                    LOGGER.debug("stopping engine {} . . .", stopEngineMessage.getTarget().getId());
                     // Stop the engine
                     apexService.stop(stopEngineMessage.getTarget());
                     // Send a reply indicating the message action worked
                     sendReply(webSocket, stopEngineMessage, true,
-                            "stopped engine " + stopEngineMessage.getTarget().getID());
-                    LOGGER.debug("stopping engine {}", stopEngineMessage.getTarget().getID());
+                            "stopped engine " + stopEngineMessage.getTarget().getId());
+                    LOGGER.debug("stopping engine {}", stopEngineMessage.getTarget().getId());
                     break;
 
                 case START_PERIODIC_EVENTS:
                     final StartPeriodicEvents startPeriodicEventsMessage = (StartPeriodicEvents) message;
                     LOGGER.debug("starting periodic events on engine {} . . .",
-                            startPeriodicEventsMessage.getTarget().getID());
+                            startPeriodicEventsMessage.getTarget().getId());
                     // Start periodic events with the period specified in the message
                     final Long period = Long.parseLong(startPeriodicEventsMessage.getMessageData());
                     apexService.startPeriodicEvents(period);
                     // Send a reply indicating the message action worked
                     sendReply(webSocket, startPeriodicEventsMessage, true, "started periodic events on engine "
-                            + startPeriodicEventsMessage.getTarget().getID() + " with period " + period);
-                    LOGGER.debug("started periodic events on engine " + startPeriodicEventsMessage.getTarget().getID()
+                            + startPeriodicEventsMessage.getTarget().getId() + " with period " + period);
+                    LOGGER.debug("started periodic events on engine " + startPeriodicEventsMessage.getTarget().getId()
                             + " with period " + period);
                     break;
 
                 case STOP_PERIODIC_EVENTS:
                     final StopPeriodicEvents stopPeriodicEventsMessage = (StopPeriodicEvents) message;
                     LOGGER.debug("stopping periodic events on engine {} . . .",
-                            stopPeriodicEventsMessage.getTarget().getID());
+                            stopPeriodicEventsMessage.getTarget().getId());
                     // Stop periodic events
                     apexService.stopPeriodicEvents();
                     // Send a reply indicating the message action worked
                     sendReply(webSocket, stopPeriodicEventsMessage, true,
-                            "stopped periodic events on engine " + stopPeriodicEventsMessage.getTarget().getID());
-                    LOGGER.debug("stopped periodic events on engine " + stopPeriodicEventsMessage.getTarget().getID());
+                            "stopped periodic events on engine " + stopPeriodicEventsMessage.getTarget().getId());
+                    LOGGER.debug("stopped periodic events on engine " + stopPeriodicEventsMessage.getTarget().getId());
                     break;
 
                 case GET_ENGINE_STATUS:
                     final GetEngineStatus getEngineStatusMessage = (GetEngineStatus) message;
-                    LOGGER.debug("getting status for engine{} . . .", getEngineStatusMessage.getTarget().getID());
+                    LOGGER.debug("getting status for engine{} . . .", getEngineStatusMessage.getTarget().getId());
                     // Send a reply with the engine status
                     sendReply(webSocket, getEngineStatusMessage, true,
                             apexService.getStatus(getEngineStatusMessage.getTarget()));
-                    LOGGER.debug("returned status for engine {}", getEngineStatusMessage.getTarget().getID());
+                    LOGGER.debug("returned status for engine {}", getEngineStatusMessage.getTarget().getId());
                     break;
 
                 case GET_ENGINE_INFO:
                     final GetEngineInfo getEngineInfo = (GetEngineInfo) message;
-                    LOGGER.debug("getting runtime information for engine {} . . .", getEngineInfo.getTarget().getID());
+                    LOGGER.debug("getting runtime information for engine {} . . .", getEngineInfo.getTarget().getId());
                     // Send a reply with the engine runtime information
                     sendReply(webSocket, getEngineInfo, true, apexService.getRuntimeInfo(getEngineInfo.getTarget()));
-                    LOGGER.debug("returned runtime information for engine {}", getEngineInfo.getTarget().getID());
+                    LOGGER.debug("returned runtime information for engine {}", getEngineInfo.getTarget().getId());
                     break;
                 case RESPONSE:
                     throw new ApexException("RESPONSE action on received message not handled by engine");
diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/jsonprotocolplugin/Apex2JSONEventConverter.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/jsonprotocolplugin/Apex2JSONEventConverter.java
index 21e4cd1..30e9db7 100644
--- a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/jsonprotocolplugin/Apex2JSONEventConverter.java
+++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/jsonprotocolplugin/Apex2JSONEventConverter.java
@@ -176,7 +176,7 @@
 
             if (!apexEvent.containsKey(fieldName)) {
                 if (!eventField.getOptional()) {
-                    final String errorMessage = "error parsing " + eventDefinition.getID() + " event to Json. "
+                    final String errorMessage = "error parsing " + eventDefinition.getId() + " event to Json. "
                             + "Field \"" + fieldName + "\" is missing, but is mandatory. Fields: " + apexEvent;
                     LOGGER.debug(errorMessage);
                     throw new ApexEventRuntimeException(errorMessage);
@@ -240,7 +240,7 @@
             final String fieldName = eventField.getKey().getLocalName();
             if (!hasJSONField(jsonObject, fieldName)) {
                 if (!eventField.getOptional()) {
-                    final String errorMessage = "error parsing " + eventDefinition.getID() + " event from Json. "
+                    final String errorMessage = "error parsing " + eventDefinition.getId() + " event from Json. "
                             + "Field \"" + fieldName + "\" is missing, but is mandatory.";
                     LOGGER.debug(errorMessage);
                     throw new ApexEventException(errorMessage);
diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/runtime/impl/EngineServiceImpl.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/runtime/impl/EngineServiceImpl.java
index ee5f9ae..d5cb055 100644
--- a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/runtime/impl/EngineServiceImpl.java
+++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/runtime/impl/EngineServiceImpl.java
@@ -113,7 +113,7 @@
             final AxArtifactKey engineWorkerKey =
                     new AxArtifactKey(engineServiceKey.getName() + '-' + engineCounter, engineServiceKey.getVersion());
             engineWorkerMap.put(engineWorkerKey, new EngineWorker(engineWorkerKey, queue, atFactory));
-            LOGGER.info("Created apex engine {} .", engineWorkerKey.getID());
+            LOGGER.info("Created apex engine {} .", engineWorkerKey.getId());
         }
 
         LOGGER.info("APEX service created.");
@@ -272,9 +272,9 @@
         // Check if the Apex model specified is sane
         if (apexModelString == null || apexModelString.trim().length() == 0) {
             LOGGER.warn(
-                    "model for updating on engine service with key " + incomingEngineServiceKey.getID() + " is empty");
+                    "model for updating on engine service with key " + incomingEngineServiceKey.getId() + " is empty");
             throw new ApexException(
-                    "model for updating on engine service with key " + incomingEngineServiceKey.getID() + " is empty");
+                    "model for updating on engine service with key " + incomingEngineServiceKey.getId() + " is empty");
         }
 
         // Read the Apex model into memory using the Apex Model Reader
@@ -283,14 +283,14 @@
             final ApexModelReader<AxPolicyModel> modelReader = new ApexModelReader<>(AxPolicyModel.class);
             apexPolicyModel = modelReader.read(new ByteArrayInputStream(apexModelString.getBytes()));
         } catch (final ApexModelException e) {
-            LOGGER.error("failed to unmarshal the apex model on engine service " + incomingEngineServiceKey.getID(), e);
+            LOGGER.error("failed to unmarshal the apex model on engine service " + incomingEngineServiceKey.getId(), e);
             throw new ApexException(
-                    "failed to unmarshal the apex model on engine service " + incomingEngineServiceKey.getID(), e);
+                    "failed to unmarshal the apex model on engine service " + incomingEngineServiceKey.getId(), e);
         }
 
         if (apexPolicyModel == null) {
-            LOGGER.error("apex model null on engine service " + incomingEngineServiceKey.getID());
-            throw new ApexException("apex model null on engine service " + incomingEngineServiceKey.getID());
+            LOGGER.error("apex model null on engine service " + incomingEngineServiceKey.getId());
+            throw new ApexException("apex model null on engine service " + incomingEngineServiceKey.getId());
         }
 
         // Update the model
@@ -315,17 +315,17 @@
         // Check if the Apex model specified is sane
         if (apexModel == null) {
             LOGGER.warn(
-                    "model for updating on engine service with key " + incomingEngineServiceKey.getID() + " is null");
+                    "model for updating on engine service with key " + incomingEngineServiceKey.getId() + " is null");
             throw new ApexException(
-                    "model for updating on engine service with key " + incomingEngineServiceKey.getID() + " is null");
+                    "model for updating on engine service with key " + incomingEngineServiceKey.getId() + " is null");
         }
 
         // Check if the key on the update request is correct
         if (!this.engineServiceKey.equals(incomingEngineServiceKey)) {
-            LOGGER.warn("engine service key " + incomingEngineServiceKey.getID() + " does not match the key"
-                    + engineServiceKey.getID() + " of this engine service");
-            throw new ApexException("engine service key " + incomingEngineServiceKey.getID() + " does not match the key"
-                    + engineServiceKey.getID() + " of this engine service");
+            LOGGER.warn("engine service key " + incomingEngineServiceKey.getId() + " does not match the key"
+                    + engineServiceKey.getId() + " of this engine service");
+            throw new ApexException("engine service key " + incomingEngineServiceKey.getId() + " does not match the key"
+                    + engineServiceKey.getId() + " of this engine service");
         }
 
         // Check model compatibility
@@ -334,14 +334,14 @@
             final AxPolicyModel currentModel = ModelService.getModel(AxPolicyModel.class);
             if (!currentModel.getKey().isCompatible(apexModel.getKey())) {
                 if (forceFlag) {
-                    LOGGER.warn("apex model update forced, supplied model with key \"" + apexModel.getKey().getID()
+                    LOGGER.warn("apex model update forced, supplied model with key \"" + apexModel.getKey().getId()
                             + "\" is not a compatible model update from the existing engine model with key \""
-                            + currentModel.getKey().getID() + "\"");
+                            + currentModel.getKey().getId() + "\"");
                 } else {
                     throw new ContextException(
-                            "apex model update failed, supplied model with key \"" + apexModel.getKey().getID()
+                            "apex model update failed, supplied model with key \"" + apexModel.getKey().getId()
                                     + "\" is not a compatible model update from the existing engine model with key \""
-                                    + currentModel.getKey().getID() + "\"");
+                                    + currentModel.getKey().getId() + "\"");
                 }
             }
         }
@@ -359,7 +359,7 @@
             final StringBuilder notStoppedEngineIDBuilder = new StringBuilder();
             for (final Entry<AxArtifactKey, EngineService> engineWorkerEntry : engineWorkerMap.entrySet()) {
                 if (engineWorkerEntry.getValue().getState() != AxEngineState.STOPPED) {
-                    notStoppedEngineIDBuilder.append(engineWorkerEntry.getKey().getID());
+                    notStoppedEngineIDBuilder.append(engineWorkerEntry.getKey().getId());
                     notStoppedEngineIDBuilder.append('(');
                     notStoppedEngineIDBuilder.append(engineWorkerEntry.getValue().getState());
                     notStoppedEngineIDBuilder.append(") ");
@@ -367,7 +367,7 @@
             }
             if (notStoppedEngineIDBuilder.length() > 0) {
                 final String errorString = "cannot update model on engine service with key "
-                        + incomingEngineServiceKey.getID() + ", engines not stopped after " + MAX_STOP_WAIT_TIME
+                        + incomingEngineServiceKey.getId() + ", engines not stopped after " + MAX_STOP_WAIT_TIME
                         + "ms are: " + notStoppedEngineIDBuilder.toString().trim();
                 LOGGER.warn(errorString);
                 throw new ApexException(errorString);
@@ -376,7 +376,7 @@
 
         // Update the engines
         for (final Entry<AxArtifactKey, EngineService> engineWorkerEntry : engineWorkerMap.entrySet()) {
-            LOGGER.info("Registering apex model on engine {}", engineWorkerEntry.getKey().getID());
+            LOGGER.info("Registering apex model on engine {}", engineWorkerEntry.getKey().getId());
             engineWorkerEntry.getValue().updateModel(engineWorkerEntry.getKey(), apexModel, forceFlag);
         }
 
@@ -392,7 +392,7 @@
             for (final Entry<AxArtifactKey, EngineService> engineWorkerEntry : engineWorkerMap.entrySet()) {
                 if (engineWorkerEntry.getValue().getState() != AxEngineState.READY
                         && engineWorkerEntry.getValue().getState() != AxEngineState.EXECUTING) {
-                    notRunningEngineIDBuilder.append(engineWorkerEntry.getKey().getID());
+                    notRunningEngineIDBuilder.append(engineWorkerEntry.getKey().getId());
                     notRunningEngineIDBuilder.append('(');
                     notRunningEngineIDBuilder.append(engineWorkerEntry.getValue().getState());
                     notRunningEngineIDBuilder.append(") ");
@@ -400,7 +400,7 @@
             }
             if (notRunningEngineIDBuilder.length() > 0) {
                 final String errorString = "engine start error on model update on engine service with key "
-                        + incomingEngineServiceKey.getID() + ", engines not running are: "
+                        + incomingEngineServiceKey.getId() + ", engines not running are: "
                         + notRunningEngineIDBuilder.toString().trim();
                 LOGGER.warn(errorString);
                 throw new ApexException(errorString);
@@ -457,8 +457,8 @@
 
         // Check if we have this key on our map
         if (!engineWorkerMap.containsKey(engineKey)) {
-            LOGGER.warn("engine with key " + engineKey.getID() + " not found in engine service");
-            throw new ApexException("engine with key " + engineKey.getID() + " not found in engine service");
+            LOGGER.warn("engine with key " + engineKey.getId() + " not found in engine service");
+            throw new ApexException("engine with key " + engineKey.getId() + " not found in engine service");
         }
 
         // Start the engine
@@ -499,8 +499,8 @@
 
         // Check if we have this key on our map
         if (!engineWorkerMap.containsKey(engineKey)) {
-            LOGGER.warn("engine with key " + engineKey.getID() + " not found in engine service");
-            throw new ApexException("engine with key " + engineKey.getID() + " not found in engine service");
+            LOGGER.warn("engine with key " + engineKey.getId() + " not found in engine service");
+            throw new ApexException("engine with key " + engineKey.getId() + " not found in engine service");
         }
 
         // Stop the engine
@@ -536,7 +536,7 @@
     public boolean isStarted(final AxArtifactKey engineKey) {
         // Check if we have this key on our map
         if (!engineWorkerMap.containsKey(engineKey)) {
-            LOGGER.warn("engine with key " + engineKey.getID() + " not found in engine service");
+            LOGGER.warn("engine with key " + engineKey.getId() + " not found in engine service");
         }
         return engineWorkerMap.get(engineKey).isStarted();
     }
@@ -568,7 +568,7 @@
     public boolean isStopped(final AxArtifactKey engineKey) {
         // Check if we have this key on our map
         if (!engineWorkerMap.containsKey(engineKey)) {
-            LOGGER.warn("engine with key " + engineKey.getID() + " not found in engine service");
+            LOGGER.warn("engine with key " + engineKey.getId() + " not found in engine service");
         }
         return engineWorkerMap.get(engineKey).isStopped();
     }
@@ -582,9 +582,9 @@
     public void startPeriodicEvents(final long period) throws ApexException {
         // Check if periodic events are already started
         if (periodicEventGenerator != null) {
-            LOGGER.warn("Peiodic event geneation already running on engine " + engineServiceKey.getID() + ", "
+            LOGGER.warn("Peiodic event geneation already running on engine " + engineServiceKey.getId() + ", "
                     + periodicEventGenerator.toString());
-            throw new ApexException("Peiodic event geneation already running on engine " + engineServiceKey.getID()
+            throw new ApexException("Peiodic event geneation already running on engine " + engineServiceKey.getId()
                     + ", " + periodicEventGenerator.toString());
         }
 
@@ -605,8 +605,8 @@
     public void stopPeriodicEvents() throws ApexException {
         // Check if periodic events are already started
         if (periodicEventGenerator == null) {
-            LOGGER.warn("Peiodic event geneation not running on engine " + engineServiceKey.getID());
-            throw new ApexException("Peiodic event geneation not running on engine " + engineServiceKey.getID());
+            LOGGER.warn("Peiodic event geneation not running on engine " + engineServiceKey.getId());
+            throw new ApexException("Peiodic event geneation not running on engine " + engineServiceKey.getId());
         }
 
         // Stop periodic events
@@ -625,8 +625,8 @@
     public String getStatus(final AxArtifactKey engineKey) throws ApexException {
         // Check if we have this key on our map
         if (!engineWorkerMap.containsKey(engineKey)) {
-            LOGGER.warn("engine with key " + engineKey.getID() + " not found in engine service");
-            throw new ApexException("engine with key " + engineKey.getID() + " not found in engine service");
+            LOGGER.warn("engine with key " + engineKey.getId() + " not found in engine service");
+            throw new ApexException("engine with key " + engineKey.getId() + " not found in engine service");
         }
 
         // Return the information for this worker
@@ -644,8 +644,8 @@
     public String getRuntimeInfo(final AxArtifactKey engineKey) throws ApexException {
         // Check if we have this key on our map
         if (!engineWorkerMap.containsKey(engineKey)) {
-            LOGGER.warn("engine with key " + engineKey.getID() + " not found in engine service");
-            throw new ApexException("engine with key " + engineKey.getID() + " not found in engine service");
+            LOGGER.warn("engine with key " + engineKey.getId() + " not found in engine service");
+            throw new ApexException("engine with key " + engineKey.getId() + " not found in engine service");
         }
 
         // Return the information for this worker
@@ -664,12 +664,12 @@
         // Check if we have this key on our map
         if (getState() == AxEngineState.STOPPED) {
             LOGGER.warn("event " + event.getName() + " not processed, no engines on engine service "
-                    + engineServiceKey.getID() + " are running");
+                    + engineServiceKey.getId() + " are running");
             return;
         }
 
         if (event == null) {
-            LOGGER.warn("Null events cannot be processed, in engine service " + engineServiceKey.getID());
+            LOGGER.warn("Null events cannot be processed, in engine service " + engineServiceKey.getId());
             return;
         }
 
diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/runtime/impl/EngineWorker.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/runtime/impl/EngineWorker.java
index f82aae6..be294aa 100644
--- a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/runtime/impl/EngineWorker.java
+++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/runtime/impl/EngineWorker.java
@@ -131,7 +131,7 @@
     public void registerActionListener(final String listenerName, final ApexEventListener apexEventListener) {
         // Sanity checks on the Apex model
         if (engine == null) {
-            LOGGER.warn("listener registration on engine with key " + engineWorkerKey.getID()
+            LOGGER.warn("listener registration on engine with key " + engineWorkerKey.getId()
                     + ", failed, listener is null");
             return;
         }
@@ -150,7 +150,7 @@
     public void deregisterActionListener(final String listenerName) {
         // Sanity checks on the Apex model
         if (engine == null) {
-            LOGGER.warn("listener deregistration on engine with key " + engineWorkerKey.getID()
+            LOGGER.warn("listener deregistration on engine with key " + engineWorkerKey.getId()
                     + ", failed, listener is null");
             return;
         }
@@ -222,13 +222,13 @@
             final ApexModelReader<AxPolicyModel> modelReader = new ApexModelReader<>(AxPolicyModel.class);
             apexPolicyModel = modelReader.read(new ByteArrayInputStream(engineModel.getBytes()));
         } catch (final ApexModelException e) {
-            LOGGER.error("failed to unmarshal the apex model on engine " + engineKey.getID(), e);
-            throw new ApexException("failed to unmarshal the apex model on engine " + engineKey.getID(), e);
+            LOGGER.error("failed to unmarshal the apex model on engine " + engineKey.getId(), e);
+            throw new ApexException("failed to unmarshal the apex model on engine " + engineKey.getId(), e);
         }
 
         if (apexPolicyModel == null) {
-            LOGGER.error("apex model null on engine " + engineKey.getID());
-            throw new ApexException("apex model null on engine " + engineKey.getID());
+            LOGGER.error("apex model null on engine " + engineKey.getId());
+            throw new ApexException("apex model null on engine " + engineKey.getId());
         }
 
         // Update the Apex model in the Apex engine
@@ -252,16 +252,16 @@
 
         // Check if the key on the update request is correct
         if (!engineWorkerKey.equals(engineKey)) {
-            LOGGER.warn("engine key " + engineKey.getID() + " does not match the key" + engineWorkerKey.getID()
+            LOGGER.warn("engine key " + engineKey.getId() + " does not match the key" + engineWorkerKey.getId()
                     + " of this engine");
-            throw new ApexException("engine key " + engineKey.getID() + " does not match the key"
-                    + engineWorkerKey.getID() + " of this engine");
+            throw new ApexException("engine key " + engineKey.getId() + " does not match the key"
+                    + engineWorkerKey.getId() + " of this engine");
         }
 
         // Sanity checks on the Apex model
         if (engine == null) {
-            LOGGER.warn("engine with key " + engineKey.getID() + " not initialized");
-            throw new ApexException("engine with key " + engineKey.getID() + " not initialized");
+            LOGGER.warn("engine with key " + engineKey.getId() + " not initialized");
+            throw new ApexException("engine with key " + engineKey.getId() + " not initialized");
         }
 
         // Check model compatibility
@@ -270,14 +270,14 @@
             final AxPolicyModel currentModel = ModelService.getModel(AxPolicyModel.class);
             if (!currentModel.getKey().isCompatible(apexModel.getKey())) {
                 if (forceFlag) {
-                    LOGGER.warn("apex model update forced, supplied model with key \"" + apexModel.getKey().getID()
+                    LOGGER.warn("apex model update forced, supplied model with key \"" + apexModel.getKey().getId()
                             + "\" is not a compatible model update from the existing engine model with key \""
-                            + currentModel.getKey().getID() + "\"");
+                            + currentModel.getKey().getId() + "\"");
                 } else {
                     throw new ContextException(
-                            "apex model update failed, supplied model with key \"" + apexModel.getKey().getID()
+                            "apex model update failed, supplied model with key \"" + apexModel.getKey().getId()
                                     + "\" is not a compatible model update from the existing engine model with key \""
-                                    + currentModel.getKey().getID() + "\"");
+                                    + currentModel.getKey().getId() + "\"");
                 }
             }
         }
@@ -285,7 +285,7 @@
         // Update the Apex model in the Apex engine
         engine.updateModel(apexModel);
 
-        LOGGER.debug("engine model {} added to the engine-{}", apexModel.getKey().getID(), engineWorkerKey);
+        LOGGER.debug("engine model {} added to the engine-{}", apexModel.getKey().getId(), engineWorkerKey);
         LOGGER.exit();
     }
 
@@ -322,22 +322,22 @@
 
         // Check if the key on the start request is correct
         if (!engineWorkerKey.equals(engineKey)) {
-            LOGGER.warn("engine key " + engineKey.getID() + " does not match the key" + engineWorkerKey.getID()
+            LOGGER.warn("engine key " + engineKey.getId() + " does not match the key" + engineWorkerKey.getId()
                     + " of this engine");
-            throw new ApexException("engine key " + engineKey.getID() + " does not match the key"
-                    + engineWorkerKey.getID() + " of this engine");
+            throw new ApexException("engine key " + engineKey.getId() + " does not match the key"
+                    + engineWorkerKey.getId() + " of this engine");
         }
 
         if (engine == null) {
-            LOGGER.error("apex engine for engine key" + engineWorkerKey.getID() + " null");
-            throw new ApexException("apex engine for engine key" + engineWorkerKey.getID() + " null");
+            LOGGER.error("apex engine for engine key" + engineWorkerKey.getId() + " null");
+            throw new ApexException("apex engine for engine key" + engineWorkerKey.getId() + " null");
         }
 
         // Starts the event processing thread that handles incoming events
         if (processorThread != null && processorThread.isAlive()) {
-            LOGGER.error("apex engine for engine key" + engineWorkerKey.getID() + " is already running with state "
+            LOGGER.error("apex engine for engine key" + engineWorkerKey.getId() + " is already running with state "
                     + getState());
-            throw new ApexException("apex engine for engine key" + engineWorkerKey.getID()
+            throw new ApexException("apex engine for engine key" + engineWorkerKey.getId()
                     + " is already running with state " + getState());
         }
 
@@ -372,22 +372,22 @@
     public void stop(final AxArtifactKey engineKey) throws ApexException {
         // Check if the key on the start request is correct
         if (!engineWorkerKey.equals(engineKey)) {
-            LOGGER.warn("engine key " + engineKey.getID() + " does not match the key" + engineWorkerKey.getID()
+            LOGGER.warn("engine key " + engineKey.getId() + " does not match the key" + engineWorkerKey.getId()
                     + " of this engine");
-            throw new ApexException("engine key " + engineKey.getID() + " does not match the key"
-                    + engineWorkerKey.getID() + " of this engine");
+            throw new ApexException("engine key " + engineKey.getId() + " does not match the key"
+                    + engineWorkerKey.getId() + " of this engine");
         }
 
         if (engine == null) {
-            LOGGER.error("apex engine for engine key" + engineWorkerKey.getID() + " null");
-            throw new ApexException("apex engine for engine key" + engineWorkerKey.getID() + " null");
+            LOGGER.error("apex engine for engine key" + engineWorkerKey.getId() + " null");
+            throw new ApexException("apex engine for engine key" + engineWorkerKey.getId() + " null");
         }
 
         // Interrupt the worker to stop its thread
         if (processorThread == null || !processorThread.isAlive()) {
             processorThread = null;
 
-            LOGGER.warn("apex engine for engine key" + engineWorkerKey.getID() + " is already stopped with state "
+            LOGGER.warn("apex engine for engine key" + engineWorkerKey.getId() + " is already stopped with state "
                     + getState());
             return;
         }
diff --git a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/test/common/model/EvalDomainModelFactory.java b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/test/common/model/EvalDomainModelFactory.java
index 83a4ccc..a3f626f 100644
--- a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/test/common/model/EvalDomainModelFactory.java
+++ b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/test/common/model/EvalDomainModelFactory.java
@@ -263,8 +263,8 @@
         policyModel.getKeyInformation().generateKeyInfo(policyModel);
 
         final AxValidationResult result = policyModel.validate(new AxValidationResult());
-        if (!result.isOK()) {
-            throw new ApexRuntimeException("model " + policyModel.getID() + " is not valid" + result);
+        if (!result.isOk()) {
+            throw new ApexRuntimeException("model " + policyModel.getId() + " is not valid" + result);
         }
         return policyModel;
     }
@@ -434,8 +434,8 @@
         policyModel.getKeyInformation().generateKeyInfo(policyModel);
 
         final AxValidationResult result = policyModel.validate(new AxValidationResult());
-        if (!result.isOK()) {
-            throw new ApexRuntimeException("model " + policyModel.getID() + " is not valid" + result);
+        if (!result.isOk()) {
+            throw new ApexRuntimeException("model " + policyModel.getId() + " is not valid" + result);
         }
         return policyModel;
     }
diff --git a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/test/common/model/SampleDomainModelFactory.java b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/test/common/model/SampleDomainModelFactory.java
index 2499367..184529f 100644
--- a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/test/common/model/SampleDomainModelFactory.java
+++ b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/test/common/model/SampleDomainModelFactory.java
@@ -535,7 +535,7 @@
 
         AxValidationResult result = policyModel.validate(new AxValidationResult());
         if (!result.getValidationResult().equals(AxValidationResult.ValidationResult.VALID)) {
-            throw new ApexRuntimeException("model " + policyModel.getID() + " is not valid" + result);
+            throw new ApexRuntimeException("model " + policyModel.getId() + " is not valid" + result);
         }
         return policyModel;
     }
diff --git a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/test/common/model/SampleDomainModelSaver.java b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/test/common/model/SampleDomainModelSaver.java
index c346d94..6ca644f 100644
--- a/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/test/common/model/SampleDomainModelSaver.java
+++ b/testsuites/integration/integration-common/src/main/java/org/onap/policy/apex/test/common/model/SampleDomainModelSaver.java
@@ -51,32 +51,32 @@
         // Save Java model
         final AxPolicyModel javaPolicyModel = new SampleDomainModelFactory().getSamplePolicyModel("JAVA");
         final ApexModelSaver<AxPolicyModel> javaModelSaver = new ApexModelSaver<AxPolicyModel>(AxPolicyModel.class, javaPolicyModel, args[0]);
-        javaModelSaver.apexModelWriteJSON();
-        javaModelSaver.apexModelWriteXML();
+        javaModelSaver.apexModelWriteJson();
+        javaModelSaver.apexModelWriteXml();
 
         // Save Javascript model
         final AxPolicyModel javascriptPolicyModel = new SampleDomainModelFactory().getSamplePolicyModel("JAVASCRIPT");
         final ApexModelSaver<AxPolicyModel> javascriptModelSaver = new ApexModelSaver<AxPolicyModel>(AxPolicyModel.class, javascriptPolicyModel, args[0]);
-        javascriptModelSaver.apexModelWriteJSON();
-        javascriptModelSaver.apexModelWriteXML();
+        javascriptModelSaver.apexModelWriteJson();
+        javascriptModelSaver.apexModelWriteXml();
 
         // Save JRuby model
         final AxPolicyModel jRubyPolicyModel = new SampleDomainModelFactory().getSamplePolicyModel("JRUBY");
         final ApexModelSaver<AxPolicyModel> jRubyModelSaver = new ApexModelSaver<AxPolicyModel>(AxPolicyModel.class, jRubyPolicyModel, args[0]);
-        jRubyModelSaver.apexModelWriteJSON();
-        jRubyModelSaver.apexModelWriteXML();
+        jRubyModelSaver.apexModelWriteJson();
+        jRubyModelSaver.apexModelWriteXml();
 
         // Save Jython model
         final AxPolicyModel jythonPolicyModel = new SampleDomainModelFactory().getSamplePolicyModel("JYTHON");
         final ApexModelSaver<AxPolicyModel> jythonModelSaver = new ApexModelSaver<AxPolicyModel>(AxPolicyModel.class, jythonPolicyModel, args[0]);
-        jythonModelSaver.apexModelWriteJSON();
-        jythonModelSaver.apexModelWriteXML();
+        jythonModelSaver.apexModelWriteJson();
+        jythonModelSaver.apexModelWriteXml();
 
         // Save MVEL model
         final AxPolicyModel mvelPolicyModel = new SampleDomainModelFactory().getSamplePolicyModel("MVEL");
         final ApexModelSaver<AxPolicyModel> mvelModelSaver = new ApexModelSaver<AxPolicyModel>(AxPolicyModel.class, mvelPolicyModel, args[0]);
-        mvelModelSaver.apexModelWriteJSON();
-        mvelModelSaver.apexModelWriteXML();
+        mvelModelSaver.apexModelWriteJson();
+        mvelModelSaver.apexModelWriteXml();
     }
 
 }
diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestApexSamplePolicyCreateModelFiles.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestApexSamplePolicyCreateModelFiles.java
index 8113436..384ad51 100644
--- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestApexSamplePolicyCreateModelFiles.java
+++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestApexSamplePolicyCreateModelFiles.java
@@ -30,8 +30,8 @@
         final TestApexSamplePolicyModelCreator apexPolicyModelCreator = new TestApexSamplePolicyModelCreator("JAVA");
         final TestApexModel<AxPolicyModel> testApexPolicyModel =
                 new TestApexModel<AxPolicyModel>(AxPolicyModel.class, apexPolicyModelCreator);
-        testApexPolicyModel.testApexModelWriteReadXML();
-        testApexPolicyModel.testApexModelWriteReadJSON();
+        testApexPolicyModel.testApexModelWriteReadXml();
+        testApexPolicyModel.testApexModelWriteReadJson();
     }
 
     @Test
@@ -40,8 +40,8 @@
                 new TestApexSamplePolicyModelCreator("JAVASCRIPT");
         final TestApexModel<AxPolicyModel> testApexPolicyModel =
                 new TestApexModel<AxPolicyModel>(AxPolicyModel.class, apexPolicyModelCreator);
-        testApexPolicyModel.testApexModelWriteReadXML();
-        testApexPolicyModel.testApexModelWriteReadJSON();
+        testApexPolicyModel.testApexModelWriteReadXml();
+        testApexPolicyModel.testApexModelWriteReadJson();
     }
 
     @Test
@@ -49,8 +49,8 @@
         final TestApexSamplePolicyModelCreator apexPolicyModelCreator = new TestApexSamplePolicyModelCreator("JRUBY");
         final TestApexModel<AxPolicyModel> testApexPolicyModel =
                 new TestApexModel<AxPolicyModel>(AxPolicyModel.class, apexPolicyModelCreator);
-        testApexPolicyModel.testApexModelWriteReadXML();
-        testApexPolicyModel.testApexModelWriteReadJSON();
+        testApexPolicyModel.testApexModelWriteReadXml();
+        testApexPolicyModel.testApexModelWriteReadJson();
     }
 
     @Test
@@ -58,8 +58,8 @@
         final TestApexSamplePolicyModelCreator apexPolicyModelCreator = new TestApexSamplePolicyModelCreator("JYTHON");
         final TestApexModel<AxPolicyModel> testApexPolicyModel =
                 new TestApexModel<AxPolicyModel>(AxPolicyModel.class, apexPolicyModelCreator);
-        testApexPolicyModel.testApexModelWriteReadXML();
-        testApexPolicyModel.testApexModelWriteReadJSON();
+        testApexPolicyModel.testApexModelWriteReadXml();
+        testApexPolicyModel.testApexModelWriteReadJson();
     }
 
     @Test
@@ -67,7 +67,7 @@
         final TestApexSamplePolicyModelCreator apexPolicyModelCreator = new TestApexSamplePolicyModelCreator("MVEL");
         final TestApexModel<AxPolicyModel> testApexPolicyModel =
                 new TestApexModel<AxPolicyModel>(AxPolicyModel.class, apexPolicyModelCreator);
-        testApexPolicyModel.testApexModelWriteReadXML();
-        testApexPolicyModel.testApexModelWriteReadJSON();
+        testApexPolicyModel.testApexModelWriteReadXml();
+        testApexPolicyModel.testApexModelWriteReadJson();
     }
 }
diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestApexSamplePolicyDBWrite.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestApexSamplePolicyDBWrite.java
index 48e2f80..4531467 100644
--- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestApexSamplePolicyDBWrite.java
+++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestApexSamplePolicyDBWrite.java
@@ -26,7 +26,7 @@
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
-import org.onap.policy.apex.model.basicmodel.dao.DAOParameters;
+import org.onap.policy.apex.model.basicmodel.dao.DaoParameters;
 import org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao;
 import org.onap.policy.apex.model.basicmodel.test.TestApexModel;
 import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
@@ -50,10 +50,10 @@
 
     @Test
     public void testModelWriteReadJPA() throws Exception {
-        final DAOParameters daoParameters = new DAOParameters();
-        daoParameters.setPluginClass(DefaultApexDao.class.getCanonicalName());
-        daoParameters.setPersistenceUnit("SampleModelTest");
+        final DaoParameters DaoParameters = new DaoParameters();
+        DaoParameters.setPluginClass(DefaultApexDao.class.getCanonicalName());
+        DaoParameters.setPersistenceUnit("SampleModelTest");
 
-        testApexModel.testApexModelWriteReadJPA(daoParameters);
+        testApexModel.testApexModelWriteReadJpa(DaoParameters);
     }
 }
diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestApexSamplePolicyModel.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestApexSamplePolicyModel.java
index 3673dae..36810b4 100644
--- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestApexSamplePolicyModel.java
+++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/plugins/executor/test/script/handling/TestApexSamplePolicyModel.java
@@ -29,7 +29,7 @@
 import org.junit.Before;
 import org.junit.Test;
 import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
-import org.onap.policy.apex.model.basicmodel.dao.DAOParameters;
+import org.onap.policy.apex.model.basicmodel.dao.DaoParameters;
 import org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao;
 import org.onap.policy.apex.model.basicmodel.test.TestApexModel;
 import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel;
@@ -60,21 +60,21 @@
 
     @Test
     public void testModelWriteReadXML() throws Exception {
-        testApexModel.testApexModelWriteReadXML();
+        testApexModel.testApexModelWriteReadXml();
     }
 
     @Test
     public void testModelWriteReadJSON() throws Exception {
-        testApexModel.testApexModelWriteReadJSON();
+        testApexModel.testApexModelWriteReadJson();
     }
 
     @Test
     public void testModelWriteReadJPA() throws Exception {
-        final DAOParameters daoParameters = new DAOParameters();
-        daoParameters.setPluginClass(DefaultApexDao.class.getCanonicalName());
-        daoParameters.setPersistenceUnit("SampleModelTest");
+        final DaoParameters DaoParameters = new DaoParameters();
+        DaoParameters.setPluginClass(DefaultApexDao.class.getCanonicalName());
+        DaoParameters.setPersistenceUnit("SampleModelTest");
 
-        testApexModel.testApexModelWriteReadJPA(daoParameters);
+        testApexModel.testApexModelWriteReadJpa(DaoParameters);
     }
 
     
diff --git a/testsuites/integration/integration-executor-test/src/test/resources/META-INF/persistence.xml b/testsuites/integration/integration-executor-test/src/test/resources/META-INF/persistence.xml
index 5ba5bfa..40773a4 100644
--- a/testsuites/integration/integration-executor-test/src/test/resources/META-INF/persistence.xml
+++ b/testsuites/integration/integration-executor-test/src/test/resources/META-INF/persistence.xml
@@ -23,8 +23,8 @@
     <persistence-unit name="SampleModelTest" transaction-type="RESOURCE_LOCAL">
         <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
 
-        <class>org.onap.policy.apex.model.basicmodel.dao.converters.CDATAConditioner</class>
-        <class>org.onap.policy.apex.model.basicmodel.dao.converters.UUID2String</class>
+        <class>org.onap.policy.apex.model.basicmodel.dao.converters.CDataConditioner</class>
+        <class>org.onap.policy.apex.model.basicmodel.dao.converters.Uuid2String</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxConcept</class>
         <class>org.onap.policy.apex.model.basicmodel.concepts.AxKeyInfo</class>
diff --git a/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/KeyInfoGetter.java b/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/KeyInfoGetter.java
index a04ed49..f7dfe84 100644
--- a/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/KeyInfoGetter.java
+++ b/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/KeyInfoGetter.java
@@ -131,10 +131,10 @@
      */
     public String getUUID(final AxArtifactKey key) {
         final AxKeyInfo ki = model.getKeyInformation().get(key);
-        if (ki == null || ki.getUUID() == null) {
+        if (ki == null || ki.getUuid() == null) {
             return null;
         }
-        return ki.getUUID().toString();
+        return ki.getUuid().toString();
     }
 
     /**
diff --git a/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/SchemaUtils.java b/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/SchemaUtils.java
index 3a4feb0..545d15e 100644
--- a/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/SchemaUtils.java
+++ b/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/SchemaUtils.java
@@ -112,7 +112,7 @@
             }
         } catch (final AvroRuntimeException e) {
             throw new ApexEventException("failed to decode a schema for parameter " + parameter.getKey().getLocalName()
-                    + " of type " + parameter.getSchema().getID() + " with Java type " + schemaHelper.getSchemaClass(),
+                    + " of type " + parameter.getSchema().getId() + " with Java type " + schemaHelper.getSchemaClass(),
                     e);
         }
         final String schemaname = parameterSchema.getFullName();
@@ -126,7 +126,7 @@
             processSubSchemas(parameterSchema, preexistingParamSchemas);
         } catch (AvroRuntimeException | ApexEventException e) {
             throw new ApexEventException("failed to decode a schema for parameter " + parameter.getKey().getLocalName()
-                    + " of type " + parameter.getSchema().getID() + " using Schema type " + schemaname, e);
+                    + " of type " + parameter.getSchema().getId() + " using Schema type " + schemaname, e);
         }
         if (alreadyseen != null) {
             // logger.warn("parameter "+ parameter.getKey().getLocalName() + " of type " + parameter.getSchema().getID()
diff --git a/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2cli/Model2Cli.java b/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2cli/Model2Cli.java
index d374a6c..2712e5d 100644
--- a/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2cli/Model2Cli.java
+++ b/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2cli/Model2Cli.java
@@ -121,7 +121,7 @@
         if (validate) {
             final AxValidationResult val = new AxValidationResult();
             policyModel.validate(val);
-            if (!val.isOK()) {
+            if (!val.isOk()) {
                 System.err.println("Cannot translate the model. The model is not valid: \n" + val.toString());
                 return -1;
             }
