diff --git a/apps/workflow/api/src/main/java/org/onosproject/workflow/api/DefaultWorkletDescription.java b/apps/workflow/api/src/main/java/org/onosproject/workflow/api/DefaultWorkletDescription.java
index 82bb3f8..ee69273 100644
--- a/apps/workflow/api/src/main/java/org/onosproject/workflow/api/DefaultWorkletDescription.java
+++ b/apps/workflow/api/src/main/java/org/onosproject/workflow/api/DefaultWorkletDescription.java
@@ -22,37 +22,52 @@
 import com.google.common.base.MoreObjects;
 import org.slf4j.Logger;
 
+import java.util.Optional;
+
 import static org.slf4j.LoggerFactory.getLogger;
 
 /**
- * Class for default worklet description.
+ * Class for default work-let description.
  */
 public final class DefaultWorkletDescription implements WorkletDescription {
 
     protected static final Logger log = getLogger(DefaultWorkletDescription.class);
 
     /**
-     * worklet Name.
+     * work-let Name.
      */
     private String tag;
 
     /**
-     * worklet data model.
+     * Label of work-let description(Optional).
      */
-    private JsonDataModelTree data;
+    private Optional<Label> optLabel;
 
     /**
-     * Constructor of worklet description.
-     *
-     * @param builder worklet description builder
+     * work-let staticData model.
      */
-    public DefaultWorkletDescription(DefaultWorkletDescription.Builder builder) {
+    private JsonDataModelTree staticData;
+
+    /**
+     * Constructor of work-let description.
+     *
+     * @param builder work-let description builder
+     */
+    private DefaultWorkletDescription(DefaultWorkletDescription.Builder builder) {
         this.tag = builder.tag;
-        this.data = builder.data;
+        this.optLabel = builder.optLabel;
+        this.staticData = builder.staticData;
     }
 
+    /**
+     * Constructor of work-let description.
+     *
+     * @param tag work-let class name
+     */
     public DefaultWorkletDescription(String tag) {
         this.tag = tag;
+        this.optLabel = Optional.empty();
+        this.staticData = new JsonDataModelTree();
     }
 
     @Override
@@ -61,15 +76,21 @@
     }
 
     @Override
+    public Optional<Label> label() {
+        return this.optLabel;
+    }
+
+    @Override
     public JsonDataModelTree data() {
-        return this.data;
+        return this.staticData;
     }
 
     @Override
     public String toString() {
         return MoreObjects.toStringHelper(getClass())
                 .add("tag", tag())
-                .add("data", data())
+                .add("staticData", data())
+                .add("optLabel", label())
                 .toString();
     }
 
@@ -83,24 +104,40 @@
     }
 
     /**
-     * Builder for worklet description.
+     * Builder for work-let description.
      */
     public static class Builder {
 
         /**
-         * worklet name.
+         * work-let name.
          */
         private String tag;
 
         /**
-         * static data model tree.
+         * Label of work-let description(Optional).
          */
-        JsonDataModelTree data = new JsonDataModelTree();
+        private Optional<Label> optLabel = Optional.empty();
 
         /**
-         * Sets worklet name.
+         * static staticData model tree.
+         */
+        JsonDataModelTree staticData = new JsonDataModelTree();
+
+        /**
+         * Sets optLabel of work-let description.
          *
-         * @param tag worklet name
+         * @param label optLabel of work-let description
+         * @return builder
+         */
+        public DefaultWorkletDescription.Builder label(Label label) {
+            this.optLabel = Optional.of(label);
+            return this;
+        }
+
+        /**
+         * Sets work-let name.
+         *
+         * @param tag work-let name
          * @return builder
          */
         public DefaultWorkletDescription.Builder name(String tag) {
@@ -108,63 +145,107 @@
             return this;
         }
 
-
+        /**
+         * Sets static data model with path and string data type value.
+         *
+         * @param path static data model path
+         * @param value string model value
+         * @return builder
+         * @throws WorkflowException workflow exception
+         */
         public DefaultWorkletDescription.Builder staticDataModel(String path, String value) throws WorkflowException {
 
-            data.setAt(path, value);
+            staticData.setAt(path, value);
 
             return this;
         }
 
+        /**
+         * Sets static data model with path and integer data type value.
+         *
+         * @param path static data model path
+         * @param value integer model value
+         * @return builder
+         * @throws WorkflowException workflow exception
+         */
         public DefaultWorkletDescription.Builder staticDataModel(String path, Integer value) throws WorkflowException {
 
-            data.setAt(path, value);
+            staticData.setAt(path, value);
 
             return this;
         }
 
+        /**
+         * Sets static data model with path and boolean data type value.
+         *
+         * @param path static data model path
+         * @param value boolean model value
+         * @return builder
+         * @throws WorkflowException workflow exception
+         */
         public DefaultWorkletDescription.Builder staticDataModel(String path, Boolean value) throws WorkflowException {
 
-            data.setAt(path, value);
+            staticData.setAt(path, value);
 
             return this;
         }
 
+        /**
+         * Sets static data model with path and json data type value.
+         *
+         * @param path static data model path
+         * @param value json model value
+         * @return builder
+         * @throws WorkflowException workflow exception
+         */
         public DefaultWorkletDescription.Builder staticDataModel(String path, JsonNode value) throws WorkflowException {
 
-            data.setAt(path, value);
+            staticData.setAt(path, value);
 
             return this;
         }
 
+        /**
+         * Sets static data model with path and json array data type value.
+         *
+         * @param path static data model path
+         * @param value json-array model value
+         * @return builder
+         * @throws WorkflowException workflow exception
+         */
         public DefaultWorkletDescription.Builder staticDataModel(String path, ArrayNode value)
                 throws WorkflowException {
 
-            data.setAt(path, value);
+            staticData.setAt(path, value);
 
             return this;
         }
 
+        /**
+         * Sets static data model with path and json-object data type value.
+         *
+         * @param path static data model path
+         * @param value json-object model value
+         * @return builder
+         * @throws WorkflowException workflow exception
+         */
         public DefaultWorkletDescription.Builder staticDataModel(String path, ObjectNode value)
                 throws WorkflowException {
 
-            data.setAt(path, value);
+            staticData.setAt(path, value);
 
             return this;
         }
 
-
         /**
-         * Builds worklet description from builder.
+         * Builds work-let description from builder.
          *
-         * @return instance of worklet description
+         * @return instance of work-let description
          * @throws WorkflowException workflow exception
          */
         public DefaultWorkletDescription build() {
-
             return new DefaultWorkletDescription(this);
         }
-
-
     }
 }
+
diff --git a/apps/workflow/api/src/main/java/org/onosproject/workflow/api/ImmutableListWorkflow.java b/apps/workflow/api/src/main/java/org/onosproject/workflow/api/ImmutableListWorkflow.java
index 1965c43..6f77028 100644
--- a/apps/workflow/api/src/main/java/org/onosproject/workflow/api/ImmutableListWorkflow.java
+++ b/apps/workflow/api/src/main/java/org/onosproject/workflow/api/ImmutableListWorkflow.java
@@ -56,11 +56,6 @@
     private static StaticDataModelInjector staticDataModelInjector = new StaticDataModelInjector();
 
     /**
-     * Workflow Logger injector.
-     */
-    private WorkflowLoggerInjector workflowLoggerInjector = new WorkflowLoggerInjector();
-
-    /**
      * Constructor of ImmutableListWorkflow.
      *
      * @param builder builder of ImmutableListWorkflow
@@ -89,7 +84,7 @@
         ProgramCounter current = context.current();
         check(current != null, "Invalid program counter");
 
-        ProgramCounter pc = current.clone();
+        ProgramCounter pc = current.pcClone();
 
         for (int i = current.workletIndex(); i < program.size(); pc = increased(pc), i++) {
 
@@ -123,7 +118,6 @@
                 continue;
 
             } else {
-                workflowLoggerInjector.inject(worklet, context);
                 // isNext is read only. It does not perform 'inhale'.
                 dataModelInjector.inject(worklet, context);
                 WorkletDescription workletDesc = getWorkletDesc(pc);
@@ -150,7 +144,7 @@
         }
 
         WorkletDescription workletDesc = program.get(increaedIndex);
-        return ProgramCounter.valueOf(workletDesc.tag(), increaedIndex);
+        return ProgramCounter.valueOf(workletDesc.tag(), increaedIndex, "");
     }
 
     @Override
@@ -208,7 +202,7 @@
         int size = program.size();
         List pcList = new ArrayList();
         for (int i = 0; i < size; i++) {
-            pcList.add(ProgramCounter.valueOf(program.get(i).tag(), i));
+            pcList.add(ProgramCounter.valueOf(program.get(i).tag(), i, ""));
         }
 
         return pcList;
@@ -368,3 +362,4 @@
         }
     }
 }
+
diff --git a/apps/workflow/api/src/main/java/org/onosproject/workflow/api/JsonDataModelTree.java b/apps/workflow/api/src/main/java/org/onosproject/workflow/api/JsonDataModelTree.java
index 8a0ec84..7e402fd 100644
--- a/apps/workflow/api/src/main/java/org/onosproject/workflow/api/JsonDataModelTree.java
+++ b/apps/workflow/api/src/main/java/org/onosproject/workflow/api/JsonDataModelTree.java
@@ -462,7 +462,7 @@
             }
             list = reader.readValue(node);
         } catch (Exception e) {
-            log.info("exception while parsing list {}", e.getStackTrace());
+            log.error("exception while parsing list ", e);
         }
         return list;
     }
@@ -487,7 +487,7 @@
             });
             map = reader.readValue(node);
         } catch (Exception e) {
-            log.info("exception while parsing map {}", e.getStackTrace());
+            log.error("exception while parsing map ", e);
         }
         return map;
     }
diff --git a/apps/workflow/api/src/main/java/org/onosproject/workflow/api/ProgramCounter.java b/apps/workflow/api/src/main/java/org/onosproject/workflow/api/ProgramCounter.java
index a59ddf5..9fb5338 100644
--- a/apps/workflow/api/src/main/java/org/onosproject/workflow/api/ProgramCounter.java
+++ b/apps/workflow/api/src/main/java/org/onosproject/workflow/api/ProgramCounter.java
@@ -20,67 +20,108 @@
 import java.util.regex.Pattern;
 
 /**
- * An interface representing workflow program counter.
+ * A class representing workflow program counter.
  */
 public final class ProgramCounter {
 
-    public static final ProgramCounter INIT_PC = ProgramCounter.valueOf(Worklet.Common.INIT.name(), 0);
+    public static final ProgramCounter INIT_PC
+            = ProgramCounter.valueOf("", 0, Worklet.Common.INIT.name());
+
+    public static final ProgramCounter TERMINATE_PC
+            = ProgramCounter.valueOf("", 0, Worklet.Common.COMPLETED.name());
 
     /**
-     * index of the worklet.
+     * Section name in workflow.
+     */
+    private final String sectionName;
+
+    /**
+     * index of the work-let in the sectionName.
      */
     private final int workletIndex;
 
     /**
-     * Type of worklet.
+     * Number of work-let processed.
+     */
+    private int indexCount;
+
+    /**
+     * Type of work-let.
      */
     private final String workletType;
 
+
     /**
-     * Index of worklet.
-     * @return index of worklet
+     * Section name in workflow.
+     * @return sectionName name
+     */
+    public String sectionName() {
+        return this.sectionName;
+    }
+
+    /**
+     * Index of work-let in the workflow section.
+     * @return index of work-let
      */
     public int workletIndex() {
         return this.workletIndex;
     }
 
     /**
-     * Type of worklet.
-     * @return type of worklet
+     * Number of work-let processed.
+     * @return index count of work-let
+     */
+    public int indexCount() {
+        return this.indexCount;
+    }
+
+    /**
+     * Type of work-let.
+     * @return type of work-let
      */
     public String workletType() {
         return this.workletType;
     }
 
     /**
-     * Constructor of workflow Program Counter.
-     * @param workletType type of worklet
-     * @param workletIndex index of worklet
+     * Set total number of work-let processed.
+     * @param indexCount total number of work-let processed
      */
-    private ProgramCounter(String workletType, int workletIndex) {
+    public void setIndexCount(int indexCount) {
+        this.indexCount = indexCount;
+    }
+
+    /**
+     * Constructor of workflow Program Counter.
+     * @param workletType type of work-let
+     * @param workletIndex index of work-let
+     */
+    private ProgramCounter(String sectionName, int workletIndex, int indexCount, String workletType) {
         this.workletType = workletType;
+        this.sectionName = sectionName;
         this.workletIndex = workletIndex;
+        this.indexCount = indexCount;
     }
 
     /**
      * Clones this workflow Program Counter.
      * @return clone of this workflow Program Counter
      */
-    public ProgramCounter clone() {
-        return ProgramCounter.valueOf(this.workletType(), this.workletIndex());
+    public ProgramCounter pcClone() {
+        return ProgramCounter.valueOf(this.sectionName(), this.workletIndex(), this.workletType());
     }
 
     /**
-     * Returns whether this program counter is INIT worklet program counter.
-     * @return whether this program counter is INIT worklet program counter
+     * Returns whether this program counter is INIT work-let program counter.
+     * @return whether this program counter is INIT work-let program counter
      */
     public boolean isInit() {
         return Worklet.Common.INIT.tag().equals(this.workletType);
     }
 
     /**
-     * Returns whether this program counter is COMPLETED worklet program counter.
-     * @return whether this program counter is COMPLETED worklet program counter
+     * Returns whether this program counter is COMPLETED work-let program counter.
+     * @return whether this program counter is COMPLETED work-let program counter
      */
     public boolean isCompleted() {
         return Worklet.Common.COMPLETED.tag().equals(this.workletType);
@@ -100,38 +141,45 @@
             return false;
         }
         return Objects.equals(this.workletType(), ((ProgramCounter) obj).workletType())
-                && Objects.equals(this.workletIndex(), ((ProgramCounter) obj).workletIndex());
+                && Objects.equals(this.sectionName(), ((ProgramCounter) obj).sectionName())
+                && Objects.equals(this.workletIndex(), ((ProgramCounter) obj).workletIndex())
+         && Objects.equals(this.workletIndex(), ((ProgramCounter) obj).workletIndex());
     }
 
     @Override
     public String toString() {
-        return String.format("(%d)%s", workletIndex, workletType);
+        return String.format("(%s:%d:%d)%s", sectionName, workletIndex, indexCount, workletType);
     }
 
     /**
      * Builder of workflow Program Counter.
-     * @param workletType type of worklet
-     * @param workletIndex index of worklet
+     * @param workletType type of work-let
+     * @param sectionName name of section
+     * @param workletIndex index of work-let
      * @return program counter
      */
-    public static ProgramCounter valueOf(String workletType, int workletIndex) {
-        return new ProgramCounter(workletType, workletIndex);
+    public static ProgramCounter valueOf(String sectionName, int workletIndex, String workletType) {
+        return valueOf(sectionName, workletIndex, workletIndex, workletType);
+    }
+
+    public static ProgramCounter valueOf(String sectionName, int workletIndex, int moveCount, String workletType) {
+        return new ProgramCounter(sectionName, workletIndex, moveCount, workletType);
     }
 
     /**
      * Builder of workflow Program Counter.
-     * @param strProgramCounter string format for program counter
+     * @param strProgramCounter string format for program counter '([sectionName]:[index])[class name]'
      * @return program counter
      */
     public static ProgramCounter valueOf(String strProgramCounter) {
 
-        Matcher m = Pattern.compile("\\((\\d+)\\)(.+)").matcher(strProgramCounter);
+        Matcher m = Pattern.compile("\\((.+)\\:(\\d+)\\:(\\d+)\\)(.+)").matcher(strProgramCounter);
 
         if (!m.matches()) {
             throw new IllegalArgumentException("Malformed program counter string");
         }
 
-        return new ProgramCounter(m.group(2), Integer.parseInt(m.group(1)));
+        return new ProgramCounter(m.group(1), Integer.parseInt(m.group(2)), Integer.parseInt(m.group(3)), m.group(4));
     }
 
 }
diff --git a/apps/workflow/api/src/main/java/org/onosproject/workflow/api/WorkletDescription.java b/apps/workflow/api/src/main/java/org/onosproject/workflow/api/WorkletDescription.java
index 71ddbe5..32876a7 100644
--- a/apps/workflow/api/src/main/java/org/onosproject/workflow/api/WorkletDescription.java
+++ b/apps/workflow/api/src/main/java/org/onosproject/workflow/api/WorkletDescription.java
@@ -16,6 +16,8 @@
 package org.onosproject.workflow.api;
 
 
+import java.util.Optional;
+
 public interface WorkletDescription {
 
     /**
@@ -26,11 +28,17 @@
     String tag();
 
     /**
-     * Gets worklet data model.
+     * Gets label of worklet description.
      *
-     * @return worklet data model
+     * @return worklet label
+     */
+    Optional<Label> label();
+
+    /**
+     * Gets worklet staticData model.
+     *
+     * @return worklet staticData model
      */
     JsonDataModelTree data();
-
-
 }
+
