diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/staticcodegen/CodeGenUtil.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/staticcodegen/CodeGenUtil.java
index 1da88a1..87a9a84 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/staticcodegen/CodeGenUtil.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/staticcodegen/CodeGenUtil.java
@@ -43,11 +43,8 @@
     private final static String EVALUATOR_FACTORY = "EvaluatorFactory";
     private final static String EVALUATOR = "Evaluator";
     private final static String INNER = "Inner";
-    private final static String DESCRIPTOR = "Descriptor";
-    private final static String ACCESSOR = "Accessor";
     private final static String DOLLAR = "$";
-    private final static String PKG_SUFFIX = "/generated";
-    private final static String ASTERIXDB_PREFIX = "org/apache/asterix";
+    private final static String NESTED_CLASSNAME_PREFIX = "_";
 
     /**
      * The callback interface for a caller to determine what it needs to do for
@@ -165,7 +162,9 @@
         int index = nameMappings.size() - 1;
         for (; index >= 0; --index) {
             Pair<String, String> entry = nameMappings.get(index);
-            result = result.replace(entry.getLeft(), entry.getRight());
+            if (result.contains(entry.getLeft())) {
+                return result.replace(entry.getLeft(), entry.getRight());
+            }
         }
         return result;
     }
@@ -179,7 +178,7 @@
      *            the original evaluator factory class name.
      * @param suffixForGeneratedClass,
      *            the suffix for the generated class.
-     * @param factoryIndex,
+     * @param factoryCounter,
      *            the counter for the generated class.
      * @param nameMappings,
      *            class names that needs to be rewritten in the generated byte code.
@@ -235,7 +234,7 @@
      *            the name of the original evaluator class.
      * @param suffixForGeneratedClass,
      *            the suffix for the generated class.
-     * @param evalIndex,
+     * @param evalCounter,
      *            the counter for the generated class.
      * @param nameMappings,
      *            class names that needs to be rewritten in the generated byte code.
@@ -368,30 +367,23 @@
      *            the original class, i.e., the source of the generated class.
      * @param suffix,
      *            the suffix for the generated class.
-     * @param evalCounter,
+     * @param counter,
      *            a counter that appearing at the end of the name of the generated class.
      * @return the name of the generated class.
      */
     private static String getGeneratedClassName(String originalClassName, String suffix, int counter) {
         StringBuilder sb = new StringBuilder();
-        int end = originalClassName.indexOf(DESCRIPTOR);
-        if (end < 0) {
-            end = originalClassName.indexOf(ACCESSOR);
-        }
-        if (end < 0) {
-            end = originalClassName.indexOf(DOLLAR);
-        }
+        int end = originalClassName.indexOf(DOLLAR);
         if (end < 0) {
             end = originalClassName.length();
         }
 
         String name = originalClassName.substring(0, end);
-        String lastName = name.substring(ASTERIXDB_PREFIX.length());
-
-        sb.append(ASTERIXDB_PREFIX);
-        sb.append(PKG_SUFFIX);
-        sb.append(lastName);
+        sb.append(name);
+        sb.append(DOLLAR);
+        sb.append(NESTED_CLASSNAME_PREFIX);
         sb.append(suffix);
+
         if (counter > 0) {
             sb.append(counter);
         }
