diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangAugment.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangAugment.java
index adac640..bd160d1 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangAugment.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangAugment.java
@@ -79,7 +79,8 @@
 /**
  * Representation of data model node to maintain information defined in YANG augment.
  */
-public class YangAugment extends YangNode
+public class YangAugment
+        extends YangNode
         implements YangLeavesHolder, YangCommonInfo, Parsable, CollisionDetector {
 
     /**
@@ -163,13 +164,15 @@
     }
 
     @Override
-    public void detectCollidingChild(String identifierName, YangConstructType dataType) throws DataModelException {
+    public void detectCollidingChild(String identifierName, YangConstructType dataType)
+            throws DataModelException {
         // Detect colliding child.
         detectCollidingChildUtil(identifierName, dataType, this);
     }
 
     @Override
-    public void detectSelfCollision(String identifierName, YangConstructType dataType) throws DataModelException {
+    public void detectSelfCollision(String identifierName, YangConstructType dataType)
+            throws DataModelException {
         if (this.getName().equals(identifierName)) {
             throw new DataModelException("YANG file error: Duplicate input identifier detected, same as input \""
                     + this.getName() + "\"");
@@ -191,7 +194,8 @@
      *
      * @param leafsList the list of leaf to set
      */
-    private void setListOfLeaf(List<YangLeaf> leafsList) {
+    @Override
+    public void setListOfLeaf(List<YangLeaf> leafsList) {
         listOfLeaf = leafsList;
     }
 
@@ -224,7 +228,8 @@
      *
      * @param listOfLeafList the list of leaf-list to set
      */
-    private void setListOfLeafList(List<YangLeafList> listOfLeafList) {
+    @Override
+    public void setListOfLeafList(List<YangLeafList> listOfLeafList) {
         this.listOfLeafList = listOfLeafList;
     }
 
@@ -298,7 +303,8 @@
      * @throws DataModelException a violation of data model rules
      */
     @Override
-    public void validateDataOnEntry() throws DataModelException {
+    public void validateDataOnEntry()
+            throws DataModelException {
         // TODO auto-generated method stub, to be implemented by parser
     }
 
@@ -308,7 +314,8 @@
      * @throws DataModelException a violation of data model rules
      */
     @Override
-    public void validateDataOnExit() throws DataModelException {
+    public void validateDataOnExit()
+            throws DataModelException {
         // TODO auto-generated method stub, to be implemented by parser
     }
 
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangCase.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangCase.java
index 6787dc9..abe4b1a 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangCase.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangCase.java
@@ -88,10 +88,12 @@
  *                | when         | 7.19.5  | 0..1        |-TODO             |
  *                +--------------+---------+-------------+------------------+
  */
+
 /**
  * Represents data model node to maintain information defined in YANG case.
  */
-public class YangCase extends YangNode
+public class YangCase
+        extends YangNode
         implements YangLeavesHolder, YangCommonInfo, Parsable, CollisionDetector, YangAugmentationHolder {
 
     /**
@@ -188,7 +190,8 @@
      *
      * @param leafsList the list of leaf to set
      */
-    private void setListOfLeaf(List<YangLeaf> leafsList) {
+    @Override
+    public void setListOfLeaf(List<YangLeaf> leafsList) {
         listOfLeaf = leafsList;
     }
 
@@ -221,7 +224,8 @@
      *
      * @param listOfLeafList the list of leaf-list to set
      */
-    private void setListOfLeafList(List<YangLeafList> listOfLeafList) {
+    @Override
+    public void setListOfLeafList(List<YangLeafList> listOfLeafList) {
         this.listOfLeafList = listOfLeafList;
     }
 
@@ -295,7 +299,8 @@
      * @throws DataModelException a violation of data model rules
      */
     @Override
-    public void validateDataOnEntry() throws DataModelException {
+    public void validateDataOnEntry()
+            throws DataModelException {
         // TODO auto-generated method stub, to be implemented by parser
     }
 
@@ -305,12 +310,14 @@
      * @throws DataModelException a violation of data model rules
      */
     @Override
-    public void validateDataOnExit() throws DataModelException {
+    public void validateDataOnExit()
+            throws DataModelException {
         // TODO auto-generated method stub, to be implemented by parser
     }
 
     @Override
-    public void detectCollidingChild(String identifierName, YangConstructType dataType) throws DataModelException {
+    public void detectCollidingChild(String identifierName, YangConstructType dataType)
+            throws DataModelException {
         if (!(getParent() instanceof YangChoice)) {
             throw new DataModelException("Internal Data Model Tree Error: Invalid/Missing holder in case " +
                     getName());
@@ -320,7 +327,8 @@
     }
 
     @Override
-    public void detectSelfCollision(String identifierName, YangConstructType dataType) throws DataModelException {
+    public void detectSelfCollision(String identifierName, YangConstructType dataType)
+            throws DataModelException {
 
         if (dataType == CASE_DATA) {
             if (getName().equals(identifierName)) {
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangContainer.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangContainer.java
index 3930433..ccb824b 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangContainer.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangContainer.java
@@ -87,7 +87,8 @@
 /**
  * Represents data model node to maintain information defined in YANG container.
  */
-public class YangContainer extends YangNode
+public class YangContainer
+        extends YangNode
         implements YangLeavesHolder, YangCommonInfo, Parsable, CollisionDetector, YangAugmentationHolder {
 
     /**
@@ -211,7 +212,8 @@
      *
      * @param leafsList the list of leaf to set
      */
-    private void setListOfLeaf(List<YangLeaf> leafsList) {
+    @Override
+    public void setListOfLeaf(List<YangLeaf> leafsList) {
         listOfLeaf = leafsList;
     }
 
@@ -245,7 +247,8 @@
      *
      * @param listOfLeafList the list of leaf-list to set
      */
-    private void setListOfLeafList(List<YangLeafList> listOfLeafList) {
+    @Override
+    public void setListOfLeafList(List<YangLeafList> listOfLeafList) {
         this.listOfLeafList = listOfLeafList;
     }
 
@@ -338,7 +341,8 @@
      * @throws DataModelException a violation of data model rules
      */
     @Override
-    public void validateDataOnEntry() throws DataModelException {
+    public void validateDataOnEntry()
+            throws DataModelException {
         // TODO auto-generated method stub, to be implemented by parser
     }
 
@@ -348,7 +352,8 @@
      * @throws DataModelException a violation of data model rules
      */
     @Override
-    public void validateDataOnExit() throws DataModelException {
+    public void validateDataOnExit()
+            throws DataModelException {
         List<YangLeaf> leaves = getListOfLeaf();
         List<YangLeafList> leafLists = getListOfLeafList();
 
@@ -397,7 +402,8 @@
      * @param leafLists list of leaf-list attributes of container
      * @throws DataModelException a violation of data model rules
      */
-    private void validateConfig(List<YangLeaf> leaves, List<YangLeafList> leafLists) throws DataModelException {
+    private void validateConfig(List<YangLeaf> leaves, List<YangLeafList> leafLists)
+            throws DataModelException {
 
         /*
          * If a node has "config" set to "false", no node underneath it can have
@@ -423,13 +429,15 @@
     }
 
     @Override
-    public void detectCollidingChild(String identifierName, YangConstructType dataType) throws DataModelException {
+    public void detectCollidingChild(String identifierName, YangConstructType dataType)
+            throws DataModelException {
         // Asks helper to detect colliding child.
         detectCollidingChildUtil(identifierName, dataType, this);
     }
 
     @Override
-    public void detectSelfCollision(String identifierName, YangConstructType dataType) throws DataModelException {
+    public void detectSelfCollision(String identifierName, YangConstructType dataType)
+            throws DataModelException {
         if (getName().equals(identifierName)) {
             throw new DataModelException("YANG file error: Duplicate input identifier detected, same as container \""
                     + getName() + "\"");
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangDerivedInfo.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangDerivedInfo.java
index 613237a..3cfdc38 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangDerivedInfo.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangDerivedInfo.java
@@ -17,7 +17,8 @@
 package org.onosproject.yangutils.datamodel;
 
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
-import org.onosproject.yangutils.linker.impl.ResolvableStatus;
+import org.onosproject.yangutils.linker.ResolvableStatus;
+
 import com.google.common.base.Strings;
 
 import static org.onosproject.yangutils.datamodel.YangDataTypes.BINARY;
@@ -30,8 +31,8 @@
 import static org.onosproject.yangutils.datamodel.YangDataTypes.LEAFREF;
 import static org.onosproject.yangutils.datamodel.YangDataTypes.STRING;
 import static org.onosproject.yangutils.datamodel.YangDataTypes.UNION;
-import static org.onosproject.yangutils.linker.impl.ResolvableStatus.INTRA_FILE_RESOLVED;
-import static org.onosproject.yangutils.linker.impl.ResolvableStatus.RESOLVED;
+import static org.onosproject.yangutils.linker.ResolvableStatus.INTRA_FILE_RESOLVED;
+import static org.onosproject.yangutils.linker.ResolvableStatus.RESOLVED;
 import static org.onosproject.yangutils.utils.RestrictionResolver.isOfRangeRestrictedType;
 import static org.onosproject.yangutils.utils.RestrictionResolver.processLengthRestriction;
 import static org.onosproject.yangutils.utils.RestrictionResolver.processRangeRestriction;
@@ -41,7 +42,8 @@
  *
  * @param <T> extended information.
  */
-public class YangDerivedInfo<T> implements LocationInfo {
+public class YangDerivedInfo<T>
+        implements LocationInfo, Cloneable {
 
     /**
      * YANG typedef reference.
@@ -224,8 +226,11 @@
      * @return resolution status
      * @throws DataModelException a violation in data mode rule
      */
-    public ResolvableStatus resolve() throws DataModelException {
+    public ResolvableStatus resolve()
+            throws DataModelException {
+
         YangType<?> baseType = getReferredTypeDef().getTypeDefBaseType();
+
         /*
          * Checks the data type of the referred typedef, if it's derived,
          * obtain effective built-in type and restrictions from it's derived
@@ -238,6 +243,7 @@
             if (baseType.getResolvableStatus() != INTRA_FILE_RESOLVED && baseType.getResolvableStatus() != RESOLVED) {
                 throw new DataModelException("Linker Error: Referred typedef is not resolved for type.");
             }
+
             /*
              * Check if the referred typedef is intra file resolved, if yes sets
              * current status also to intra file resolved .
@@ -401,6 +407,7 @@
                 }
             }
         }
+
         /*
          * Check if the data type is the one which can't be restricted, in
          * this case check whether no self restrictions should be present.
@@ -414,6 +421,7 @@
                 throw new DataModelException("YANG file error: Restrictions can't be applied to a given type");
             }
         }
+
         // Throw exception for unsupported types
         throw new DataModelException("Linker error: Unable to process the derived type.");
     }
@@ -424,7 +432,8 @@
      * @param refStringRestriction referred string restriction of typedef
      * @throws DataModelException a violation in data model rule
      */
-    private void resolveStringRestriction(YangStringRestriction refStringRestriction) throws DataModelException {
+    private void resolveStringRestriction(YangStringRestriction refStringRestriction)
+            throws DataModelException {
         YangStringRestriction curStringRestriction = null;
         YangRangeRestriction refRangeRestriction = null;
         YangPatternRestriction refPatternRestriction = null;
@@ -522,7 +531,8 @@
      * @return resolved length restriction
      * @throws DataModelException a violation in data model rule
      */
-    private YangRangeRestriction resolveLengthRestriction(YangRangeRestriction refLengthRestriction) throws
+    private YangRangeRestriction resolveLengthRestriction(YangRangeRestriction refLengthRestriction)
+            throws
             DataModelException {
 
         /*
@@ -572,7 +582,8 @@
      * @param curRestriction self restriction
      */
     private void resolveLengthAndRangeRestriction(YangRangeRestriction refRestriction,
-                                                  YangRangeRestriction curRestriction) throws DataModelException {
+            YangRangeRestriction curRestriction)
+            throws DataModelException {
         for (Object curInterval : curRestriction.getAscendingRangeIntervals()) {
             if (!(curInterval instanceof YangRangeInterval)) {
                 throw new DataModelException("Linker error: Current range intervals not processed correctly.");
@@ -594,7 +605,8 @@
      * @param refRangeRestriction referred range restriction of typedef
      * @throws DataModelException a violation in data model rule
      */
-    private void resolveRangeRestriction(YangRangeRestriction refRangeRestriction) throws DataModelException {
+    private void resolveRangeRestriction(YangRangeRestriction refRangeRestriction)
+            throws DataModelException {
 
         /*
          * Check that string restriction should be null when built-in type is
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangEnumeration.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangEnumeration.java
index 9bf924a..38b8266 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangEnumeration.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangEnumeration.java
@@ -31,7 +31,9 @@
 /**
  * Represents the enumeration data type information.
  */
-public class YangEnumeration extends YangNode implements Parsable, CollisionDetector {
+public class YangEnumeration
+        extends YangNode
+        implements Parsable, CollisionDetector {
 
     // Enumeration info set.
     private SortedSet<YangEnum> enumSet;
@@ -71,7 +73,8 @@
      * @param enumInfo the ENUM information to be added
      * @throws DataModelException due to violation in data model rules
      */
-    public void addEnumInfo(YangEnum enumInfo) throws DataModelException {
+    public void addEnumInfo(YangEnum enumInfo)
+            throws DataModelException {
         if (!getEnumSet().add(enumInfo)) {
             throw new DataModelException("YANG ENUM already exists");
         }
@@ -113,7 +116,8 @@
      * @throws DataModelException a violation of data model rules
      */
     @Override
-    public void validateDataOnEntry() throws DataModelException {
+    public void validateDataOnEntry()
+            throws DataModelException {
         // TODO auto-generated method stub, to be implemented by parser
     }
 
@@ -123,21 +127,24 @@
      * @throws DataModelException a violation of data model rules
      */
     @Override
-    public void validateDataOnExit() throws DataModelException {
+    public void validateDataOnExit()
+            throws DataModelException {
         // TODO auto-generated method stub, to be implemented by parser
     }
 
     @Override
-    public void detectCollidingChild(String identifierName, YangConstructType dataType) throws DataModelException {
+    public void detectCollidingChild(String identifierName, YangConstructType dataType)
+            throws DataModelException {
         /*
-        Do nothing.The implementation for this is not required.
+        Do nothing, since it is not part of the schema tree, it is only type of an existing node in schema tree.
          */
     }
 
     @Override
-    public void detectSelfCollision(String identifierName, YangConstructType dataType) throws DataModelException {
+    public void detectSelfCollision(String identifierName, YangConstructType dataType)
+            throws DataModelException {
         /*
-        Do nothing.The implementation for this is not required.
+        Do nothing, since it is not part of the schema tree, it is only type of an existing node in schema tree.
          */
     }
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangGrouping.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangGrouping.java
index 47abdca..68f7587 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangGrouping.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangGrouping.java
@@ -77,7 +77,8 @@
 /**
  * Represents data model node to maintain information defined in YANG grouping.
  */
-public class YangGrouping extends YangNode
+public class YangGrouping
+        extends YangNode
         implements YangLeavesHolder, YangCommonInfo, Parsable, CollisionDetector {
 
     /**
@@ -174,7 +175,8 @@
      *
      * @param leafsList the list of leaf to set
      */
-    private void setListOfLeaf(List<YangLeaf> leafsList) {
+    @Override
+    public void setListOfLeaf(List<YangLeaf> leafsList) {
         listOfLeaf = leafsList;
     }
 
@@ -203,7 +205,8 @@
      *
      * @param listOfLeafList the list of leaf-list to set
      */
-    private void setListOfLeafList(List<YangLeafList> listOfLeafList) {
+    @Override
+    public void setListOfLeafList(List<YangLeafList> listOfLeafList) {
         this.listOfLeafList = listOfLeafList;
     }
 
@@ -273,7 +276,8 @@
      * @throws DataModelException a violation of data model rules
      */
     @Override
-    public void validateDataOnEntry() throws DataModelException {
+    public void validateDataOnEntry()
+            throws DataModelException {
         // TODO auto-generated method stub, to be implemented by parser
     }
 
@@ -283,7 +287,8 @@
      * @throws DataModelException a violation of data model rules
      */
     @Override
-    public void validateDataOnExit() throws DataModelException {
+    public void validateDataOnExit()
+            throws DataModelException {
         // TODO auto-generated method stub, to be implemented by parser
     }
 
@@ -299,13 +304,15 @@
      * module.
      */
     @Override
-    public void detectCollidingChild(String identifierName, YangConstructType dataType) throws DataModelException {
+    public void detectCollidingChild(String identifierName, YangConstructType dataType)
+            throws DataModelException {
         // Asks helper to detect colliding child.
         detectCollidingChildUtil(identifierName, dataType, this);
     }
 
     @Override
-    public void detectSelfCollision(String identifierName, YangConstructType dataType) throws DataModelException {
+    public void detectSelfCollision(String identifierName, YangConstructType dataType)
+            throws DataModelException {
         if (getName().equals(identifierName)) {
             throw new DataModelException("YANG file error: Duplicate input identifier detected, same as grouping \"" +
                     getName() + "\"");
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangInput.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangInput.java
index 4d7f2df..8aceaa4 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangInput.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangInput.java
@@ -68,7 +68,8 @@
 /**
  * Represents data model node to maintain information defined in YANG input.
  */
-public class YangInput extends YangNode
+public class YangInput
+        extends YangNode
         implements YangLeavesHolder, Parsable, CollisionDetector, YangAugmentationHolder {
 
     /**
@@ -96,13 +97,15 @@
     }
 
     @Override
-    public void detectCollidingChild(String identifierName, YangConstructType dataType) throws DataModelException {
+    public void detectCollidingChild(String identifierName, YangConstructType dataType)
+            throws DataModelException {
         // Detect colliding child.
         detectCollidingChildUtil(identifierName, dataType, this);
     }
 
     @Override
-    public void detectSelfCollision(String identifierName, YangConstructType dataType) throws DataModelException {
+    public void detectSelfCollision(String identifierName, YangConstructType dataType)
+            throws DataModelException {
         if (this.getName().equals(identifierName)) {
             throw new DataModelException("YANG file error: Duplicate input identifier detected, same as input \""
                     + this.getName() + "\"");
@@ -115,12 +118,14 @@
     }
 
     @Override
-    public void validateDataOnEntry() throws DataModelException {
+    public void validateDataOnEntry()
+            throws DataModelException {
         //TODO: implement the method.
     }
 
     @Override
-    public void validateDataOnExit() throws DataModelException {
+    public void validateDataOnExit()
+            throws DataModelException {
         //TODO: implement the method.
     }
 
@@ -130,6 +135,12 @@
     }
 
     @Override
+    public void setListOfLeaf(List<YangLeaf> leafsList) {
+        listOfLeaf = leafsList;
+    }
+
+
+    @Override
     public void addLeaf(YangLeaf leaf) {
         getListOfLeaf().add(leaf);
     }
@@ -140,6 +151,11 @@
     }
 
     @Override
+    public void setListOfLeafList(List<YangLeafList> listOfLeafList) {
+        this.listOfLeafList = listOfLeafList;
+    }
+
+    @Override
     public void addLeafList(YangLeafList leafList) {
         getListOfLeafList().add(leafList);
     }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangLeaf.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangLeaf.java
index f59cdcc..9adeff7 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangLeaf.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangLeaf.java
@@ -58,7 +58,7 @@
  * Represents leaf data represented in YANG.
  */
 public class YangLeaf
-        implements YangCommonInfo, Parsable {
+        implements YangCommonInfo, Parsable, Cloneable {
 
     /**
      * Name of leaf.
@@ -107,6 +107,11 @@
     private String defaultValueInString;
 
     /**
+     * YANG Node in which the leaf is contained.
+     */
+    YangLeavesHolder containedIn;
+
+    /**
      * Creates a YANG leaf.
      */
     public YangLeaf() {
@@ -281,6 +286,30 @@
     }
 
     /**
+     * Retrieves the YANG node in which the leaf is defined.
+     *
+     * @return the YANG node in which the leaf is defined
+     */
+    public YangLeavesHolder getContainedIn() {
+        return containedIn;
+    }
+
+    /**
+     * Assigns the YANG node in which the leaf is defined.
+     *
+     * @param containedIn the YANG node in which the leaf is defined
+     */
+    public void setContainedIn(YangLeavesHolder containedIn) {
+        this.containedIn = containedIn;
+    }
+
+    @Override
+    public YangLeaf clone()
+            throws CloneNotSupportedException {
+        return (YangLeaf) super.clone();
+    }
+
+    /**
      * Returns the type of the parsed data.
      *
      * @return returns LEAF_DATA
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangLeafList.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangLeafList.java
index 0e0bc3e..5794420 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangLeafList.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangLeafList.java
@@ -54,7 +54,7 @@
  * Represents leaf-list data represented in YANG.
  */
 public class YangLeafList
-        implements YangCommonInfo, Parsable {
+        implements YangCommonInfo, Parsable, Cloneable {
 
     /**
      * Name of leaf-list.
@@ -124,6 +124,11 @@
     private YangType<?> dataType;
 
     /**
+     * YANG Node in which the leaf is contained.
+     */
+    YangLeavesHolder containedIn;
+
+    /**
      * Creates a YANG leaf-list.
      */
     public YangLeafList() {
@@ -298,6 +303,30 @@
     }
 
     /**
+     * Retrieves the YANG node in which the leaf is defined.
+     *
+     * @return the YANG node in which the leaf is defined
+     */
+    public YangLeavesHolder getContainedIn() {
+        return containedIn;
+    }
+
+    /**
+     * Assigns the YANG node in which the leaf is defined.
+     *
+     * @param containedIn the YANG node in which the leaf is defined
+     */
+    public void setContainedIn(YangLeavesHolder containedIn) {
+        this.containedIn = containedIn;
+    }
+
+    @Override
+    public YangLeafList clone()
+            throws CloneNotSupportedException {
+        return (YangLeafList) super.clone();
+    }
+
+    /**
      * Returns the type of the parsed data.
      *
      * @return returns LEAF_LIST_DATA
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangLeavesHolder.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangLeavesHolder.java
index 37ecc8f..a21ed34 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangLeavesHolder.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangLeavesHolder.java
@@ -33,6 +33,13 @@
     List<YangLeaf> getListOfLeaf();
 
     /**
+     * Sets the list of leaves.
+     *
+     * @param leafsList the list of leaf to set
+     */
+    void setListOfLeaf(List<YangLeaf> leafsList);
+
+    /**
      * Adds leaf in data holder like container / list.
      *
      * @param leaf the leaf to be added
@@ -47,6 +54,13 @@
     List<YangLeafList> getListOfLeafList();
 
     /**
+     * Sets the list of leaf-list.
+     *
+     * @param listOfLeafList the list of leaf-list to set
+     */
+    void setListOfLeafList(List<YangLeafList> listOfLeafList);
+
+    /**
      * Adds leaf-list in data holder like container / list.
      *
      * @param leafList the leaf-list to be added
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangList.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangList.java
index cd45bdc..834a0ad 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangList.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangList.java
@@ -67,7 +67,8 @@
 /**
  * Represents list data represented in YANG.
  */
-public class YangList extends YangNode
+public class YangList
+        extends YangNode
         implements YangLeavesHolder, YangCommonInfo, Parsable, CollisionDetector, YangAugmentationHolder {
 
     /**
@@ -254,7 +255,8 @@
      * @param key key field name.
      * @throws DataModelException a violation of data model rules
      */
-    public void addKey(String key) throws DataModelException {
+    public void addKey(String key)
+            throws DataModelException {
         if (getKeyList() == null) {
             setKeyList(new LinkedList<String>());
         }
@@ -282,7 +284,8 @@
      *
      * @param leafsList the list of leaf to set
      */
-    private void setListOfLeaf(List<YangLeaf> leafsList) {
+    @Override
+    public void setListOfLeaf(List<YangLeaf> leafsList) {
         listOfLeaf = leafsList;
     }
 
@@ -315,7 +318,8 @@
      *
      * @param listOfLeafList the list of leaf-list to set
      */
-    private void setListOfLeafList(List<YangLeafList> listOfLeafList) {
+    @Override
+    public void setListOfLeafList(List<YangLeafList> listOfLeafList) {
         this.listOfLeafList = listOfLeafList;
     }
 
@@ -425,7 +429,8 @@
      * @throws DataModelException a violation of data model rules
      */
     @Override
-    public void validateDataOnEntry() throws DataModelException {
+    public void validateDataOnEntry()
+            throws DataModelException {
         // TODO auto-generated method stub, to be implemented by parser
     }
 
@@ -435,7 +440,8 @@
      * @throws DataModelException a violation of data model rules
      */
     @Override
-    public void validateDataOnExit() throws DataModelException {
+    public void validateDataOnExit()
+            throws DataModelException {
         List<String> keys = getKeyList();
         List<YangLeaf> leaves = getListOfLeaf();
         List<YangLeafList> leafLists = getListOfLeafList();
@@ -493,7 +499,8 @@
      * @param leafLists list of leaf-list attributes of YANG list
      * @throws DataModelException a violation of data model rules
      */
-    private void validateConfig(List<YangLeaf> leaves, List<YangLeafList> leafLists) throws DataModelException {
+    private void validateConfig(List<YangLeaf> leaves, List<YangLeafList> leafLists)
+            throws DataModelException {
 
         /*
          * If a node has "config" set to "false", no node underneath it can have
@@ -526,7 +533,8 @@
      * @param keys list of key attributes of list
      * @throws DataModelException a violation of data model rules
      */
-    private void validateKey(List<YangLeaf> leaves, List<YangLeafList> leafLists, List<String> keys) throws
+    private void validateKey(List<YangLeaf> leaves, List<YangLeafList> leafLists, List<String> keys)
+            throws
             DataModelException {
         boolean leafFound = false;
         List<YangLeaf> keyLeaves = new LinkedList<>();
@@ -595,13 +603,15 @@
     }
 
     @Override
-    public void detectCollidingChild(String identifierName, YangConstructType dataType) throws DataModelException {
+    public void detectCollidingChild(String identifierName, YangConstructType dataType)
+            throws DataModelException {
         // Asks helper to detect colliding child.
         detectCollidingChildUtil(identifierName, dataType, this);
     }
 
     @Override
-    public void detectSelfCollision(String identifierName, YangConstructType dataType) throws DataModelException {
+    public void detectSelfCollision(String identifierName, YangConstructType dataType)
+            throws DataModelException {
         if (getName().equals(identifierName)) {
             throw new DataModelException("YANG file error: Duplicate input identifier detected, same as list \"" +
                     getName() + "\"");
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangModule.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangModule.java
index 26df1f5..11b089d 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangModule.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangModule.java
@@ -19,9 +19,11 @@
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Set;
+
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
 import org.onosproject.yangutils.linker.exceptions.LinkerException;
-import org.onosproject.yangutils.linker.impl.YangReferenceResolver;
+import org.onosproject.yangutils.linker.ResolvableType;
+import org.onosproject.yangutils.linker.YangReferenceResolver;
 import org.onosproject.yangutils.linker.impl.YangResolutionInfo;
 import org.onosproject.yangutils.parser.Parsable;
 import org.onosproject.yangutils.plugin.manager.YangFileInfo;
@@ -74,7 +76,8 @@
 /**
  * Represents data model node to maintain information defined in YANG module.
  */
-public class YangModule extends YangNode
+public class YangModule
+        extends YangNode
         implements YangLeavesHolder, YangDesc, YangReference, Parsable, CollisionDetector, YangReferenceResolver,
         RpcNotificationContainer {
 
@@ -85,7 +88,7 @@
 
     /**
      * Reference:RFC 6020.
-     * <p>
+     *
      * The "contact" statement provides contact information for the module. The
      * argument is a string that is used to specify contact information for the
      * person or persons to whom technical queries concerning this module should
@@ -96,7 +99,7 @@
 
     /**
      * Reference:RFC 6020.
-     * <p>
+     *
      * The "description" statement takes as an argument a string that contains a
      * human-readable textual description of this definition. The text is
      * provided in a language (or languages) chosen by the module developer; for
@@ -131,7 +134,7 @@
 
     /**
      * Reference:RFC 6020.
-     * <p>
+     *
      * The "organization" statement defines the party responsible for this
      * module. The argument is a string that is used to specify a textual
      * description of the organization(s) under whose auspices this module was
@@ -193,7 +196,12 @@
      * matching "typedef" or "grouping" statement among the immediate
      * sub-statements of each ancestor statement.
      */
-    private List<YangResolutionInfo> unresolvedResolutionList;
+    private List<YangResolutionInfo> derivedTypeResolutionList;
+
+    /**
+     * uses resolution list.
+     */
+    private List<YangResolutionInfo> usesResolutionList;
 
     /**
      * Creates a YANG node of module type.
@@ -201,7 +209,8 @@
     public YangModule() {
 
         super(YangNodeType.MODULE_NODE);
-        unresolvedResolutionList = new LinkedList<YangResolutionInfo>();
+        derivedTypeResolutionList = new LinkedList<YangResolutionInfo>();
+        usesResolutionList = new LinkedList<YangResolutionInfo>();
         importList = new LinkedList<YangImport>();
         includeList = new LinkedList<YangInclude>();
         listOfLeaf = new LinkedList<YangLeaf>();
@@ -326,6 +335,11 @@
         return listOfLeaf;
     }
 
+    @Override
+    public void setListOfLeaf(List<YangLeaf> leafsList) {
+        listOfLeaf = leafsList;
+    }
+
     /**
      * Adds a leaf in module.
      *
@@ -346,6 +360,12 @@
         return listOfLeafList;
     }
 
+    @Override
+    public void setListOfLeafList(List<YangLeafList> listOfLeafList) {
+        this.listOfLeafList = listOfLeafList;
+    }
+
+
     /**
      * Adds a leaf-list in module.
      *
@@ -413,17 +433,19 @@
     }
 
     @Override
-    public void resolveSelfFileLinking() throws DataModelException {
+    public void resolveSelfFileLinking(ResolvableType type)
+            throws DataModelException {
         // Get the list to be resolved.
-        List<YangResolutionInfo> resolutionList = getUnresolvedResolutionList();
+        List<YangResolutionInfo> resolutionList = getUnresolvedResolutionList(type);
         // Resolve linking for a resolution list.
         resolveLinkingForResolutionList(resolutionList, this);
     }
 
     @Override
-    public void resolveInterFileLinking() throws DataModelException {
+    public void resolveInterFileLinking(ResolvableType type)
+            throws DataModelException {
         // Get the list to be resolved.
-        List<YangResolutionInfo> resolutionList = getUnresolvedResolutionList();
+        List<YangResolutionInfo> resolutionList = getUnresolvedResolutionList(type);
         // Resolve linking for a resolution list.
         linkInterFileReferences(resolutionList, this);
     }
@@ -500,7 +522,8 @@
      * @throws DataModelException a violation of data model rules
      */
     @Override
-    public void validateDataOnEntry() throws DataModelException {
+    public void validateDataOnEntry()
+            throws DataModelException {
         /*
          * Module is root in the data model tree, hence there is no entry
          * validation
@@ -513,7 +536,8 @@
      * @throws DataModelException a violation of data model rules
      */
     @Override
-    public void validateDataOnExit() throws DataModelException {
+    public void validateDataOnExit()
+            throws DataModelException {
         /*
          * TODO: perform symbol linking for the imported or included YANG info.
          * TODO: perform symbol resolution for referred YANG entities.
@@ -521,29 +545,47 @@
     }
 
     @Override
-    public void detectCollidingChild(String identifierName, YangConstructType dataType) throws DataModelException {
+    public void detectCollidingChild(String identifierName, YangConstructType dataType)
+            throws DataModelException {
         // Asks helper to detect colliding child.
         detectCollidingChildUtil(identifierName, dataType, this);
     }
 
     @Override
-    public void detectSelfCollision(String identifierName, YangConstructType dataType) throws DataModelException {
+    public void detectSelfCollision(String identifierName, YangConstructType dataType)
+            throws DataModelException {
         // Not required as module doesn't have any parent.
     }
 
     @Override
-    public List<YangResolutionInfo> getUnresolvedResolutionList() {
-        return unresolvedResolutionList;
+    public List<YangResolutionInfo> getUnresolvedResolutionList(ResolvableType type) {
+        if (type == ResolvableType.YANG_DERIVED_DATA_TYPE) {
+            return derivedTypeResolutionList;
+        } else {
+            return usesResolutionList;
+        }
+
     }
 
     @Override
-    public void addToResolutionList(YangResolutionInfo resolutionInfo) {
-        unresolvedResolutionList.add(resolutionInfo);
+    public void addToResolutionList(YangResolutionInfo resolutionInfo,
+            ResolvableType type) {
+        if (type == ResolvableType.YANG_DERIVED_DATA_TYPE) {
+            derivedTypeResolutionList.add(resolutionInfo);
+        } else if (type == ResolvableType.YANG_USES) {
+            usesResolutionList.add(resolutionInfo);
+        }
     }
 
     @Override
-    public void setResolutionList(List<YangResolutionInfo> resolutionList) {
-        unresolvedResolutionList = resolutionList;
+    public void setResolutionList(List<YangResolutionInfo> resolutionList,
+            ResolvableType type) {
+        if (type == ResolvableType.YANG_DERIVED_DATA_TYPE) {
+            derivedTypeResolutionList = resolutionList;
+        } else if (type == ResolvableType.YANG_USES) {
+            usesResolutionList = resolutionList;
+        }
+
     }
 
     @Override
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangNode.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangNode.java
index 811c76e..f9d5b26 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangNode.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangNode.java
@@ -16,12 +16,6 @@
 package org.onosproject.yangutils.datamodel;
 
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
-import org.onosproject.yangutils.parser.Parsable;
-import org.onosproject.yangutils.translator.tojava.TraversalType;
-
-import static org.onosproject.yangutils.translator.tojava.TraversalType.CHILD;
-import static org.onosproject.yangutils.translator.tojava.TraversalType.PARENT;
-import static org.onosproject.yangutils.translator.tojava.TraversalType.SIBILING;
 
 /**
  * Represents base class of a node in data model tree.
@@ -229,179 +223,4 @@
             newChild.setPreviousSibling(curNode);
         }
     }
-
-    /**
-     * Clone the current node contents and create a new node.
-     *
-     * @return cloned node
-     * @throws CloneNotSupportedException clone is not supported by the referred
-     *             node
-     */
-    @Override
-    public YangNode clone()
-            throws CloneNotSupportedException {
-        YangNode clonedNode = (YangNode) super.clone();
-        clonedNode.setParent(null);
-        clonedNode.setChild(null);
-        clonedNode.setNextSibling(null);
-        clonedNode.setPreviousSibling(null);
-        return clonedNode;
-    }
-
-    /**
-     * Clone the subtree from the specified source node to the mentioned target
-     * node. The source and target root node cloning is carried out by the
-     * caller.
-     *
-     * @param srcRootNode source node for sub tree cloning
-     * @param dstRootNode destination node where the sub tree needs to be cloned
-     * @throws DataModelException data model error
-     */
-    public static void cloneSubTree(YangNode srcRootNode, YangNode dstRootNode)
-            throws DataModelException {
-
-        YangNode nextNodeToClone = srcRootNode;
-        TraversalType curTraversal;
-
-        YangNode clonedTreeCurNode = dstRootNode;
-        YangNode newNode = null;
-
-        nextNodeToClone = nextNodeToClone.getChild();
-        if (nextNodeToClone == null) {
-            return;
-        } else {
-            /**
-             * Root level cloning is taken care in the caller.
-             */
-            curTraversal = CHILD;
-        }
-
-        /**
-         * Caller ensures the cloning of the root nodes
-         */
-        try {
-            while (nextNodeToClone != srcRootNode) {
-                if (nextNodeToClone == null) {
-                    throw new DataModelException("Internal error: Cloning failed, source tree null pointer reached");
-                }
-                if (curTraversal != PARENT) {
-                    newNode = nextNodeToClone.clone();
-                    detectCollisionWhileCloning(clonedTreeCurNode, newNode, curTraversal);
-                }
-
-                if (curTraversal == CHILD) {
-
-                    /**
-                     * add the new node to the cloned tree.
-                     */
-                    clonedTreeCurNode.addChild(newNode);
-
-                    /**
-                     * update the cloned tree's traversal current node as the
-                     * new node.
-                     */
-                    clonedTreeCurNode = newNode;
-                } else if (curTraversal == SIBILING) {
-
-                    clonedTreeCurNode.addNextSibling(newNode);
-                    clonedTreeCurNode = newNode;
-                } else if (curTraversal == PARENT) {
-                    clonedTreeCurNode = clonedTreeCurNode.getParent();
-                }
-
-                if (curTraversal != PARENT && nextNodeToClone.getChild() != null) {
-                    curTraversal = CHILD;
-
-                    /**
-                     * update the traversal's current node.
-                     */
-                    nextNodeToClone = nextNodeToClone.getChild();
-
-                } else if (nextNodeToClone.getNextSibling() != null) {
-
-                    curTraversal = SIBILING;
-
-                    nextNodeToClone = nextNodeToClone.getNextSibling();
-                } else {
-                    curTraversal = PARENT;
-                    nextNodeToClone = nextNodeToClone.getParent();
-                }
-            }
-        } catch (CloneNotSupportedException e) {
-            throw new DataModelException("Failed to clone the tree");
-        }
-
-    }
-
-    /**
-     * Detects collision when the grouping is deep copied to the uses's parent.
-     *
-     * @param currentNode parent/previous sibling node for the new node
-     * @param newNode node which has to be added
-     * @param addAs traversal type of the node
-     * @throws DataModelException data model error
-     */
-    private static void detectCollisionWhileCloning(YangNode currentNode, YangNode newNode, TraversalType addAs)
-            throws DataModelException {
-        if (!(currentNode instanceof CollisionDetector)
-                || !(newNode instanceof Parsable)) {
-            throw new DataModelException("Node in data model tree does not support collision detection");
-        }
-
-        CollisionDetector collisionDetector = (CollisionDetector) currentNode;
-        Parsable parsable = (Parsable) newNode;
-        if (addAs == TraversalType.CHILD) {
-            collisionDetector.detectCollidingChild(newNode.getName(), parsable.getYangConstructType());
-        } else if (addAs == TraversalType.SIBILING) {
-            currentNode = currentNode.getParent();
-            if (!(currentNode instanceof CollisionDetector)) {
-                throw new DataModelException("Node in data model tree does not support collision detection");
-            }
-            collisionDetector = (CollisionDetector) currentNode;
-            collisionDetector.detectCollidingChild(newNode.getName(), parsable.getYangConstructType());
-        } else {
-            throw new DataModelException("Errored tree cloning");
-        }
-
-    }
-
-    /**
-     * Add a new next sibling.
-     *
-     * @param newSibling new sibling to be added
-     * @throws DataModelException data model error
-     */
-    private void addNextSibling(YangNode newSibling)
-            throws DataModelException {
-
-        if (newSibling.getNodeType() == null) {
-            throw new DataModelException("Cloned abstract node cannot be inserted into a tree");
-        }
-
-        if (newSibling.getParent() == null) {
-            /**
-             * Since the siblings needs to have a common parent, set the parent
-             * as the current node's parent
-             */
-            newSibling.setParent(getParent());
-
-        } else {
-            throw new DataModelException("Node is already part of a tree, and cannot be added as a sibling");
-        }
-
-        if (newSibling.getPreviousSibling() == null) {
-            newSibling.setPreviousSibling(this);
-            setNextSibling(newSibling);
-        } else {
-            throw new DataModelException("New sibling to be added is not atomic, it already has a previous sibling");
-        }
-
-        if (newSibling.getChild() != null) {
-            throw new DataModelException("Sibling to be added is not atomic, it already has a child");
-        }
-
-        if (newSibling.getNextSibling() != null) {
-            throw new DataModelException("Sibling to be added is not atomic, it already has a next sibling");
-        }
-    }
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangNotification.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangNotification.java
index 5e81f64..e70261f 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangNotification.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangNotification.java
@@ -74,7 +74,8 @@
 /**
  * Represents data model node to maintain information defined in YANG notification.
  */
-public class YangNotification extends YangNode
+public class YangNotification
+        extends YangNode
         implements YangLeavesHolder, YangCommonInfo, Parsable, CollisionDetector, YangAugmentationHolder {
 
     /**
@@ -117,13 +118,15 @@
     }
 
     @Override
-    public void detectCollidingChild(String identifierName, YangConstructType dataType) throws DataModelException {
+    public void detectCollidingChild(String identifierName, YangConstructType dataType)
+            throws DataModelException {
         // Detect colliding child.
         detectCollidingChildUtil(identifierName, dataType, this);
     }
 
     @Override
-    public void detectSelfCollision(String identifierName, YangConstructType dataType) throws DataModelException {
+    public void detectSelfCollision(String identifierName, YangConstructType dataType)
+            throws DataModelException {
         if (this.getName().equals(identifierName)) {
             throw new DataModelException("YANG file error: Duplicate input identifier detected, same as notification \""
                     + this.getName() + "\"");
@@ -136,12 +139,14 @@
     }
 
     @Override
-    public void validateDataOnEntry() throws DataModelException {
+    public void validateDataOnEntry()
+            throws DataModelException {
         //TODO: implement the method.
     }
 
     @Override
-    public void validateDataOnExit() throws DataModelException {
+    public void validateDataOnExit()
+            throws DataModelException {
         //TODO: implement the method.
     }
 
@@ -161,6 +166,11 @@
     }
 
     @Override
+    public void setListOfLeaf(List<YangLeaf> leafsList) {
+        listOfLeaf = leafsList;
+    }
+
+    @Override
     public void addLeaf(YangLeaf leaf) {
         getListOfLeaf().add(leaf);
     }
@@ -171,6 +181,11 @@
     }
 
     @Override
+    public void setListOfLeafList(List<YangLeafList> listOfLeafList) {
+        this.listOfLeafList = listOfLeafList;
+    }
+
+    @Override
     public void addLeafList(YangLeafList leafList) {
         getListOfLeafList().add(leafList);
     }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangOutput.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangOutput.java
index 97072cf..2cb4c34 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangOutput.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangOutput.java
@@ -67,7 +67,8 @@
 /**
  * Represents data model node to maintain information defined in YANG output.
  */
-public class YangOutput extends YangNode
+public class YangOutput
+        extends YangNode
         implements YangLeavesHolder, Parsable, CollisionDetector, YangAugmentationHolder {
 
     /**
@@ -95,13 +96,15 @@
     }
 
     @Override
-    public void detectCollidingChild(String identifierName, YangConstructType dataType) throws DataModelException {
+    public void detectCollidingChild(String identifierName, YangConstructType dataType)
+            throws DataModelException {
         // Detect colliding child.
         detectCollidingChildUtil(identifierName, dataType, this);
     }
 
     @Override
-    public void detectSelfCollision(String identifierName, YangConstructType dataType) throws DataModelException {
+    public void detectSelfCollision(String identifierName, YangConstructType dataType)
+            throws DataModelException {
         if (this.getName().equals(identifierName)) {
             throw new DataModelException("YANG file error: Duplicate identifier detected, same as output \""
                     + this.getName() + "\"");
@@ -114,12 +117,14 @@
     }
 
     @Override
-    public void validateDataOnEntry() throws DataModelException {
+    public void validateDataOnEntry()
+            throws DataModelException {
         //TODO: implement the method.
     }
 
     @Override
-    public void validateDataOnExit() throws DataModelException {
+    public void validateDataOnExit()
+            throws DataModelException {
         //TODO: implement the method.
     }
 
@@ -134,11 +139,22 @@
     }
 
     @Override
+    public void setListOfLeaf(List<YangLeaf> leafsList) {
+        listOfLeaf = leafsList;
+    }
+
+    @Override
     public List<YangLeafList> getListOfLeafList() {
         return listOfLeafList;
     }
 
     @Override
+    public void setListOfLeafList(List<YangLeafList> listOfLeafList) {
+        this.listOfLeafList = listOfLeafList;
+    }
+
+
+    @Override
     public void addLeafList(YangLeafList leafList) {
         getListOfLeafList().add(leafList);
     }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangSubModule.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangSubModule.java
index 7a54aaf..89c49dd 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangSubModule.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangSubModule.java
@@ -19,9 +19,11 @@
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Set;
+
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
 import org.onosproject.yangutils.linker.exceptions.LinkerException;
-import org.onosproject.yangutils.linker.impl.YangReferenceResolver;
+import org.onosproject.yangutils.linker.ResolvableType;
+import org.onosproject.yangutils.linker.YangReferenceResolver;
 import org.onosproject.yangutils.linker.impl.YangResolutionInfo;
 import org.onosproject.yangutils.parser.Parsable;
 import org.onosproject.yangutils.plugin.manager.YangFileInfo;
@@ -82,7 +84,8 @@
 /**
  * Represents data model node to maintain information defined in YANG sub-module.
  */
-public class YangSubModule extends YangNode
+public class YangSubModule
+        extends YangNode
         implements YangLeavesHolder, YangDesc, YangReference, Parsable, CollisionDetector, YangReferenceResolver,
         RpcNotificationContainer {
 
@@ -156,6 +159,7 @@
      * Prefix of parent module.
      */
     private String prefix;
+
     /*-
      * Reference RFC 6020.
      *
@@ -190,14 +194,20 @@
      * matching "typedef" or "grouping" statement among the immediate
      * sub-statements of each ancestor statement.
      */
-    private List<YangResolutionInfo> unresolvedResolutionList;
+    private List<YangResolutionInfo> derivedTypeResolutionList;
+
+    /**
+     * uses resolution list.
+     */
+    private List<YangResolutionInfo> usesResolutionList;
 
     /**
      * Creates a sub module node.
      */
     public YangSubModule() {
         super(YangNodeType.SUB_MODULE_NODE);
-        unresolvedResolutionList = new LinkedList<YangResolutionInfo>();
+        derivedTypeResolutionList = new LinkedList<YangResolutionInfo>();
+        usesResolutionList = new LinkedList<YangResolutionInfo>();
         importList = new LinkedList<YangImport>();
         includeList = new LinkedList<YangInclude>();
         listOfLeaf = new LinkedList<YangLeaf>();
@@ -341,17 +351,19 @@
     }
 
     @Override
-    public void resolveSelfFileLinking() throws DataModelException {
+    public void resolveSelfFileLinking(ResolvableType type)
+            throws DataModelException {
         // Get the list to be resolved.
-        List<YangResolutionInfo> resolutionList = getUnresolvedResolutionList();
+        List<YangResolutionInfo> resolutionList = getUnresolvedResolutionList(type);
         // Resolve linking for a resolution list.
         resolveLinkingForResolutionList(resolutionList, this);
     }
 
     @Override
-    public void resolveInterFileLinking() throws DataModelException {
+    public void resolveInterFileLinking(ResolvableType type)
+            throws DataModelException {
         // Get the list to be resolved.
-        List<YangResolutionInfo> resolutionList = getUnresolvedResolutionList();
+        List<YangResolutionInfo> resolutionList = getUnresolvedResolutionList(type);
         // Resolve linking for a resolution list.
         linkInterFileReferences(resolutionList, this);
     }
@@ -366,6 +378,11 @@
         return listOfLeaf;
     }
 
+    @Override
+    public void setListOfLeaf(List<YangLeaf> leafsList) {
+        listOfLeaf = leafsList;
+    }
+
     /**
      * Adds a leaf.
      *
@@ -386,6 +403,11 @@
         return listOfLeafList;
     }
 
+    @Override
+    public void setListOfLeafList(List<YangLeafList> listOfLeafList) {
+        this.listOfLeafList = listOfLeafList;
+    }
+
     /**
      * Adds a leaf-list.
      *
@@ -486,7 +508,8 @@
      * @throws DataModelException a violation of data model rules
      */
     @Override
-    public void validateDataOnEntry() throws DataModelException {
+    public void validateDataOnEntry()
+            throws DataModelException {
         // TODO auto-generated method stub, to be implemented by parser
     }
 
@@ -496,34 +519,52 @@
      * @throws DataModelException a violation of data model rules
      */
     @Override
-    public void validateDataOnExit() throws DataModelException {
+    public void validateDataOnExit()
+            throws DataModelException {
         // TODO auto-generated method stub, to be implemented by parser
     }
 
     @Override
-    public void detectCollidingChild(String identifierName, YangConstructType dataType) throws DataModelException {
+    public void detectCollidingChild(String identifierName, YangConstructType dataType)
+            throws DataModelException {
         // Asks helper to detect colliding child.
         detectCollidingChildUtil(identifierName, dataType, this);
     }
 
     @Override
-    public void detectSelfCollision(String identifierName, YangConstructType dataType) throws DataModelException {
+    public void detectSelfCollision(String identifierName, YangConstructType dataType)
+            throws DataModelException {
         // Not required as module doesn't have any parent.
     }
 
     @Override
-    public List<YangResolutionInfo> getUnresolvedResolutionList() {
-        return unresolvedResolutionList;
+    public List<YangResolutionInfo> getUnresolvedResolutionList(ResolvableType type) {
+        if (type == ResolvableType.YANG_DERIVED_DATA_TYPE) {
+            return derivedTypeResolutionList;
+        } else {
+            return usesResolutionList;
+        }
     }
 
     @Override
-    public void addToResolutionList(YangResolutionInfo resolutionInfo) {
-        this.unresolvedResolutionList.add(resolutionInfo);
+    public void addToResolutionList(YangResolutionInfo resolutionInfo,
+            ResolvableType type) {
+        if (type == ResolvableType.YANG_DERIVED_DATA_TYPE) {
+            derivedTypeResolutionList.add(resolutionInfo);
+        } else if (type == ResolvableType.YANG_USES) {
+            usesResolutionList.add(resolutionInfo);
+        }
     }
 
     @Override
-    public void setResolutionList(List<YangResolutionInfo> resolutionList) {
-        this.unresolvedResolutionList = resolutionList;
+    public void setResolutionList(List<YangResolutionInfo> resolutionList,
+            ResolvableType type) {
+        if (type == ResolvableType.YANG_DERIVED_DATA_TYPE) {
+            derivedTypeResolutionList = resolutionList;
+        } else if (type == ResolvableType.YANG_USES) {
+            usesResolutionList = resolutionList;
+        }
+
     }
 
     /**
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangType.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangType.java
index 4421619..41e07e4 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangType.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangType.java
@@ -17,9 +17,9 @@
 package org.onosproject.yangutils.datamodel;
 
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.linker.Resolvable;
+import org.onosproject.yangutils.linker.ResolvableStatus;
 import org.onosproject.yangutils.linker.exceptions.LinkerException;
-import org.onosproject.yangutils.linker.impl.Resolvable;
-import org.onosproject.yangutils.linker.impl.ResolvableStatus;
 import org.onosproject.yangutils.parser.Parsable;
 import org.onosproject.yangutils.utils.YangConstructType;
 
@@ -247,7 +247,8 @@
     }
 
     @Override
-    public void resolve() throws LinkerException {
+    public void resolve()
+            throws LinkerException {
        /*
         * Check whether the data type is derived.
         */
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangUses.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangUses.java
index 4eae3a2..d2d8bc2 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangUses.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/YangUses.java
@@ -15,10 +15,13 @@
  */
 package org.onosproject.yangutils.datamodel;
 
+import java.util.LinkedList;
+import java.util.List;
+
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.linker.Resolvable;
+import org.onosproject.yangutils.linker.ResolvableStatus;
 import org.onosproject.yangutils.linker.exceptions.LinkerException;
-import org.onosproject.yangutils.linker.impl.Resolvable;
-import org.onosproject.yangutils.linker.impl.ResolvableStatus;
 import org.onosproject.yangutils.parser.Parsable;
 import org.onosproject.yangutils.utils.YangConstructType;
 
@@ -96,12 +99,30 @@
     private ResolvableStatus resolvableStatus;
 
     /**
+     * Effective list of nodes of grouping that needs to replicated at YANG uses.
+     */
+    List<YangNode> resolvedGroupingNodes;
+
+    /**
+     * Effective list of leaves of grouping that needs to replicated at YANG uses.
+     */
+    List<List<YangLeaf>> resolvedGroupingLeaves;
+
+    /**
+     * Effective list of leaf lists of grouping that needs to replicated at YANG uses.
+     */
+    List<List<YangLeafList>> resolvedGroupingLeafLists;
+
+    /**
      * Creates an YANG uses node.
      */
     public YangUses() {
         super(YangNodeType.USES_NODE);
         nodeIdentifier = new YangNodeIdentifier();
         resolvableStatus = ResolvableStatus.UNRESOLVED;
+        resolvedGroupingNodes = new LinkedList<YangNode>();
+        resolvedGroupingLeaves = new LinkedList<List<YangLeaf>>();
+        resolvedGroupingLeafLists = new LinkedList<List<YangLeafList>>();
     }
 
     /**
@@ -277,36 +298,132 @@
         }
 
         YangLeavesHolder usesParentLeavesHolder = (YangLeavesHolder) usesParentNode;
-        if (referredGrouping.getListOfLeaf() != null) {
-            for (YangLeaf leaf : referredGrouping.getListOfLeaf()) {
-                try {
-                    ((CollisionDetector) usesParentLeavesHolder).detectCollidingChild(leaf.getName(),
-                            YangConstructType.LEAF_DATA);
-                } catch (DataModelException e) {
-                    throw new LinkerException(e.getMessage());
-                }
-                usesParentLeavesHolder.addLeaf(leaf);
-            }
-        }
-        if (referredGrouping.getListOfLeafList() != null) {
-            for (YangLeafList leafList : referredGrouping.getListOfLeafList()) {
-                try {
-                    ((CollisionDetector) usesParentLeavesHolder).detectCollidingChild(leafList.getName(),
-                            YangConstructType.LEAF_LIST_DATA);
-                } catch (DataModelException e) {
-                    throw new LinkerException(e.getMessage());
-                }
-                usesParentLeavesHolder.addLeafList(leafList);
-            }
+        if (referredGrouping.getListOfLeaf() != null
+                && referredGrouping.getListOfLeaf().size() != 0) {
+            addLeavesOfGrouping(
+                    cloneLeavesList(referredGrouping.getListOfLeaf(),
+                            usesParentLeavesHolder));
         }
 
-        try {
-            YangNode.cloneSubTree(getRefGroup(), usesParentNode);
-        } catch (DataModelException e) {
-            throw new LinkerException(e.getMessage());
+        if (referredGrouping.getListOfLeafList() != null
+                && referredGrouping.getListOfLeafList().size() != 0) {
+            addListOfLeafListOfGrouping(
+                    cloneListOfLeafList(referredGrouping.getListOfLeafList(),
+                            usesParentLeavesHolder));
+        }
+
+        YangNode childInGrouping = referredGrouping.getChild();
+
+        while (childInGrouping != null) {
+            if ((childInGrouping instanceof YangEnumeration)
+                    || (childInGrouping instanceof YangUnion)
+                    || (childInGrouping instanceof YangTypeDef)) {
+
+                /*
+                 * No need to copy the leaves, union / enum class,
+                 * as these will be generated in the scope of grouping
+                 */
+                childInGrouping = childInGrouping.getNextSibling();
+                continue;
+            } else if ((childInGrouping instanceof YangUses)) {
+                addResolvedUsesInfoOfGrouping((YangUses) childInGrouping,
+                        usesParentLeavesHolder);
+            } else {
+                addNodeOfGrouping(childInGrouping);
+            }
+
+            childInGrouping = childInGrouping.getNextSibling();
         }
     }
 
+    /**
+     * Clone the resolved uses contained in grouping to the uses of grouping.
+     *
+     * @param usesInGrouping resolved uses in grouping
+     * @param usesHolder     holder of uses
+     */
+    private void addResolvedUsesInfoOfGrouping(YangUses usesInGrouping,
+            YangLeavesHolder usesHolder) {
+        for (YangNode usesResolvedNode :
+                usesInGrouping.getUsesResolvedNodeList()) {
+            addNodeOfGrouping(usesResolvedNode);
+        }
+
+        for (List<YangLeaf> leavesList :
+                usesInGrouping.getUsesResolvedLeavesList()) {
+            addLeavesOfGrouping(cloneLeavesList(leavesList, usesHolder));
+        }
+
+        for (List<YangLeafList> listOfLeafLists :
+                usesInGrouping.getUsesResolvedListOfLeafList()) {
+            addListOfLeafListOfGrouping(
+                    cloneListOfLeafList(listOfLeafLists, usesHolder));
+        }
+    }
+
+    /**
+     * Clone the list of leaves and return the cloned list leaves.
+     *
+     * @param listOfLeaves   list of leaves to be cloned
+     * @param usesParentNode parent of the cloned location
+     * @return cloned list of leaves
+     */
+    private List<YangLeaf> cloneLeavesList(List<YangLeaf> listOfLeaves,
+            YangLeavesHolder usesParentNode) {
+        if ((listOfLeaves == null) || listOfLeaves.size() == 0) {
+            throw new LinkerException("No leaves to clone");
+        }
+
+        List<YangLeaf> newLeavesList = new LinkedList<YangLeaf>();
+        for (YangLeaf leaf : listOfLeaves) {
+            YangLeaf clonedLeaf;
+            try {
+                ((CollisionDetector) usesParentNode).detectCollidingChild(leaf.getName(),
+                        YangConstructType.LEAF_DATA);
+                clonedLeaf = leaf.clone();
+            } catch (CloneNotSupportedException | DataModelException e) {
+                throw new LinkerException(e.getMessage());
+            }
+
+            clonedLeaf.setContainedIn(usesParentNode);
+            newLeavesList.add(clonedLeaf);
+        }
+
+        return newLeavesList;
+    }
+
+    /**
+     * Clone the list of leaf list.
+     *
+     * @param listOfLeafList list of leaf list that needs to be cloned
+     * @param usesParentNode parent of uses
+     * @return cloned list of leaf list
+     */
+    private List<YangLeafList> cloneListOfLeafList(List<YangLeafList> listOfLeafList,
+            YangLeavesHolder usesParentNode) {
+        if ((listOfLeafList == null) || listOfLeafList.size() == 0) {
+            throw new LinkerException("No leaf lists to clone");
+        }
+
+        List<YangLeafList> newListOfLeafList = new LinkedList<YangLeafList>();
+        for (YangLeafList leafList : listOfLeafList) {
+            YangLeafList clonedLeafList;
+            try {
+                ((CollisionDetector) usesParentNode).detectCollidingChild(leafList.getName(),
+                        YangConstructType.LEAF_LIST_DATA);
+                clonedLeafList = leafList.clone();
+            } catch (CloneNotSupportedException | DataModelException e) {
+                throw new LinkerException(e.getMessage());
+            }
+
+            clonedLeafList.setContainedIn(usesParentNode);
+            newListOfLeafList.add(clonedLeafList);
+        }
+
+        return newListOfLeafList;
+    }
+
+
     @Override
     public ResolvableStatus getResolvableStatus() {
         return resolvableStatus;
@@ -318,12 +435,14 @@
     }
 
     @Override
-    public void detectCollidingChild(String identifierName, YangConstructType dataType) throws DataModelException {
+    public void detectCollidingChild(String identifierName, YangConstructType dataType)
+            throws DataModelException {
         detectCollidingChildUtil(identifierName, dataType, this);
     }
 
     @Override
-    public void detectSelfCollision(String identifierName, YangConstructType dataType) throws DataModelException {
+    public void detectSelfCollision(String identifierName, YangConstructType dataType)
+            throws DataModelException {
 
         if (getName().equals(identifierName)) {
             throw new DataModelException("YANG file error: Duplicate input identifier detected, same as uses \""
@@ -331,4 +450,61 @@
         }
     }
 
+
+    /**
+     * Adds the node under grouping to the effective uses resolved info.
+     *
+     * @param nodeInGrouping node defined under grouping which needs to be copied in
+     *                       the context of uses
+     */
+    public void addNodeOfGrouping(YangNode nodeInGrouping) {
+        resolvedGroupingNodes.add(nodeInGrouping);
+    }
+
+    /**
+     * Returns the effective list of nodes added due to uses linking.
+     *
+     * @return effective list of nodes added due to uses linking
+     */
+    public List<YangNode> getUsesResolvedNodeList() {
+        return resolvedGroupingNodes;
+    }
+
+    /**
+     * Adds the leaves under grouping to the effective uses resolved info.
+     *
+     * @param leavesInGrouping Leaves defined under grouping which needs to be copied in
+     *                         the context of uses
+     */
+    public void addLeavesOfGrouping(List<YangLeaf> leavesInGrouping) {
+        resolvedGroupingLeaves.add(leavesInGrouping);
+    }
+
+    /**
+     * Returns the effective list of Leaves added due to uses linking.
+     *
+     * @return effective list of Leaves added due to uses linking
+     */
+    public List<List<YangLeaf>> getUsesResolvedLeavesList() {
+        return resolvedGroupingLeaves;
+    }
+
+    /**
+     * Adds the leaf-lists under grouping to the effective uses resolved info.
+     *
+     * @param leafListsInGrouping leaf-lists defined under grouping which needs to be copied in
+     *                            the context of uses
+     */
+    public void addListOfLeafListOfGrouping(List<YangLeafList> leafListsInGrouping) {
+        resolvedGroupingLeafLists.add(leafListsInGrouping);
+    }
+
+    /**
+     * Returns the effective list of Leaves added due to uses linking.
+     *
+     * @return effective list of Leaves added due to uses linking
+     */
+    public List<List<YangLeafList>> getUsesResolvedListOfLeafList() {
+        return resolvedGroupingLeafLists;
+    }
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/utils/DataModelUtils.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/utils/DataModelUtils.java
index ea17891..29d384b 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/utils/DataModelUtils.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/datamodel/utils/DataModelUtils.java
@@ -18,15 +18,18 @@
 
 import java.util.List;
 import java.util.Set;
+
 import org.onosproject.yangutils.datamodel.CollisionDetector;
 import org.onosproject.yangutils.datamodel.YangLeaf;
 import org.onosproject.yangutils.datamodel.YangLeafList;
 import org.onosproject.yangutils.datamodel.YangLeavesHolder;
 import org.onosproject.yangutils.datamodel.YangNode;
-import org.onosproject.yangutils.linker.impl.YangReferenceResolver;
-import org.onosproject.yangutils.linker.impl.YangResolutionInfo;
 import org.onosproject.yangutils.datamodel.YangRpc;
+import org.onosproject.yangutils.datamodel.YangType;
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.linker.ResolvableType;
+import org.onosproject.yangutils.linker.YangReferenceResolver;
+import org.onosproject.yangutils.linker.impl.YangResolutionInfo;
 import org.onosproject.yangutils.parser.Parsable;
 import org.onosproject.yangutils.plugin.manager.YangFileInfo;
 import org.onosproject.yangutils.utils.YangConstructType;
@@ -45,8 +48,7 @@
     /**
      * Detects the colliding identifier name in a given YANG node and its child.
      *
-     * @param identifierName name for which collision detection is to be
-     *                       checked
+     * @param identifierName name for which collision detection is to be checked
      * @param dataType       type of YANG node asking for detecting collision
      * @param node           instance of calling node
      * @throws DataModelException a violation of data model rules
@@ -77,8 +79,7 @@
     /**
      * Detects colliding of uses and grouping only with uses and grouping respectively.
      *
-     * @param identifierName name for which collision detection is to be
-     *                       checked
+     * @param identifierName name for which collision detection is to be checked
      * @param dataType       type of YANG node asking for detecting collision
      * @param node           node instance of calling node
      * @throws DataModelException a violation of data model rules
@@ -101,8 +102,7 @@
      * Detects the colliding identifier name in a given leaf node.
      *
      * @param listOfLeaf     List of leaves to detect collision
-     * @param identifierName name for which collision detection is to be
-     *                       checked
+     * @param identifierName name for which collision detection is to be checked
      * @throws DataModelException a violation of data model rules
      */
     private static void detectCollidingLeaf(List<YangLeaf> listOfLeaf, String identifierName)
@@ -123,8 +123,7 @@
      * Detects the colliding identifier name in a given leaf-list node.
      *
      * @param listOfLeafList list of leaf-lists to detect collision
-     * @param identifierName name for which collision detection is to be
-     *                       checked
+     * @param identifierName name for which collision detection is to be checked
      * @throws DataModelException a violation of data model rules
      */
     private static void detectCollidingLeafList(List<YangLeafList> listOfLeafList, String identifierName)
@@ -144,8 +143,7 @@
     /**
      * Add a resolution information.
      *
-     * @param resolutionInfo information about the YANG construct which has to
-     *                       be resolved
+     * @param resolutionInfo information about the YANG construct which has to be resolved
      * @throws DataModelException a violation of data model rules
      */
     public static void addResolutionInfo(YangResolutionInfo resolutionInfo)
@@ -162,7 +160,15 @@
         }
         YangReferenceResolver resolutionNode = (YangReferenceResolver) curNode;
 
-        resolutionNode.addToResolutionList(resolutionInfo);
+        if (resolutionInfo.getEntityToResolveInfo()
+                .getEntityToResolve() instanceof YangType) {
+            resolutionNode.addToResolutionList(resolutionInfo,
+                    ResolvableType.YANG_DERIVED_DATA_TYPE);
+        } else {
+            resolutionNode.addToResolutionList(resolutionInfo,
+                    ResolvableType.YANG_USES);
+        }
+
     }
 
     /**
@@ -173,7 +179,7 @@
      * @throws DataModelException a violation of data model rules
      */
     public static void resolveLinkingForResolutionList(List<YangResolutionInfo> resolutionList,
-                                                       YangReferenceResolver dataModelRootNode)
+            YangReferenceResolver dataModelRootNode)
             throws DataModelException {
 
         for (YangResolutionInfo resolutionInfo : resolutionList) {
@@ -189,7 +195,7 @@
      * @throws DataModelException a violation of data model rules
      */
     public static void linkInterFileReferences(List<YangResolutionInfo> resolutionList,
-                                               YangReferenceResolver dataModelRootNode)
+            YangReferenceResolver dataModelRootNode)
             throws DataModelException {
         /*
          * Run through the resolution list, find type/uses referring to
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/linker/impl/Resolvable.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/linker/Resolvable.java
similarity index 97%
rename from utils/yangutils/src/main/java/org/onosproject/yangutils/linker/impl/Resolvable.java
rename to utils/yangutils/src/main/java/org/onosproject/yangutils/linker/Resolvable.java
index f384dc5..975c3f4 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/linker/impl/Resolvable.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/linker/Resolvable.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.onosproject.yangutils.linker.impl;
+package org.onosproject.yangutils.linker;
 
 import org.onosproject.yangutils.linker.exceptions.LinkerException;
 
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/linker/impl/ResolvableStatus.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/linker/ResolvableStatus.java
similarity index 96%
rename from utils/yangutils/src/main/java/org/onosproject/yangutils/linker/impl/ResolvableStatus.java
rename to utils/yangutils/src/main/java/org/onosproject/yangutils/linker/ResolvableStatus.java
index cd43c18..0ff5da5 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/linker/impl/ResolvableStatus.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/linker/ResolvableStatus.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.onosproject.yangutils.linker.impl;
+package org.onosproject.yangutils.linker;
 
 /**
  * Represents the status of resolvable entity.
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/linker/ResolvableType.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/linker/ResolvableType.java
new file mode 100644
index 0000000..ff0778f
--- /dev/null
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/linker/ResolvableType.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yangutils.linker;
+
+/**
+ * Type of the resolvable info.
+ */
+public enum ResolvableType {
+
+    /**
+     * Identifies the derived data type.
+     */
+    YANG_DERIVED_DATA_TYPE,
+
+    /**
+     * Identifies the uses.
+     */
+    YANG_USES
+}
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/linker/YangLinkingPhase.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/linker/YangLinkingPhase.java
new file mode 100644
index 0000000..23020df
--- /dev/null
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/linker/YangLinkingPhase.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yangutils.linker;
+
+/**
+ * Represents the phase of YANG file reference linking.
+ */
+public enum YangLinkingPhase {
+
+    /**
+     * Linking the reference within the files.
+     */
+    INTRA_FILE,
+
+    /**
+     * Linking the reference across the files.
+     */
+    INTER_FILE
+
+}
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/linker/impl/YangReferenceResolver.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/linker/YangReferenceResolver.java
similarity index 80%
rename from utils/yangutils/src/main/java/org/onosproject/yangutils/linker/impl/YangReferenceResolver.java
rename to utils/yangutils/src/main/java/org/onosproject/yangutils/linker/YangReferenceResolver.java
index 4681985..307675d 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/linker/impl/YangReferenceResolver.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/linker/YangReferenceResolver.java
@@ -14,14 +14,16 @@
  * limitations under the License.
  */
 
-package org.onosproject.yangutils.linker.impl;
+package org.onosproject.yangutils.linker;
 
 import java.util.List;
 import java.util.Set;
+
 import org.onosproject.yangutils.datamodel.YangImport;
 import org.onosproject.yangutils.datamodel.YangInclude;
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
 import org.onosproject.yangutils.linker.exceptions.LinkerException;
+import org.onosproject.yangutils.linker.impl.YangResolutionInfo;
 import org.onosproject.yangutils.plugin.manager.YangFileInfo;
 
 /**
@@ -33,23 +35,26 @@
     /**
      * Returns unresolved resolution list.
      *
-     * @return unresolved resolution list
+     * @param type resolvable type
+     * @return list of resolution information objects
      */
-    List<YangResolutionInfo> getUnresolvedResolutionList();
+    List<YangResolutionInfo> getUnresolvedResolutionList(ResolvableType type);
 
     /**
      * Adds to the resolution list.
      *
      * @param resolutionInfo resolution information
+     * @param type           resolvable type
      */
-    void addToResolutionList(YangResolutionInfo resolutionInfo);
+    void addToResolutionList(YangResolutionInfo resolutionInfo, ResolvableType type);
 
     /**
      * Creates resolution list.
      *
      * @param resolutionList resolution list
+     * @param type           resolvable type
      */
-    void setResolutionList(List<YangResolutionInfo> resolutionList);
+    void setResolutionList(List<YangResolutionInfo> resolutionList, ResolvableType type);
 
     /**
      * Returns unresolved imported list.
@@ -110,16 +115,20 @@
     /**
      * Resolves self file linking.
      *
+     * @param type resolvable type
      * @throws DataModelException a violation in data model rule
      */
-    void resolveSelfFileLinking() throws DataModelException;
+    void resolveSelfFileLinking(ResolvableType type)
+            throws DataModelException;
 
     /**
      * Resolves inter file linking.
      *
+     * @param type resolvable type
      * @throws DataModelException a violation in data model rule
      */
-    void resolveInterFileLinking() throws DataModelException;
+    void resolveInterFileLinking(ResolvableType type)
+            throws DataModelException;
 
     /**
      * Adds references to include.
@@ -127,7 +136,8 @@
      * @param yangFileInfoSet YANG file info set
      * @throws LinkerException a violation of linker rules
      */
-    void addReferencesToIncludeList(Set<YangFileInfo> yangFileInfoSet) throws LinkerException;
+    void addReferencesToIncludeList(Set<YangFileInfo> yangFileInfoSet)
+            throws LinkerException;
 
     /**
      * Adds references to import.
@@ -135,5 +145,6 @@
      * @param yangFileInfoSet YANG file info set
      * @throws LinkerException a violation of linker rules
      */
-    void addReferencesToImportList(Set<YangFileInfo> yangFileInfoSet) throws LinkerException;
+    void addReferencesToImportList(Set<YangFileInfo> yangFileInfoSet)
+            throws LinkerException;
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/linker/impl/YangLinkerManager.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/linker/impl/YangLinkerManager.java
index 0fc3d99..deaebb2 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/linker/impl/YangLinkerManager.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/linker/impl/YangLinkerManager.java
@@ -17,10 +17,13 @@
 package org.onosproject.yangutils.linker.impl;
 
 import java.util.Set;
+
 import org.onosproject.yangutils.datamodel.YangNode;
 import org.onosproject.yangutils.datamodel.YangSubModule;
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.linker.ResolvableType;
 import org.onosproject.yangutils.linker.YangLinker;
+import org.onosproject.yangutils.linker.YangReferenceResolver;
 import org.onosproject.yangutils.linker.exceptions.LinkerException;
 import org.onosproject.yangutils.plugin.manager.YangFileInfo;
 
@@ -29,7 +32,8 @@
 /**
  * Representation of entity which provides linking service of YANG files.
  */
-public class YangLinkerManager implements YangLinker {
+public class YangLinkerManager
+        implements YangLinker {
     @Override
     public void resolveDependencies(Set<YangFileInfo> yangFileInfoSet) {
 
@@ -54,7 +58,8 @@
      * @param yangFileInfoSet set of YANG files info
      * @throws LinkerException fails to link sub-module to parent module
      */
-    public void linkSubModulesToParentModule(Set<YangFileInfo> yangFileInfoSet) throws LinkerException {
+    public void linkSubModulesToParentModule(Set<YangFileInfo> yangFileInfoSet)
+            throws LinkerException {
         for (YangFileInfo yangFileInfo : yangFileInfoSet) {
             YangNode yangNode = yangFileInfo.getRootNode();
             if (yangNode instanceof YangSubModule) {
@@ -106,10 +111,13 @@
      * @param yangFileInfoSet set of YANG files info
      * @throws LinkerException a violation in linker execution
      */
-    public void processInterFileLinking(Set<YangFileInfo> yangFileInfoSet) throws LinkerException {
+    public void processInterFileLinking(Set<YangFileInfo> yangFileInfoSet)
+            throws LinkerException {
         for (YangFileInfo yangFileInfo : yangFileInfoSet) {
             try {
-                ((YangReferenceResolver) yangFileInfo.getRootNode()).resolveInterFileLinking();
+                ((YangReferenceResolver) yangFileInfo.getRootNode()).resolveInterFileLinking(ResolvableType.YANG_USES);
+                ((YangReferenceResolver) yangFileInfo.getRootNode())
+                        .resolveInterFileLinking(ResolvableType.YANG_DERIVED_DATA_TYPE);
             } catch (DataModelException e) {
                 String errorInfo = "Error in file: " + yangFileInfo.getYangFileName() + " at line: "
                         + e.getLineNumber() + " at position: " + e.getCharPositionInLine() + NEW_LINE + e.getMessage();
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/linker/impl/YangResolutionInfo.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/linker/impl/YangResolutionInfo.java
index 26d4cb6..83b11c4 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/linker/impl/YangResolutionInfo.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/linker/impl/YangResolutionInfo.java
@@ -17,6 +17,7 @@
 package org.onosproject.yangutils.linker.impl;
 
 import java.util.Stack;
+
 import org.onosproject.yangutils.datamodel.LocationInfo;
 import org.onosproject.yangutils.datamodel.YangDataTypes;
 import org.onosproject.yangutils.datamodel.YangDerivedInfo;
@@ -28,12 +29,18 @@
 import org.onosproject.yangutils.datamodel.YangTypeDef;
 import org.onosproject.yangutils.datamodel.YangUses;
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.linker.Resolvable;
+import org.onosproject.yangutils.linker.ResolvableStatus;
+import org.onosproject.yangutils.linker.YangLinkingPhase;
+import org.onosproject.yangutils.linker.YangReferenceResolver;
 
-import static org.onosproject.yangutils.linker.impl.ResolvableStatus.INTER_FILE_LINKED;
-import static org.onosproject.yangutils.linker.impl.ResolvableStatus.INTRA_FILE_RESOLVED;
-import static org.onosproject.yangutils.linker.impl.ResolvableStatus.LINKED;
-import static org.onosproject.yangutils.linker.impl.ResolvableStatus.RESOLVED;
-import static org.onosproject.yangutils.linker.impl.ResolvableStatus.UNRESOLVED;
+import static org.onosproject.yangutils.linker.ResolvableStatus.INTER_FILE_LINKED;
+import static org.onosproject.yangutils.linker.ResolvableStatus.INTRA_FILE_RESOLVED;
+import static org.onosproject.yangutils.linker.ResolvableStatus.LINKED;
+import static org.onosproject.yangutils.linker.ResolvableStatus.RESOLVED;
+import static org.onosproject.yangutils.linker.ResolvableStatus.UNRESOLVED;
+import static org.onosproject.yangutils.linker.YangLinkingPhase.INTER_FILE;
+import static org.onosproject.yangutils.linker.YangLinkingPhase.INTRA_FILE;
 import static org.onosproject.yangutils.utils.UtilConstants.TYPEDEF_LINKER_ERROR;
 import static org.onosproject.yangutils.utils.UtilConstants.GROUPING_LINKER_ERROR;
 
@@ -42,7 +49,8 @@
  *
  * @param <T> type of resolution entity uses / type
  */
-public class YangResolutionInfo<T> implements LocationInfo {
+public class YangResolutionInfo<T>
+        implements LocationInfo {
 
     /**
      * Information about the entity that needs to be resolved.
@@ -164,7 +172,7 @@
                          * resolve the references and pop the entity and
                          * continue with remaining stack elements to resolve.
                          */
-                        resolveTopOfStack();
+                        resolveTopOfStack(INTRA_FILE);
                         getPartialResolvedStack().pop();
                         break;
                     }
@@ -213,7 +221,7 @@
     /**
      * Resolves the current entity in the stack.
      */
-    private void resolveTopOfStack()
+    private void resolveTopOfStack(YangLinkingPhase linkingPhase)
             throws DataModelException {
         ((Resolvable) getCurrentEntityToResolveFromStack()).resolve();
         if (((Resolvable) getCurrentEntityToResolveFromStack()).getResolvableStatus()
@@ -280,7 +288,8 @@
      * @return true if self file reference, false otherwise
      * @throws DataModelException a violation of data model rules
      */
-    private boolean isCandidateForSelfFileReference() throws DataModelException {
+    private boolean isCandidateForSelfFileReference()
+            throws DataModelException {
         String prefix = getRefPrefix();
         return prefix == null || prefix.contentEquals(getCurReferenceResolver().getPrefix());
     }
@@ -598,7 +607,8 @@
      * @return referenced prefix of entity under resolution
      * @throws DataModelException a violation in data model rule
      */
-    private String getRefPrefix() throws DataModelException {
+    private String getRefPrefix()
+            throws DataModelException {
         String refPrefix;
         if (getCurrentEntityToResolveFromStack() instanceof YangType) {
             refPrefix = ((YangType<?>) getCurrentEntityToResolveFromStack()).getPrefix();
@@ -643,7 +653,7 @@
                          * resolve the references and pop the entity and
                          * continue with remaining stack elements to resolve
                          */
-                        resolveTopOfStack();
+                        resolveTopOfStack(INTER_FILE);
                         getPartialResolvedStack().pop();
                         break;
                     }
@@ -679,7 +689,8 @@
      *
      * @throws DataModelException data model error
      */
-    private void linkInterFileTopOfStackRefUpdateStack() throws DataModelException {
+    private void linkInterFileTopOfStackRefUpdateStack()
+            throws DataModelException {
 
         /*
          * Obtain the referred node of top of stack entity under resolution
@@ -727,7 +738,8 @@
      * @return true if resolved, false otherwise
      * @throws DataModelException a violation in data model rule
      */
-    private boolean resolveWithInclude() throws DataModelException {
+    private boolean resolveWithInclude()
+            throws DataModelException {
         /*
          * Run through all the nodes in include list and search for referred
          * typedef/grouping at the root level.
@@ -762,7 +774,8 @@
      * @return true if resolved, false otherwise
      * @throws DataModelException a violation in data model rule
      */
-    private boolean resolveWithImport() throws DataModelException {
+    private boolean resolveWithImport()
+            throws DataModelException {
         /*
          * Run through import list to find the referred typedef/grouping.
          */
@@ -808,7 +821,8 @@
      * @return referred typedef/grouping node
      * @throws DataModelException a violation in data model rule
      */
-    private T getRefNode() throws DataModelException {
+    private T getRefNode()
+            throws DataModelException {
         if (getCurrentEntityToResolveFromStack() instanceof YangType) {
             YangDerivedInfo<?> derivedInfo = (YangDerivedInfo<?>)
                     ((YangType<?>) getCurrentEntityToResolveFromStack()).getDataTypeExtendedInfo();
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/AugmentListener.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/AugmentListener.java
index b3b22ae..f9042fa 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/AugmentListener.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/AugmentListener.java
@@ -39,8 +39,10 @@
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerCollisionDetector.detectCollidingChildUtil;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
-import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructExtendedListenerErrorMessage;
-import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction
+        .constructExtendedListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction
+        .constructListenerErrorMessage;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
@@ -98,7 +100,7 @@
      * @param ctx context object of the grammar rule
      */
     public static void processAugmentEntry(TreeWalkListener listener,
-                                       GeneratedYangParser.AugmentStatementContext ctx) {
+            GeneratedYangParser.AugmentStatementContext ctx) {
 
         // Check for stack to be non empty.
         checkStackIsNotEmpty(listener, MISSING_HOLDER, AUGMENT_DATA, ctx.augment().getText(), ENTRY);
@@ -120,7 +122,8 @@
             YangNode curNode = (YangNode) curData;
             YangAugment yangAugment = getYangAugmentNode(JAVA_GENERATION);
 
-            validateTargetNodePath(targetNodes, curNode, ctx);
+            //validateTargetNodePath(targetNodes, curNode, ctx);
+            // TODO: handle in linker.
 
             yangAugment.setTargetNode(targetNodes);
             yangAugment.setName(generateNameForAugmentNode(curData, targetNodes, listener));
@@ -147,7 +150,7 @@
      * @param ctx context object of the grammar rule
      */
     public static void processAugmentExit(TreeWalkListener listener,
-                                      GeneratedYangParser.AugmentStatementContext ctx) {
+            GeneratedYangParser.AugmentStatementContext ctx) {
 
         //Check for stack to be non empty.
         checkStackIsNotEmpty(listener, MISSING_HOLDER, AUGMENT_DATA, ctx.augment().getText(), EXIT);
@@ -170,15 +173,15 @@
         validateCardinalityMaxOne(ctx.referenceStatement(), REFERENCE_DATA, AUGMENT_DATA, ctx.augment().getText());
         validateCardinalityMaxOne(ctx.whenStatement(), WHEN_DATA, AUGMENT_DATA, ctx.augment().getText());
         validateMutuallyExclusiveChilds(ctx.dataDefStatement(), DATA_DEF_DATA, ctx.caseStatement(),
-                                        CASE_DATA, AUGMENT_DATA, ctx.augment().getText());
+                CASE_DATA, AUGMENT_DATA, ctx.augment().getText());
     }
 
     /**
      * Validates whether the current target node path is correct or not.
      *
      * @param targetNodes list of target nodes
-     * @param line line in YANG file
-     * @param charPositionInLine char position in YANG file
+     * @param curNode current Node
+     * @param ctx augment context
      * @param curNode current YANG node
      */
     private static void validateTargetNodePath(List<YangNodeIdentifier> targetNodes, YangNode curNode,
@@ -189,7 +192,8 @@
             if (!moduleId.getName().equals(curNode.getName())) {
                 throw parserException(ctx);
             } else {
-                validateNodeInTargetPath(curNode, targetNodes, ctx);
+                //validateNodeInTargetPath(curNode, targetNodes, ctx);
+                // TODO: handle in linker.
             }
         } else {
             String parentPrefix = getParentsPrefix(curNode);
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/LeafListListener.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/LeafListListener.java
index 4a2481a..f478e8a 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/LeafListListener.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/LeafListListener.java
@@ -113,11 +113,12 @@
         leafList.setLeafName(identifier);
 
         Parsable tmpData = listener.getParsedDataStack().peek();
-        YangLeavesHolder leaves;
+        YangLeavesHolder leavesHolder;
 
         if (tmpData instanceof YangLeavesHolder) {
-            leaves = (YangLeavesHolder) tmpData;
-            leaves.addLeafList(leafList);
+            leavesHolder = (YangLeavesHolder) tmpData;
+            leavesHolder.addLeafList(leafList);
+            leafList.setContainedIn(leavesHolder);
         } else {
             throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, LEAF_LIST_DATA,
                     ctx.identifier().getText(), ENTRY));
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/LeafListener.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/LeafListener.java
index b8e3b2d..0a648af 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/LeafListener.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/LeafListener.java
@@ -115,11 +115,12 @@
         leaf.setLeafName(identifier);
 
         Parsable tmpData = listener.getParsedDataStack().peek();
-        YangLeavesHolder leaves;
+        YangLeavesHolder leavesHolder;
 
         if (tmpData instanceof YangLeavesHolder) {
-            leaves = (YangLeavesHolder) tmpData;
-            leaves.addLeaf(leaf);
+            leavesHolder = (YangLeavesHolder) tmpData;
+            leavesHolder.addLeaf(leaf);
+            leaf.setContainedIn(leavesHolder);
         } else {
             throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, LEAF_DATA,
                     ctx.identifier().getText(), ENTRY));
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ModuleListener.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ModuleListener.java
index a0005ba..afa9acd 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ModuleListener.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ModuleListener.java
@@ -16,10 +16,11 @@
 
 package org.onosproject.yangutils.parser.impl.listeners;
 
-import org.onosproject.yangutils.linker.impl.YangReferenceResolver;
 import org.onosproject.yangutils.datamodel.YangModule;
 import org.onosproject.yangutils.datamodel.YangRevision;
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.linker.ResolvableType;
+import org.onosproject.yangutils.linker.YangReferenceResolver;
 import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
 import org.onosproject.yangutils.parser.exceptions.ParserException;
 import org.onosproject.yangutils.parser.impl.TreeWalkListener;
@@ -28,7 +29,8 @@
 import static org.onosproject.yangutils.datamodel.utils.YangDataModelFactory.getYangModuleNode;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
-import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction
+        .constructListenerErrorMessage;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
@@ -116,7 +118,10 @@
                     ctx.identifier().getText(), EXIT));
         }
         try {
-            ((YangReferenceResolver) listener.getParsedDataStack().peek()).resolveSelfFileLinking();
+            ((YangReferenceResolver) listener.getParsedDataStack()
+                    .peek()).resolveSelfFileLinking(ResolvableType.YANG_USES);
+            ((YangReferenceResolver) listener.getParsedDataStack()
+                    .peek()).resolveSelfFileLinking(ResolvableType.YANG_DERIVED_DATA_TYPE);
         } catch (DataModelException e) {
             ParserException parserException = new ParserException(e.getMessage());
             parserException.setLine(e.getLineNumber());
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/PatternRestrictionListener.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/PatternRestrictionListener.java
index 4f0ce8e..bd65855 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/PatternRestrictionListener.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/PatternRestrictionListener.java
@@ -151,7 +151,7 @@
      * @param ctx      context object of the grammar rule
      */
     public static void processPatternRestrictionExit(TreeWalkListener listener,
-                                                     GeneratedYangParser.PatternStatementContext ctx) {
+                                                    GeneratedYangParser.PatternStatementContext ctx) {
 
         // Check for stack to be non empty.
         checkStackIsNotEmpty(listener, MISSING_HOLDER, PATTERN_DATA, ctx.string().getText(), EXIT);
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/SubModuleListener.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/SubModuleListener.java
index 2c97f30..048e635 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/SubModuleListener.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/SubModuleListener.java
@@ -16,10 +16,11 @@
 
 package org.onosproject.yangutils.parser.impl.listeners;
 
-import org.onosproject.yangutils.linker.impl.YangReferenceResolver;
 import org.onosproject.yangutils.datamodel.YangRevision;
 import org.onosproject.yangutils.datamodel.YangSubModule;
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
+import org.onosproject.yangutils.linker.ResolvableType;
+import org.onosproject.yangutils.linker.YangReferenceResolver;
 import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
 import org.onosproject.yangutils.parser.exceptions.ParserException;
 import org.onosproject.yangutils.parser.impl.TreeWalkListener;
@@ -28,7 +29,8 @@
 import static org.onosproject.yangutils.datamodel.utils.YangDataModelFactory.getYangSubModuleNode;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
-import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction
+        .constructListenerErrorMessage;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
@@ -121,7 +123,10 @@
                     ctx.identifier().getText(), EXIT));
         }
         try {
-            ((YangReferenceResolver) listener.getParsedDataStack().peek()).resolveSelfFileLinking();
+            ((YangReferenceResolver) listener.getParsedDataStack().peek())
+                    .resolveSelfFileLinking(ResolvableType.YANG_USES);
+            ((YangReferenceResolver) listener.getParsedDataStack().peek())
+                    .resolveSelfFileLinking(ResolvableType.YANG_DERIVED_DATA_TYPE);
         } catch (DataModelException e) {
             ParserException parserException = new ParserException(e.getMessage());
             parserException.setLine(e.getLineNumber());
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeListener.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeListener.java
index 6e25f1b..6e386da 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeListener.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeListener.java
@@ -35,7 +35,7 @@
 import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.addResolutionInfo;
 import static org.onosproject.yangutils.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
 import static org.onosproject.yangutils.datamodel.utils.YangDataModelFactory.getYangType;
-import static org.onosproject.yangutils.linker.impl.ResolvableStatus.UNRESOLVED;
+import static org.onosproject.yangutils.linker.ResolvableStatus.UNRESOLVED;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructExtendedListenerErrorMessage;
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/AugmentListenerUtil.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/AugmentListenerUtil.java
index 764cef4..7aae767 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/AugmentListenerUtil.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/AugmentListenerUtil.java
@@ -247,7 +247,7 @@
     /**
      * Validates whether nodes in target node list are valid or not.
      *
-     * @param targetNodeName current target node
+     * @param targetNodes target node
      * @param curNode YANG node
      * @return true or false
      */
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/plugin/manager/YangFileInfo.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/plugin/manager/YangFileInfo.java
index a92ca68..4c6147a 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/plugin/manager/YangFileInfo.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/plugin/manager/YangFileInfo.java
@@ -17,7 +17,7 @@
 package org.onosproject.yangutils.plugin.manager;
 
 import java.util.Objects;
-import org.onosproject.yangutils.linker.impl.ResolvableStatus;
+import org.onosproject.yangutils.linker.ResolvableStatus;
 import org.onosproject.yangutils.datamodel.YangNode;
 
 /**
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/plugin/manager/YangUtilManager.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/plugin/manager/YangUtilManager.java
index 0f6febeb..3eb1ea3 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/plugin/manager/YangUtilManager.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/plugin/manager/YangUtilManager.java
@@ -62,7 +62,8 @@
  */
 @Mojo(name = "yang2java", defaultPhase = GENERATE_SOURCES, requiresDependencyResolution = COMPILE,
         requiresProject = true)
-public class YangUtilManager extends AbstractMojo {
+public class YangUtilManager
+        extends AbstractMojo {
 
     private YangNode rootNode;
     // YANG file information set.
@@ -134,7 +135,8 @@
     private BuildContext context;
 
     @Override
-    public void execute() throws MojoExecutionException, MojoFailureException {
+    public void execute()
+            throws MojoExecutionException, MojoFailureException {
 
         try {
 
@@ -204,7 +206,8 @@
      *
      * @throws MojoExecutionException a violation in mojo excecution
      */
-    public void resolveDependenciesUsingLinker() throws MojoExecutionException {
+    public void resolveDependenciesUsingLinker()
+            throws MojoExecutionException {
         for (YangFileInfo yangFileInfo : getYangFileInfoSet()) {
             setCurYangFileInfo(yangFileInfo);
             try {
@@ -220,7 +223,8 @@
      *
      * @throws IOException a violation in IO
      */
-    public void parseYangFileInfoSet() throws IOException {
+    public void parseYangFileInfoSet()
+            throws IOException {
         for (YangFileInfo yangFileInfo : getYangFileInfoSet()) {
             setCurYangFileInfo(yangFileInfo);
             try {
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaCodeGeneratorUtil.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaCodeGeneratorUtil.java
index 6457596..a6eb9d7 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaCodeGeneratorUtil.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaCodeGeneratorUtil.java
@@ -64,10 +64,10 @@
     /**
      * Generates Java code files corresponding to the YANG schema.
      *
-     * @param rootNode root node of the data model tree
+     * @param rootNode   root node of the data model tree
      * @param yangPlugin YANG plugin config
      * @throws TranslatorException when fails to generate java code file the current
-     *                     node
+     *                             node
      */
     public static void generateJavaCode(YangNode rootNode, YangPluginConfig yangPlugin)
             throws TranslatorException {
@@ -77,18 +77,35 @@
 
         while (codeGenNode != null) {
             if (curTraversal != PARENT) {
+                if (!(codeGenNode instanceof JavaCodeGenerator)) {
+                    throw new TranslatorException("Unsupported node to generate code");
+                }
+
                 setCurNode(codeGenNode);
-                generateCodeEntry(codeGenNode, yangPlugin);
+                try {
+                    generateCodeEntry(codeGenNode, yangPlugin);
+                } catch (Exception e) {
+                    throw new TranslatorException(e.getMessage());
+                }
+
             }
             if (curTraversal != PARENT && codeGenNode.getChild() != null) {
                 curTraversal = CHILD;
                 codeGenNode = codeGenNode.getChild();
             } else if (codeGenNode.getNextSibling() != null) {
-                generateCodeExit(codeGenNode);
+                try {
+                    generateCodeExit(codeGenNode);
+                } catch (Exception e) {
+                    throw new TranslatorException(e.getMessage());
+                }
                 curTraversal = SIBILING;
                 codeGenNode = codeGenNode.getNextSibling();
             } else {
-                generateCodeExit(codeGenNode);
+                try {
+                    generateCodeExit(codeGenNode);
+                } catch (Exception e) {
+                    throw new TranslatorException(e.getMessage());
+                }
                 curTraversal = PARENT;
                 codeGenNode = codeGenNode.getParent();
             }
@@ -99,10 +116,10 @@
      * Generates the current nodes code snippet.
      *
      * @param codeGenNode current data model node for which the code needs to be
-     * generated
-     * @param yangPlugin YANG plugin config
+     *                    generated
+     * @param yangPlugin  YANG plugin config
      * @throws TranslatorException when fails to generate java code file the current
-     *                     node
+     *                             node
      */
     private static void generateCodeEntry(YangNode codeGenNode, YangPluginConfig yangPlugin)
             throws TranslatorException {
@@ -119,11 +136,12 @@
      * Generates the current nodes code target code from the snippet.
      *
      * @param codeGenNode current data model node for which the code needs to be
-     * generated
+     *                    generated
      * @throws TranslatorException when fails to generate java code file the current
-     *                     node
+     *                             node
      */
-    private static void generateCodeExit(YangNode codeGenNode) throws TranslatorException {
+    private static void generateCodeExit(YangNode codeGenNode)
+            throws TranslatorException {
 
         if (codeGenNode instanceof JavaCodeGenerator) {
             ((JavaCodeGenerator) codeGenNode).generateCodeExit();
@@ -188,7 +206,7 @@
      * Delete Java code files corresponding to the YANG schema.
      *
      * @param rootNode root node of data-model tree
-     * @throws IOException        when fails to delete java code file the current node
+     * @throws IOException when fails to delete java code file the current node
      */
     public static void translatorErrorHandler(YangNode rootNode)
             throws IOException {
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaImportData.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaImportData.java
index 5ccf0b3..b1c36ec 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaImportData.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaImportData.java
@@ -20,8 +20,6 @@
 import java.util.SortedSet;
 import java.util.TreeSet;
 
-import static java.util.Collections.sort;
-
 import static org.onosproject.yangutils.utils.UtilConstants.ABSTRACT_EVENT;
 import static org.onosproject.yangutils.utils.UtilConstants.ARRAY_LIST;
 import static org.onosproject.yangutils.utils.UtilConstants.AUGMENTATION_HOLDER_CLASS_IMPORT_CLASS;
@@ -45,6 +43,8 @@
 import static org.onosproject.yangutils.utils.UtilConstants.PROVIDED_AUGMENTATION_CLASS_IMPORT_PKG;
 import static org.onosproject.yangutils.utils.UtilConstants.SEMI_COLAN;
 
+import static java.util.Collections.sort;
+
 /**
  * Represents that generated Java file can contain imports.
  */
@@ -116,20 +116,52 @@
      * a qualified manner.
      *
      * @param newImportInfo class/interface info being imported
-     * @return status of new addition of class/interface to the import set
+     * @param className     name of the call being generated
+     * @param classPkg      generated class package
+     * @return qualified access status of the import node being added
      */
-    public boolean addImportInfo(JavaQualifiedTypeInfo newImportInfo) {
+    public boolean addImportInfo(JavaQualifiedTypeInfo newImportInfo,
+            String className, String classPkg) {
+
+        if (newImportInfo.getClassInfo().contentEquals(className)) {
+            /*
+             * if the current class name is same as the attribute class name,
+             * then the attribute must be accessed in a qualified manner.
+             */
+            return true;
+        } else if (newImportInfo.getPkgInfo() == null) {
+            /*
+             * If the package info is null, then it is not a candidate for import / qualified access
+             */
+            return false;
+        }
+
+        /*
+         * If the attribute type is having the package info, it is contender
+         * for import list and also need to check if it needs to be a
+         * qualified access.
+         */
+        if (newImportInfo.getPkgInfo().contentEquals(classPkg)) {
+            /**
+             * Package of the referred attribute and the generated class is same, so no need import
+             * or qualified access.
+             */
+            return false;
+        }
 
         for (JavaQualifiedTypeInfo curImportInfo : getImportSet()) {
             if (curImportInfo.getClassInfo()
                     .contentEquals(newImportInfo.getClassInfo())) {
-                return curImportInfo.getPkgInfo()
+                return !curImportInfo.getPkgInfo()
                         .contentEquals(newImportInfo.getPkgInfo());
             }
         }
 
+        /*
+         * import is added, so it is a member for non qualified access
+         */
         getImportSet().add(newImportInfo);
-        return true;
+        return false;
     }
 
     /**
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaQualifiedTypeInfo.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaQualifiedTypeInfo.java
index 2e6b43f..35ee6d5 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaQualifiedTypeInfo.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/JavaQualifiedTypeInfo.java
@@ -134,10 +134,10 @@
      * Returns the import info for an attribute, which needs to be used for code
      * generation for import or for qualified access.
      *
-     * @param curNode current data model node for which the java file is being
-     * generated
+     * @param curNode       current data model node for which the java file is being
+     *                      generated
      * @param attributeName name of the attribute being added, it will used in
-     * import info for child class
+     *                      import info for child class
      * @return return the import info for this attribute
      */
     public static JavaQualifiedTypeInfo getQualifiedTypeInfoOfCurNode(YangNode curNode,
@@ -149,14 +149,10 @@
             throw new TranslatorException("missing java file information to get the package details "
                     + "of attribute corresponding to child node");
         }
-        /*
-         * The scenario when we need to add the child class as an attribute in
-         * the current class. The child class is in the package of the current
-         * classes package with current classes name.
-         */
+
         importInfo.setClassInfo(attributeName);
-        importInfo.setPkgInfo((((JavaFileInfoContainer) curNode).getJavaFileInfo().getPackage() + "."
-                + ((JavaFileInfoContainer) curNode).getJavaFileInfo().getJavaName()).toLowerCase());
+        importInfo.setPkgInfo(((JavaFileInfoContainer) curNode)
+                .getJavaFileInfo().getPackage());
 
         return importInfo;
     }
@@ -165,7 +161,7 @@
      * Returns the java qualified type information for the wrapper classes.
      *
      * @param referredTypesAttrInfo attribute of referred type
-     * @param conflictResolver plugin configurations
+     * @param conflictResolver      plugin configurations
      * @return return the import info for this attribute
      */
     public static JavaQualifiedTypeInfo getQualifiedInfoOfFromString(JavaAttributeInfo referredTypesAttrInfo,
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaFragmentFiles.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaFragmentFiles.java
index 0820c07..4243852 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaFragmentFiles.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaFragmentFiles.java
@@ -25,15 +25,13 @@
 import org.onosproject.yangutils.datamodel.YangLeaf;
 import org.onosproject.yangutils.datamodel.YangLeafList;
 import org.onosproject.yangutils.datamodel.YangLeavesHolder;
+import org.onosproject.yangutils.datamodel.YangList;
 import org.onosproject.yangutils.datamodel.YangNode;
 import org.onosproject.yangutils.translator.exception.TranslatorException;
 import org.onosproject.yangutils.translator.tojava.javamodel.JavaLeafInfoContainer;
 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaGrouping;
-import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaInput;
 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModule;
-import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaOutput;
 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaSubModule;
-import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaUses;
 import org.onosproject.yangutils.translator.tojava.utils.JavaExtendsListHolder;
 import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig;
 
@@ -56,6 +54,7 @@
 import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getAttributeInfoForTheData;
 import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.getQualifiedInfoOfFromString;
 import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.getQualifiedTypeInfoOfCurNode;
+import static org.onosproject.yangutils.translator.tojava.utils.AttributesJavaDataType.updateJavaFileInfo;
 import static org.onosproject.yangutils.translator.tojava.utils.JavaCodeSnippetGen.getJavaAttributeDefination;
 import static org.onosproject.yangutils.translator.tojava.utils.JavaCodeSnippetGen.getJavaClassDefClose;
 import static org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator.generateBuilderClassFile;
@@ -82,28 +81,36 @@
 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getToStringMethod;
 import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.parseBuilderInterfaceBuildMethodString;
 import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.addArrayListImport;
-import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.addAugmentationHoldersImport;
+import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils
+        .addAugmentationHoldersImport;
 import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.addAugmentedInfoImport;
 import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.closeFile;
-import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.detectCollisionBwParentAndChildForImport;
-import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.isAugmentationHolderExtended;
+import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils
+        .isAugmentationHolderExtended;
 import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.isAugmentedInfoExtended;
 import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.sortImports;
+import static org.onosproject.yangutils.utils.UtilConstants.ACTIVATE;
 import static org.onosproject.yangutils.utils.UtilConstants.BUILDER;
+import static org.onosproject.yangutils.utils.UtilConstants.COMPONENT;
+import static org.onosproject.yangutils.utils.UtilConstants.DEACTIVATE;
 import static org.onosproject.yangutils.utils.UtilConstants.EMPTY_STRING;
 import static org.onosproject.yangutils.utils.UtilConstants.FOUR_SPACE_INDENTATION;
 import static org.onosproject.yangutils.utils.UtilConstants.IMPL;
 import static org.onosproject.yangutils.utils.UtilConstants.IMPORT;
 import static org.onosproject.yangutils.utils.UtilConstants.INTERFACE;
+import static org.onosproject.yangutils.utils.UtilConstants.MANAGER;
 import static org.onosproject.yangutils.utils.UtilConstants.NEW_LINE;
 import static org.onosproject.yangutils.utils.UtilConstants.PERIOD;
+import static org.onosproject.yangutils.utils.UtilConstants.REFERENCE;
+import static org.onosproject.yangutils.utils.UtilConstants.REFERENCE_CARDINALITY;
 import static org.onosproject.yangutils.utils.UtilConstants.SEMI_COLAN;
+import static org.onosproject.yangutils.utils.UtilConstants.SERVICE;
 import static org.onosproject.yangutils.utils.UtilConstants.SLASH;
 import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.createPackage;
 import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.readAppendFile;
-import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.getJavaDoc;
 import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.GETTER_METHOD;
 import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.OF_METHOD;
+import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.getJavaDoc;
 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getAbsolutePackagePath;
 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.insertDataIntoJavaFile;
 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.mergeJavaFiles;
@@ -139,6 +146,7 @@
      * Contains all the interface(s)/class name which will be extended by generated files.
      */
     private JavaExtendsListHolder javaExtendsListHolder;
+
     /**
      * File type extension for java classes.
      */
@@ -295,12 +303,6 @@
     private boolean isAttributePresent;
 
     /**
-     * Creates an instance of temp java fragment files.
-     */
-    public TempJavaFragmentFiles() {
-    }
-
-    /**
      * Retrieves the absolute path where the file needs to be generated.
      *
      * @return absolute path where the file needs to be generated
@@ -313,7 +315,7 @@
      * Sets absolute path where the file needs to be generated.
      *
      * @param absoluteDirPath absolute path where the file needs to be
-     * generated.
+     *                        generated.
      */
     void setAbsoluteDirPath(String absoluteDirPath) {
         this.absoluteDirPath = absoluteDirPath;
@@ -366,7 +368,7 @@
     /**
      * Sets generated file files.
      *
-     * @param generatedTempFile generated file
+     * @param fileType generated file type
      */
     void setGeneratedTempFiles(int fileType) {
         generatedTempFiles = fileType;
@@ -493,7 +495,7 @@
      * Sets from string method's temporary file handle.
      *
      * @param fromStringImplTempFileHandle from string method's temporary file
-     * handle
+     *                                     handle
      */
     private void setFromStringImplTempFileHandle(File fromStringImplTempFileHandle) {
         this.fromStringImplTempFileHandle = fromStringImplTempFileHandle;
@@ -505,7 +507,8 @@
      * @param javaFileInfo generated java file information
      * @throws IOException when fails to create new file handle
      */
-    TempJavaFragmentFiles(JavaFileInfo javaFileInfo) throws IOException {
+    TempJavaFragmentFiles(JavaFileInfo javaFileInfo)
+            throws IOException {
         setJavaExtendsListHolder(new JavaExtendsListHolder());
         setJavaImportData(new JavaImportData());
         setJavaFileInfo(javaFileInfo);
@@ -801,8 +804,8 @@
     /**
      * Adds attribute for class.
      *
-     * @param attr attribute info
-     * @param pluginConfig plugin configurations
+     * @param attr             attribute info
+     * @param yangPluginConfig plugin configurations
      * @throws IOException when fails to append to temporary file
      */
     private void addAttribute(JavaAttributeInfo attr, YangPluginConfig yangPluginConfig)
@@ -814,7 +817,7 @@
     /**
      * Adds getter for interface.
      *
-     * @param attr attribute info
+     * @param attr         attribute info
      * @param pluginConfig plugin configurations
      * @throws IOException when fails to append to temporary file
      */
@@ -827,7 +830,7 @@
     /**
      * Adds setter for interface.
      *
-     * @param attr attribute info
+     * @param attr         attribute info
      * @param pluginConfig plugin configurations
      * @throws IOException when fails to append to temporary file
      */
@@ -855,7 +858,7 @@
     /**
      * Adds getter method's impl for class.
      *
-     * @param attr attribute info
+     * @param attr         attribute info
      * @param pluginConfig plugin configurations
      * @throws IOException when fails to append to temporary file
      */
@@ -875,8 +878,8 @@
     /**
      * Adds build method for interface.
      *
-     * @return build method for interface
      * @param pluginConfig plugin configurations
+     * @return build method for interface
      * @throws IOException when fails to append to temporary file
      */
     String addBuildMethodForInterface(YangPluginConfig pluginConfig)
@@ -898,8 +901,8 @@
     /**
      * Adds default constructor for class.
      *
-     * @param modifier modifier for constructor.
-     * @param toAppend string which need to be appended with the class name
+     * @param modifier     modifier for constructor.
+     * @param toAppend     string which need to be appended with the class name
      * @param pluginConfig plugin configurations
      * @return default constructor for class
      * @throws IOException when fails to append to file
@@ -959,7 +962,7 @@
     /**
      * Adds from string method for union class.
      *
-     * @param javaAttributeInfo type attribute info
+     * @param javaAttributeInfo       type attribute info
      * @param fromStringAttributeInfo from string attribute info
      * @throws IOException when fails to append to temporary file
      */
@@ -987,6 +990,8 @@
         File file = new File(path + fileName + TEMP_FILE_EXTENSION);
         if (!file.exists()) {
             file.createNewFile();
+        } else {
+            throw new IOException(fileName + " is reused due to YANG naming");
         }
         return file;
     }
@@ -998,7 +1003,8 @@
      * @return temporary file handle
      * @throws IOException when fails to create new file handle
      */
-    File getJavaFileHandle(String fileName) throws IOException {
+    File getJavaFileHandle(String fileName)
+            throws IOException {
         return getFileObject(getDirPath(), fileName, JAVA_FILE_EXTENSION, getJavaFileInfo());
     }
 
@@ -1034,7 +1040,7 @@
     /**
      * Parses attribute to get the attribute string.
      *
-     * @param attr attribute info
+     * @param attr         attribute info
      * @param pluginConfig plugin configurations
      * @return attribute string
      */
@@ -1072,9 +1078,9 @@
     /**
      * Adds current node info as and attribute to the parent generated file.
      *
-     * @param curNode current node which needs to be added as an attribute in
-     * the parent generated code
-     * @param isList is list construct
+     * @param curNode      current node which needs to be added as an attribute in
+     *                     the parent generated code
+     * @param isList       is list construct
      * @param pluginConfig plugin configurations
      * @throws IOException IO operation exception
      */
@@ -1085,10 +1091,16 @@
         if (!(parent instanceof JavaCodeGenerator)) {
             throw new TranslatorException("missing parent node to contain current node info in generated file");
         }
-        if (curNode instanceof YangJavaUses) {
-            curNode = ((YangJavaUses) curNode).getRefGroup();
+
+        if (parent instanceof YangJavaGrouping) {
+            /*
+             * In case of grouping, there is no need to add the information, it will be taken care in
+             * uses
+             */
+            return;
         }
-        JavaAttributeInfo javaAttributeInfo = getCurNodeAsAttributeInParent(curNode,
+
+        JavaAttributeInfo javaAttributeInfo = getCurNodeAsAttributeInTarget(curNode,
                 parent, isList);
         if (!(parent instanceof TempJavaCodeFragmentFilesContainer)) {
             throw new TranslatorException("missing parent temp file handle");
@@ -1097,80 +1109,111 @@
                 .addJavaSnippetInfoToApplicableTempFiles(javaAttributeInfo, pluginConfig);
     }
 
+
+    /**
+     * Adds current node info as and attribute to the parent generated file.
+     *
+     * @param curNode      current node which needs to be added as an attribute in
+     *                     the parent generated code
+     * @param pluginConfig plugin configurations
+     * @param targetNode   target node to add the attribute
+     * @throws IOException IO operation exception
+     */
+    public static void addCurNodeAsAttributeInTargetTempFile(YangNode curNode,
+            YangPluginConfig pluginConfig, YangNode targetNode)
+            throws IOException {
+
+        if (!(targetNode instanceof JavaCodeGenerator)) {
+            throw new TranslatorException("invalid target node to generated file");
+        }
+
+        if (targetNode instanceof YangJavaGrouping) {
+            /*
+             * In case of grouping, there is no need to add the information, it will be taken care in
+             * uses
+             */
+            return;
+        }
+
+        boolean isList = curNode instanceof YangList;
+
+        JavaAttributeInfo javaAttributeInfo = getCurNodeAsAttributeInTarget(curNode,
+                targetNode, isList);
+        if (!(targetNode instanceof TempJavaCodeFragmentFilesContainer)) {
+            throw new TranslatorException("missing target node's temp file handle");
+        }
+        getNodesInterfaceFragmentFiles(targetNode)
+                .addJavaSnippetInfoToApplicableTempFiles(javaAttributeInfo, pluginConfig);
+    }
+
     /**
      * Creates an attribute info object corresponding to a data model node and
      * return it.
      *
-     * @param curNode current data model node for which the java code generation
-     * is being handled
-     * @param parentNode parent node in which the current node is an attribute
+     * @param curNode    current data model node for which the java code generation
+     *                   is being handled
+     * @param targetNode target node in which the current node is an attribute
      * @param isListNode is the current added attribute needs to be a list
      * @return AttributeInfo attribute details required to add in temporary
      * files
      */
-    public static JavaAttributeInfo getCurNodeAsAttributeInParent(
-            YangNode curNode, YangNode parentNode, boolean isListNode) {
-
-        YangPluginConfig pluginConfig = ((JavaFileInfoContainer) parentNode).getJavaFileInfo().getPluginConfig();
-        JavaFileInfo curNodeJavaInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo();
-        String curNodeName = null;
-
-        if (curNodeJavaInfo.getJavaName() != null) {
-            curNodeName = curNodeJavaInfo.getJavaName();
-        } else {
-            curNodeName = getCamelCase(curNode.getName(), pluginConfig.getConflictResolver());
-        }
-
-        if (!(parentNode instanceof TempJavaCodeFragmentFilesContainer)) {
-            throw new TranslatorException("Parent node does not have file info");
-        }
-
-        TempJavaFragmentFiles tempJavaFragmentFiles = getNodesInterfaceFragmentFiles(parentNode);
-        boolean isQualified = true;
-        JavaImportData parentImportData = tempJavaFragmentFiles.getJavaImportData();
-        if (isListNode) {
-            parentImportData.setIfListImported(true);
+    public static JavaAttributeInfo getCurNodeAsAttributeInTarget(YangNode curNode,
+            YangNode targetNode, boolean isListNode) {
+        String curNodeName = ((JavaFileInfoContainer) curNode).getJavaFileInfo().getJavaName();
+        if (curNodeName == null) {
+            updateJavaFileInfo(curNode, null);
+            curNodeName = ((JavaFileInfoContainer) curNode).getJavaFileInfo().getJavaName();
         }
 
         /*
          * Get the import info corresponding to the attribute for import in
          * generated java files or qualified access
          */
+        JavaQualifiedTypeInfo qualifiedTypeInfo = getQualifiedTypeInfoOfCurNode(curNode,
+                getCapitalCase(curNodeName));
+        if (!(targetNode instanceof TempJavaCodeFragmentFilesContainer)) {
+            throw new TranslatorException("Parent node does not have file info");
+        }
+        TempJavaFragmentFiles tempJavaFragmentFiles = getNodesInterfaceFragmentFiles(targetNode);
+        JavaImportData parentImportData = tempJavaFragmentFiles.getJavaImportData();
+        JavaFileInfo fileInfo = ((JavaFileInfoContainer) targetNode).getJavaFileInfo();
 
-        JavaQualifiedTypeInfo qualifiedTypeInfo = new JavaQualifiedTypeInfo();
-        if (curNode instanceof YangJavaGrouping) {
-            qualifiedTypeInfo = resolveGroupingsQuailifiedInfo(curNode, pluginConfig);
+        boolean isQualified;
+        if ((targetNode instanceof YangJavaModule || targetNode instanceof YangJavaSubModule)
+                && (qualifiedTypeInfo.getClassInfo().contentEquals(SERVICE)
+                || qualifiedTypeInfo.getClassInfo().contentEquals(COMPONENT)
+                || qualifiedTypeInfo.getClassInfo().contentEquals(getCapitalCase(ACTIVATE))
+                || qualifiedTypeInfo.getClassInfo().contentEquals(getCapitalCase(DEACTIVATE))
+                || qualifiedTypeInfo.getClassInfo().contentEquals(REFERENCE_CARDINALITY)
+                || qualifiedTypeInfo.getClassInfo().contentEquals(REFERENCE))
+                || qualifiedTypeInfo.getClassInfo().contentEquals(getCapitalCase(fileInfo.getJavaName() + SERVICE))
+                || qualifiedTypeInfo.getClassInfo().contentEquals(getCapitalCase(fileInfo.getJavaName() + MANAGER))) {
+
+            isQualified = true;
         } else {
-            qualifiedTypeInfo = getQualifiedTypeInfoOfCurNode(parentNode,
-                    getCapitalCase(curNodeName));
+            String className;
+            if (targetNode instanceof YangJavaModule || targetNode instanceof YangJavaSubModule) {
+                className = getCapitalCase(fileInfo.getJavaName()) + "Service";
+            } else {
+                className = getCapitalCase(fileInfo.getJavaName());
+            }
+
+            isQualified = parentImportData.addImportInfo(qualifiedTypeInfo,
+                    className, fileInfo.getPackage());
         }
 
-        if (parentNode instanceof YangJavaModule
-                || parentNode instanceof YangJavaSubModule
-                || parentNode instanceof YangJavaInput
-                || parentNode instanceof YangJavaOutput) {
-            parentImportData.addImportInfo(qualifiedTypeInfo);
-            isQualified = false;
-        } else if (curNode instanceof YangJavaGrouping) {
-            JavaFileInfo parentsClassInfo = ((JavaFileInfoContainer) parentNode).getJavaFileInfo();
-            if (qualifiedTypeInfo.getClassInfo().equals(parentsClassInfo.getJavaName())) {
-                isQualified = true;
-            }
-            if (!qualifiedTypeInfo.getPkgInfo().equals(parentsClassInfo.getPackage())) {
-                parentImportData.addImportInfo(qualifiedTypeInfo);
-                isQualified = false;
-            }
-        } else if (!detectCollisionBwParentAndChildForImport(curNode, qualifiedTypeInfo)) {
-            parentImportData.addImportInfo(qualifiedTypeInfo);
-            isQualified = false;
+        if (isListNode) {
+            parentImportData.setIfListImported(true);
         }
+
+
         return getAttributeInfoForTheData(qualifiedTypeInfo, curNodeName, null, isQualified, isListNode);
     }
 
     /**
      * Resolves groupings java qualified info.
      *
-     * @param curNode grouping node
+     * @param curNode      grouping node
      * @param pluginConfig plugin configurations
      * @return groupings java qualified info
      */
@@ -1247,7 +1290,7 @@
     /**
      * Adds parent's info to current node import list.
      *
-     * @param curNode current node for which import list needs to be updated
+     * @param curNode      current node for which import list needs to be updated
      * @param pluginConfig plugin configurations
      */
     public void addParentInfoInCurNodeTempFile(YangNode curNode, YangPluginConfig pluginConfig) {
@@ -1263,18 +1306,22 @@
         caseImportInfo.setClassInfo(getCapitalCase(getCamelCase(parent.getName(),
                 pluginConfig.getConflictResolver())));
         caseImportInfo.setPkgInfo(((JavaFileInfoContainer) parent).getJavaFileInfo().getPackage());
+
+        JavaFileInfo fileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo();
+
         ((TempJavaCodeFragmentFilesContainer) curNode).getTempJavaCodeFragmentFiles()
-                .getBeanTempFiles().getJavaImportData().addImportInfo(caseImportInfo);
+                .getBeanTempFiles().getJavaImportData().addImportInfo(caseImportInfo,
+                getCapitalCase(fileInfo.getJavaName()), fileInfo.getPackage());
     }
 
     /**
      * Adds leaf attributes in generated files.
      *
-     * @param listOfLeaves list of YANG leaf
-     * @param yangPluginConfig
+     * @param listOfLeaves     list of YANG leaf
+     * @param yangPluginConfig plugin config
      * @throws IOException IO operation fail
      */
-    private void addLeavesInfoToTempFiles(List<YangLeaf> listOfLeaves,
+    public void addLeavesInfoToTempFiles(List<YangLeaf> listOfLeaves,
             YangPluginConfig yangPluginConfig)
             throws IOException {
         if (listOfLeaves != null) {
@@ -1299,11 +1346,11 @@
     /**
      * Adds leaf list's attributes in generated files.
      *
-     * @param listOfLeafList list of YANG leaves
-     * @param yangPluginConfig
+     * @param listOfLeafList   list of YANG leaves
+     * @param yangPluginConfig plugin config
      * @throws IOException IO operation fail
      */
-    private void addLeafListInfoToTempFiles(List<YangLeafList> listOfLeafList, YangPluginConfig yangPluginConfig)
+    public void addLeafListInfoToTempFiles(List<YangLeafList> listOfLeafList, YangPluginConfig yangPluginConfig)
             throws IOException {
         if (listOfLeafList != null) {
             for (YangLeafList leafList : listOfLeafList) {
@@ -1329,7 +1376,7 @@
      * Adds all the leaves in the current data model node as part of the
      * generated temporary file.
      *
-     * @param curNode java file info of the generated file
+     * @param curNode          java file info of the generated file
      * @param yangPluginConfig plugin config
      * @throws IOException IO operation fail
      */
@@ -1347,8 +1394,8 @@
     /**
      * Adds the new attribute info to the target generated temporary files.
      *
-     * @param newAttrInfo the attribute info that needs to be added to temporary
-     * files
+     * @param newAttrInfo  the attribute info that needs to be added to temporary
+     *                     files
      * @param pluginConfig plugin configurations
      * @throws IOException IO operation fail
      */
@@ -1423,7 +1470,7 @@
      * Constructs java code exit.
      *
      * @param fileType generated file type
-     * @param curNode current YANG node
+     * @param curNode  current YANG node
      * @throws IOException when fails to generate java files
      */
     public void generateJavaFile(int fileType, YangNode curNode)
@@ -1542,8 +1589,8 @@
      * Removes all temporary file handles.
      *
      * @param isErrorOccurred when translator fails to generate java files we
-     * need to close all open file handles include temporary files
-     * and java files.
+     *                        need to close all open file handles include temporary files
+     *                        and java files.
      * @throws IOException when failed to delete the temporary files
      */
     public void freeTemporaryResources(boolean isErrorOccurred)
@@ -1597,38 +1644,9 @@
      */
     public boolean getIsQualifiedAccessOrAddToImportList(
             JavaQualifiedTypeInfo importInfo) {
-        boolean isImportPkgEqualCurNodePkg;
-        if (importInfo.getClassInfo().contentEquals(
-                getGeneratedJavaClassName())) {
-            /*
-             * if the current class name is same as the attribute class name,
-             * then the attribute must be accessed in a qualified manner.
-             */
-            return true;
-        } else if (importInfo.getPkgInfo() != null) {
-            /*
-             * If the attribute type is having the package info, it is contender
-             * for import list and also need to check if it needs to be a
-             * qualified access.
-             */
-            isImportPkgEqualCurNodePkg = isImportPkgEqualCurNodePkg(importInfo);
-            if (!isImportPkgEqualCurNodePkg) {
-                /*
-                 * If the package of the attribute added is not same as the
-                 * current class package, then it must either be imported for
-                 * access or it must be a qualified access.
-                 */
-                boolean isImportAdded = getJavaImportData().addImportInfo(importInfo);
-                if (!isImportAdded) {
-                    /*
-                     * If the attribute type info is not imported, then it must
-                     * be a qualified access.
-                     */
-                    return true;
-                }
-            }
-        }
-        return false;
+
+        return getJavaImportData().addImportInfo(importInfo, getGeneratedJavaClassName(),
+                getJavaFileInfo().getPackage());
     }
 
     /**
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaServiceFragmentFiles.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaServiceFragmentFiles.java
index c41fdb0..f13e6a5 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaServiceFragmentFiles.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaServiceFragmentFiles.java
@@ -71,11 +71,11 @@
 import static org.onosproject.yangutils.utils.UtilConstants.SLASH;
 import static org.onosproject.yangutils.utils.UtilConstants.VOID;
 import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.createPackage;
-import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.generateJavaDocForRpc;
-import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.getJavaDoc;
 import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.ENUM_ATTRIBUTE;
 import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.GETTER_METHOD;
 import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.MANAGER_SETTER_METHOD;
+import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.generateJavaDocForRpc;
+import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.getJavaDoc;
 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.insertDataIntoJavaFile;
 
 /**
@@ -119,6 +119,7 @@
      * File name for event subject setter temp file.
      */
     private static final String EVENT_SUBJECT_SETTER_FILE_NAME = "EventSubjectSetter";
+
     /**
      * File name for generated class file for service
      * suffix.
@@ -370,14 +371,13 @@
      * Constructs java code exit.
      *
      * @param fileType generated file type
-     * @param curNode current YANG node
+     * @param curNode  current YANG node
      * @throws IOException when fails to generate java files
      */
     @Override
     public void generateJavaFile(int fileType, YangNode curNode)
             throws IOException {
-        List<String> imports = new ArrayList<>();
-        imports = getJavaImportData().getImports();
+        List<String> imports = getJavaImportData().getImports();
 
         createPackage(curNode);
 
@@ -433,15 +433,16 @@
     /**
      * Adds rpc string information to applicable temp file.
      *
-     * @param javaAttributeInfoOfInput rpc's input node attribute info
+     * @param javaAttributeInfoOfInput  rpc's input node attribute info
      * @param javaAttributeInfoOfOutput rpc's output node attribute info
-     * @param rpcName name of the rpc function
-     * @param pluginConfig plugin configurations
+     * @param rpcName                   name of the rpc function
+     * @param pluginConfig              plugin configurations
      * @throws IOException IO operation fail
      */
     private void addRpcString(JavaAttributeInfo javaAttributeInfoOfInput,
             JavaAttributeInfo javaAttributeInfoOfOutput, YangPluginConfig pluginConfig,
-            String rpcName) throws IOException {
+            String rpcName)
+            throws IOException {
         String rpcInput = EMPTY_STRING;
         String rpcOutput = VOID;
         String rpcInputJavaDoc = EMPTY_STRING;
@@ -464,20 +465,21 @@
     /**
      * Adds rpc string information to applicable temp file.
      *
-     * @param javaAttributeInfoOfInput rpc's input node attribute info
+     * @param javaAttributeInfoOfInput  rpc's input node attribute info
      * @param javaAttributeInfoOfOutput rpc's output node attribute info
-     * @param rpcName name of the rpc function
-     * @param pluginConfig plugin configurations
-     * @param isInputLeafHolder if input node is leaf holder
-     * @param isOutputLeafHolder if output node is leaf holder
-     * @param isInputSingleChildHolder if input node is single child holder
+     * @param rpcName                   name of the rpc function
+     * @param pluginConfig              plugin configurations
+     * @param isInputLeafHolder         if input node is leaf holder
+     * @param isOutputLeafHolder        if output node is leaf holder
+     * @param isInputSingleChildHolder  if input node is single child holder
      * @param isOutputSingleChildHolder if input node is single child holder
      * @throws IOException IO operation fail
      */
     public void addRpcString(JavaAttributeInfo javaAttributeInfoOfInput,
             JavaAttributeInfo javaAttributeInfoOfOutput, YangPluginConfig pluginConfig,
             String rpcName, boolean isInputLeafHolder, boolean isOutputLeafHolder,
-            boolean isInputSingleChildHolder, boolean isOutputSingleChildHolder) throws IOException {
+            boolean isInputSingleChildHolder, boolean isOutputSingleChildHolder)
+            throws IOException {
         String rpcInput = EMPTY_STRING;
         String rpcOutput = VOID;
         String rpcInputJavaDoc = EMPTY_STRING;
@@ -504,10 +506,10 @@
     /**
      * Returns names for input and output.
      *
-     * @param attr attribute info
-     * @param isLeafHolder if leaf holder
+     * @param attr                attribute info
+     * @param isLeafHolder        if leaf holder
      * @param isSinglechildHolder if single child holder
-     * @param pluginConfig plugin configurations
+     * @param pluginConfig        plugin configurations
      * @return names for input and output
      */
     private String getInputOutputNames(JavaAttributeInfo attr, boolean isLeafHolder, boolean isSinglechildHolder,
@@ -550,13 +552,13 @@
     /**
      * Adds the JAVA rpc snippet information.
      *
-     * @param javaAttributeInfoOfInput rpc's input node attribute info
+     * @param javaAttributeInfoOfInput  rpc's input node attribute info
      * @param javaAttributeInfoOfOutput rpc's output node attribute info
-     * @param pluginConfig plugin configurations
-     * @param rpcName name of the rpc function
-     * @param isInputLeafHolder if input node is leaf holder
-     * @param isOutputLeafHolder if output node is leaf holder
-     * @param isInputSingleChildHolder if input node is single child holder
+     * @param pluginConfig              plugin configurations
+     * @param rpcName                   name of the rpc function
+     * @param isInputLeafHolder         if input node is leaf holder
+     * @param isOutputLeafHolder        if output node is leaf holder
+     * @param isInputSingleChildHolder  if input node is single child holder
      * @param isOutputSingleChildHolder if input node is single child holder
      * @throws IOException IO operation fail
      */
@@ -573,7 +575,7 @@
      * Constructs java code exit.
      *
      * @param fileType generated file type
-     * @param curNode current YANG node
+     * @param curNode  current YANG node
      * @throws IOException when fails to generate java files
      */
     public void generateEventJavaFile(int fileType, YangNode curNode)
@@ -604,7 +606,7 @@
      * Constructs java code exit.
      *
      * @param fileType generated file type
-     * @param curNode current YANG node
+     * @param curNode  current YANG node
      * @throws IOException when fails to generate java files
      */
     public void generateEventListenerJavaFile(int fileType, YangNode curNode)
@@ -632,7 +634,7 @@
      * Constructs java code exit.
      *
      * @param fileType generated file type
-     * @param curNode current YANG node
+     * @param curNode  current YANG node
      * @throws IOException when fails to generate java files
      */
     public void generateEventSubjectJavaFile(int fileType, YangNode curNode)
@@ -657,8 +659,8 @@
      * Removes all temporary file handles.
      *
      * @param isErrorOccurred when translator fails to generate java files we
-     * need to close all open file handles include temporary files
-     * and java files.
+     *                        need to close all open file handles include temporary files
+     *                        and java files.
      * @throws IOException when failed to delete the temporary files
      */
     @Override
@@ -782,17 +784,18 @@
     /**
      * Adds java snippet for events to event subject file.
      *
-     * @param curNode current node
+     * @param curNode      current node
      * @param pluginConfig plugin configurations
      * @throws IOException when fails to do IO operations
      */
-    public void addJavaSnippetOfEvent(YangNode curNode, YangPluginConfig pluginConfig) throws IOException {
+    public void addJavaSnippetOfEvent(YangNode curNode, YangPluginConfig pluginConfig)
+            throws IOException {
 
         String currentInfo = getCapitalCase(getCamelCase(((YangNotification) curNode).getName(),
                 pluginConfig.getConflictResolver()));
         String notificationName = ((YangNotification) curNode).getName();
 
-        JavaQualifiedTypeInfo qualifiedTypeInfo = getQualifiedTypeInfoOfCurNode(curNode.getParent(),
+        JavaQualifiedTypeInfo qualifiedTypeInfo = getQualifiedTypeInfoOfCurNode(curNode,
                 getCapitalCase(currentInfo));
 
         JavaAttributeInfo javaAttributeInfo =
@@ -807,14 +810,16 @@
     }
 
     /*Adds event to enum temp file.*/
-    private void addEventEnum(String notificationName, YangPluginConfig pluginConfig) throws IOException {
+    private void addEventEnum(String notificationName, YangPluginConfig pluginConfig)
+            throws IOException {
         appendToFile(getEventEnumTempFileHandle(),
                 getJavaDoc(ENUM_ATTRIBUTE, notificationName, false, pluginConfig) + FOUR_SPACE_INDENTATION
                         + getEnumJavaAttribute(notificationName).toUpperCase() + COMMA + NEW_LINE);
     }
 
     /*Adds event method in event class*/
-    private void addEnumMethod(String eventClassname, String className) throws IOException {
+    private void addEnumMethod(String eventClassname, String className)
+            throws IOException {
         appendToFile(getEventMethodTempFileHandle(), getEventFileContents(eventClassname, className));
     }
 
@@ -853,7 +858,8 @@
     }
 
     /*Adds getter method for event in event subject class.*/
-    private void addEventSubjectGetter(JavaAttributeInfo attr, YangPluginConfig pluginConfig) throws IOException {
+    private void addEventSubjectGetter(JavaAttributeInfo attr, YangPluginConfig pluginConfig)
+            throws IOException {
         appendToFile(getEventSubjectGetterTempFileHandle(),
                 getJavaDoc(GETTER_METHOD, getCapitalCase(attr.getAttributeName()), false, pluginConfig)
                         + getGetterForClass(attr, GENERATE_EVENT_SUBJECT_CLASS) + NEW_LINE);
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaTypeFragmentFiles.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaTypeFragmentFiles.java
index 2cbbb49..930b6b4 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaTypeFragmentFiles.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaTypeFragmentFiles.java
@@ -76,6 +76,7 @@
      * Temporary file handle for of string method of class.
      */
     private File ofStringImplTempFileHandle;
+
     /**
      * Temporary file handle for constructor for type class.
      */
@@ -85,6 +86,7 @@
      * Java file handle for typedef class file.
      */
     private File typedefClassJavaFileHandle;
+
     /**
      * Java file handle for type class like union, typedef file.
      */
@@ -211,7 +213,7 @@
                 YangJavaType<?> javaType = (YangJavaType<?>) yangType;
                 javaType.updateJavaQualifiedInfo(pluginConfig.getConflictResolver());
                 String typeName = javaType.getDataTypeName();
-                    typeName = getCamelCase(typeName, pluginConfig.getConflictResolver());
+                typeName = getCamelCase(typeName, pluginConfig.getConflictResolver());
                 JavaAttributeInfo javaAttributeInfo = getAttributeInfoForTheData(
                         javaType.getJavaQualifiedInfo(),
                         typeName, javaType,
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaGrouping.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaGrouping.java
index f647c0d..265caf6 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaGrouping.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaGrouping.java
@@ -24,14 +24,14 @@
 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
 import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig;
 
-import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER;
-import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.generateCodeOfNode;
+import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.updatePackageInfo;
 
 /**
  * Represents grouping information extended to support java code generation.
  */
 public class YangJavaGrouping
-        extends YangGrouping implements JavaCodeGeneratorInfo, JavaCodeGenerator {
+        extends YangGrouping
+        implements JavaCodeGeneratorInfo, JavaCodeGenerator {
 
     /**
      * Contains the information of the java file being generated.
@@ -50,7 +50,6 @@
     public YangJavaGrouping() {
         super();
         setJavaFileInfo(new JavaFileInfo());
-        getJavaFileInfo().setGeneratedFileTypes(GENERATE_INTERFACE_WITH_BUILDER);
     }
 
     /**
@@ -96,35 +95,22 @@
         tempFileHandle = fileHandle;
     }
 
-    /**
-     * Prepare the information for java code generation corresponding to YANG
-     * grouping info.
-     *
-     * @param yangPlugin YANG plugin config
-     * @throws TranslatorException translator operation fail
-     */
+
     @Override
-    public void generateCodeEntry(YangPluginConfig yangPlugin) throws TranslatorException {
+    public void generateCodeEntry(YangPluginConfig yangPlugin)
+            throws TranslatorException {
         try {
-            generateCodeOfNode(this, yangPlugin);
+            updatePackageInfo(this, yangPlugin);
         } catch (IOException e) {
-            throw new TranslatorException(
-                    "Failed to prepare generate code entry for container node " + this.getName());
+            throw new TranslatorException(e.getCause());
         }
     }
 
-    /**
-     * Create a java file using the YANG grouping info.
-     *
-     * @throws TranslatorException translator operation fail
-     */
     @Override
-    public void generateCodeExit() throws TranslatorException {
-        try {
-            getTempJavaCodeFragmentFiles().generateJavaFile(GENERATE_INTERFACE_WITH_BUILDER, this);
-        } catch (IOException e) {
-            throw new TranslatorException("Failed to generate code for container node " + this.getName());
-        }
+    public void generateCodeExit()
+            throws TranslatorException {
+        /*
+         * Do nothing.
+         */
     }
-
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaRpc.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaRpc.java
index c3bd23a..2bf1989 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaRpc.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaRpc.java
@@ -24,6 +24,7 @@
 import org.onosproject.yangutils.datamodel.YangLeaf;
 import org.onosproject.yangutils.datamodel.YangLeafList;
 import org.onosproject.yangutils.datamodel.YangLeavesHolder;
+import org.onosproject.yangutils.datamodel.YangList;
 import org.onosproject.yangutils.datamodel.YangNode;
 import org.onosproject.yangutils.datamodel.YangOutput;
 import org.onosproject.yangutils.datamodel.YangRpc;
@@ -40,10 +41,8 @@
 import org.onosproject.yangutils.translator.tojava.TempJavaFragmentFiles;
 import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig;
 
-import static org.onosproject.yangutils.datamodel.YangNodeType.LIST_NODE;
 import static org.onosproject.yangutils.translator.tojava.JavaAttributeInfo.getAttributeInfoForTheData;
 import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.getQualifiedTypeInfoOfCurNode;
-import static org.onosproject.yangutils.translator.tojava.TempJavaFragmentFiles.resolveGroupingsQuailifiedInfo;
 import static org.onosproject.yangutils.translator.tojava.utils.AttributesJavaDataType.getJavaDataType;
 import static org.onosproject.yangutils.translator.tojava.utils.AttributesJavaDataType.getJavaImportClass;
 import static org.onosproject.yangutils.translator.tojava.utils.AttributesJavaDataType.getJavaImportPackage;
@@ -52,6 +51,13 @@
 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getPackageDirPathFromJavaJPackage;
 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getParentNodeInGenCode;
 import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.updatePackageInfo;
+import static org.onosproject.yangutils.utils.UtilConstants.ACTIVATE;
+import static org.onosproject.yangutils.utils.UtilConstants.COMPONENT;
+import static org.onosproject.yangutils.utils.UtilConstants.DEACTIVATE;
+import static org.onosproject.yangutils.utils.UtilConstants.MANAGER;
+import static org.onosproject.yangutils.utils.UtilConstants.REFERENCE;
+import static org.onosproject.yangutils.utils.UtilConstants.REFERENCE_CARDINALITY;
+import static org.onosproject.yangutils.utils.UtilConstants.SERVICE;
 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory;
 
 /**
@@ -126,7 +132,8 @@
      * @throws TranslatorException translator operations fails
      */
     @Override
-    public void generateCodeEntry(YangPluginConfig yangPlugin) throws TranslatorException {
+    public void generateCodeEntry(YangPluginConfig yangPlugin)
+            throws TranslatorException {
 
         if (!(this instanceof JavaCodeGeneratorInfo)) {
             // TODO:throw exception
@@ -152,7 +159,8 @@
      * @throws TranslatorException translator operations fails
      */
     @Override
-    public void generateCodeExit() throws TranslatorException {
+    public void generateCodeExit()
+            throws TranslatorException {
         // Get the parent module/sub-module.
         YangNode parent = getParentNodeInGenCode(this);
 
@@ -216,7 +224,15 @@
                     YangNode tempNode = node.getChild();
                     while (tempNode != null) {
                         if (tempNode instanceof YangUses) {
-                            deleteDirectoryWhenNoFileIsGeneratedForInputOutput(rpcsChildNodePkg);
+                            boolean isCodeGenerated = true;
+                            if (node instanceof YangJavaInput) {
+                                isCodeGenerated = ((YangJavaInput) node).isCodeGenFlag();
+                            } else if (node instanceof YangJavaOutput) {
+                                isCodeGenerated = ((YangJavaOutput) node).isCodeGenFlag();
+                            }
+                            if (!isCodeGenerated) {
+                                deleteDirectoryWhenNoFileIsGeneratedForInputOutput(rpcsChildNodePkg);
+                            }
                         }
                         tempNode = tempNode.getNextSibling();
                     }
@@ -236,7 +252,8 @@
      * @param emptyPkg empty package
      * @throws IOException when fails to do IO operations
      */
-    private void deleteDirectoryWhenNoFileIsGeneratedForInputOutput(String emptyPkg) throws IOException {
+    private void deleteDirectoryWhenNoFileIsGeneratedForInputOutput(String emptyPkg)
+            throws IOException {
         deleteDirectory(emptyPkg);
     }
 
@@ -244,8 +261,8 @@
      * Creates an attribute info object corresponding to a data model node and
      * return it.
      *
-     * @param childNode child data model node(input / output) for which the java code generation
-     * is being handled
+     * @param childNode   child data model node(input / output) for which the java code generation
+     *                    is being handled
      * @param currentNode parent node (module / sub-module) in which the child node is an attribute
      * @return AttributeInfo attribute details required to add in temporary
      * files
@@ -260,7 +277,7 @@
          * Get the import info corresponding to the attribute for import in
          * generated java files or qualified access
          */
-        JavaQualifiedTypeInfo qualifiedTypeInfo = getQualifiedTypeInfoOfCurNode(currentNode,
+        JavaQualifiedTypeInfo qualifiedTypeInfo = getQualifiedTypeInfoOfCurNode(childNode,
                 getCapitalCase(childNodeName));
         if (!(parentNode instanceof TempJavaCodeFragmentFilesContainer)) {
             throw new TranslatorException("Parent node does not have file info");
@@ -281,7 +298,7 @@
     /**
      * Process input/output nodes.
      *
-     * @param node YANG node
+     * @param node             YANG node
      * @param yangPluginConfig plugin configurations
      */
     private void processNodeEntry(YangNode node, YangPluginConfig yangPluginConfig) {
@@ -299,7 +316,11 @@
         } else if (node.getChild() != null && holder.getListOfLeaf().isEmpty()
                 && holder.getListOfLeafList().isEmpty()) {
             if (getNumberOfChildNodes(node) == 1) {
-                setCodeGenFlagForNode(node, false);
+                if (node.getChild() instanceof YangUses) {
+                    setCodeGenFlagForNode(node, getCodeGenFlagWhenUsesIsAChildNode(node));
+                } else {
+                    setCodeGenFlagForNode(node, false);
+                }
             } else {
                 setCodeGenFlagForNode(node, true);
             }
@@ -308,10 +329,37 @@
         }
     }
 
+    /*Returns code gen flag when uses is a child node.*/
+    private boolean getCodeGenFlagWhenUsesIsAChildNode(YangNode node) {
+        YangUses uses = (YangUses) node.getChild();
+
+        List<YangNode> groupingChildResolvedNodes = uses.getUsesResolvedNodeList();
+        List<List<YangLeaf>> groupingChildResolvedLeaves = uses.getUsesResolvedLeavesList();
+        List<List<YangLeafList>> groupingChildResolvedLeafList = uses.getUsesResolvedListOfLeafList();
+
+        if (!groupingChildResolvedNodes.isEmpty()
+                && groupingChildResolvedNodes.size() == 1
+                && groupingChildResolvedLeaves.isEmpty()
+                && groupingChildResolvedLeafList.isEmpty()) {
+            return false;
+        } else if (groupingChildResolvedNodes.isEmpty()
+                && isOnlyOneLeafPresentInGrouping(groupingChildResolvedLeaves)
+                && groupingChildResolvedLeafList.isEmpty()) {
+            return false;
+        } else if (groupingChildResolvedNodes.isEmpty()
+                && groupingChildResolvedLeaves.isEmpty()
+                && isOnlyOneLeafListPresentInGrouping(groupingChildResolvedLeafList)) {
+            return false;
+        }
+        return (groupingChildResolvedNodes.isEmpty()
+                && groupingChildResolvedLeaves.isEmpty()
+                && groupingChildResolvedLeafList.isEmpty());
+    }
+
     /**
      * Process input/output nodes.
      *
-     * @param node YANG node
+     * @param node             YANG node
      * @param yangPluginConfig plugin configurations
      * @return java attribute info
      */
@@ -343,7 +391,7 @@
     /**
      * Process input/output node when one leaf is present.
      *
-     * @param node input/output node
+     * @param node             input/output node
      * @param yangPluginConfig plugin configurations
      * @return java attribute for node
      */
@@ -351,30 +399,15 @@
             YangPluginConfig yangPluginConfig) {
 
         YangLeavesHolder holder = (YangLeavesHolder) node;
-        List<YangLeaf> listOfLeaves = holder.getListOfLeaf();
-
-        for (YangLeaf leaf : listOfLeaves) {
-            if (!(leaf instanceof JavaLeafInfoContainer)) {
-                throw new TranslatorException("Leaf does not have java information");
-            }
-            JavaLeafInfoContainer javaLeaf = (JavaLeafInfoContainer) leaf;
-            javaLeaf.setConflictResolveConfig(yangPluginConfig.getConflictResolver());
-            javaLeaf.updateJavaQualifiedInfo();
-            JavaAttributeInfo javaAttributeInfo = getAttributeInfoForTheData(
-                    javaLeaf.getJavaQualifiedInfo(),
-                    javaLeaf.getJavaName(yangPluginConfig.getConflictResolver()),
-                    javaLeaf.getDataType(),
-                    addTypeImport(javaLeaf.getDataType(), false, yangPluginConfig), false);
-            setLeafHolderFlag(node, true);
-            return javaAttributeInfo;
-        }
-        return null;
+        YangLeaf leaf = holder.getListOfLeaf().get(0);
+        setLeafHolderFlag(node, true);
+        return getAttributeInfoForLeaf(leaf, yangPluginConfig);
     }
 
     /**
      * Process input/output node when one leaf list is present.
      *
-     * @param node input/output node
+     * @param node             input/output node
      * @param yangPluginConfig plugin configurations
      * @return java attribute for node
      */
@@ -382,33 +415,57 @@
             YangPluginConfig yangPluginConfig) {
 
         YangLeavesHolder holder = (YangLeavesHolder) node;
-        List<YangLeafList> listOfLeafList = holder.getListOfLeafList();
+        YangLeafList leafList = holder.getListOfLeafList().get(0);
+        setLeafHolderFlag(node, true);
+        return getAttributeInfoForLeafList(leafList, yangPluginConfig);
+    }
 
-        for (YangLeafList leafList : listOfLeafList) {
-            if (!(leafList instanceof JavaLeafInfoContainer)) {
-                throw new TranslatorException("Leaf-list does not have java information");
-            }
-            JavaLeafInfoContainer javaLeaf = (JavaLeafInfoContainer) leafList;
-            javaLeaf.setConflictResolveConfig(yangPluginConfig.getConflictResolver());
-            javaLeaf.updateJavaQualifiedInfo();
-            ((TempJavaCodeFragmentFilesContainer) this.getParent()).getTempJavaCodeFragmentFiles()
-                    .getServiceTempFiles().getJavaImportData().setIfListImported(true);
-            JavaAttributeInfo javaAttributeInfo = getAttributeInfoForTheData(
-                    javaLeaf.getJavaQualifiedInfo(),
-                    javaLeaf.getJavaName(yangPluginConfig.getConflictResolver()),
-                    javaLeaf.getDataType(),
-                    addTypeImport(javaLeaf.getDataType(), true, yangPluginConfig),
-                    true);
-            setLeafHolderFlag(node, true);
-            return javaAttributeInfo;
-        }
-        return null;
+    /**
+     * Returns java attribute info for leaf.
+     *
+     * @param leaf             YANG leaf
+     * @param yangPluginConfig plugin configurations
+     * @return java attribute info for leaf
+     */
+    private JavaAttributeInfo getAttributeInfoForLeaf(YangLeaf leaf, YangPluginConfig yangPluginConfig) {
+        JavaLeafInfoContainer javaLeaf = (JavaLeafInfoContainer) leaf;
+        javaLeaf.setConflictResolveConfig(yangPluginConfig.getConflictResolver());
+        javaLeaf.updateJavaQualifiedInfo();
+        JavaAttributeInfo javaAttributeInfo = getAttributeInfoForTheData(
+                javaLeaf.getJavaQualifiedInfo(),
+                javaLeaf.getJavaName(yangPluginConfig.getConflictResolver()),
+                javaLeaf.getDataType(),
+                addTypeImport(javaLeaf.getDataType(), false, yangPluginConfig), false);
+        return javaAttributeInfo;
+    }
+
+    /**
+     * Returns java attribute info for leaf list.
+     *
+     * @param leafList         YANG leaf list
+     * @param yangPluginConfig plugin configurations
+     * @return java attribute info for leaf list
+     */
+    private JavaAttributeInfo getAttributeInfoForLeafList(YangLeafList leafList,
+            YangPluginConfig yangPluginConfig) {
+        JavaLeafInfoContainer javaLeaf = (JavaLeafInfoContainer) leafList;
+        javaLeaf.setConflictResolveConfig(yangPluginConfig.getConflictResolver());
+        javaLeaf.updateJavaQualifiedInfo();
+        ((TempJavaCodeFragmentFilesContainer) this.getParent()).getTempJavaCodeFragmentFiles()
+                .getServiceTempFiles().getJavaImportData().setIfListImported(true);
+        JavaAttributeInfo javaAttributeInfo = getAttributeInfoForTheData(
+                javaLeaf.getJavaQualifiedInfo(),
+                javaLeaf.getJavaName(yangPluginConfig.getConflictResolver()),
+                javaLeaf.getDataType(),
+                addTypeImport(javaLeaf.getDataType(), true, yangPluginConfig),
+                true);
+        return javaAttributeInfo;
     }
 
     /**
      * Process input/output node when one child node is present.
      *
-     * @param node input/output node
+     * @param node             input/output node
      * @param yangPluginConfig plugin configurations
      * @return java attribute for node
      */
@@ -418,10 +475,8 @@
         String clsInfo = "";
         JavaQualifiedTypeInfo childInfo = new JavaQualifiedTypeInfo();
         if (node.getChild() instanceof YangJavaUses) {
-            childInfo = resolveGroupingsQuailifiedInfo(((YangJavaUses) node.getChild()).getRefGroup(),
-                    yangPluginConfig);
-            clsInfo = getCapitalCase(getCamelCase(((YangJavaUses) node.getChild()).getRefGroup().getName(),
-                    yangPluginConfig.getConflictResolver()));
+            YangJavaUses uses = (YangJavaUses) node.getChild();
+            return processNodeWhenUsesIsChild(uses, node, yangPluginConfig);
         } else {
             String pkg = (rpcInfo.getPackage() + "." + rpcInfo.getJavaName() + "."
                     + getCamelCase(node.getName(), yangPluginConfig.getConflictResolver())).toLowerCase();
@@ -431,7 +486,7 @@
             childInfo.setClassInfo(clsInfo);
         }
         boolean isList = false;
-        if (node.getChild().getNodeType().equals(LIST_NODE)) {
+        if (node.getChild() instanceof YangList) {
             isList = true;
         }
         boolean isQualified = addImportToService(childInfo);
@@ -445,6 +500,88 @@
     }
 
     /**
+     * Returns java attribute info when child node is uses.
+     *
+     * @param uses             YANG uses node
+     * @param node             YANG node
+     * @param yangPluginConfig plugin configurations
+     * @return java attribute info when child node is uses
+     */
+    private JavaAttributeInfo processNodeWhenUsesIsChild(YangUses uses, YangNode node,
+            YangPluginConfig yangPluginConfig) {
+        String clsInfo = "";
+        JavaQualifiedTypeInfo childInfo = new JavaQualifiedTypeInfo();
+        List<YangNode> groupingChildResolvedNodes = uses.getUsesResolvedNodeList();
+        List<List<YangLeaf>> groupingChildResolvedLeaves = uses.getUsesResolvedLeavesList();
+        List<List<YangLeafList>> groupingChildResolvedLeafList = uses.getUsesResolvedListOfLeafList();
+
+        if (!groupingChildResolvedNodes.isEmpty()
+                && groupingChildResolvedNodes.size() == 1
+                && groupingChildResolvedLeaves.isEmpty()
+                && groupingChildResolvedLeafList.isEmpty()) {
+            YangNode childNodeOfGrouping = groupingChildResolvedNodes.get(0);
+            boolean isList = false;
+            if (childNodeOfGrouping instanceof YangList) {
+                isList = true;
+            }
+            JavaFileInfo childNodeOfGroupingInfo =
+                    ((JavaFileInfoContainer) childNodeOfGrouping).getJavaFileInfo();
+            childInfo.setClassInfo(getCapitalCase(childNodeOfGroupingInfo.getJavaName()));
+            childInfo.setPkgInfo(childNodeOfGroupingInfo.getPackage());
+            clsInfo = childInfo.getClassInfo();
+            boolean isQualified = addImportToService(childInfo);
+            setLeafHolderFlag(node, false);
+            setSingleChildHolderFlag(node, true);
+            return getAttributeInfoForTheData(childInfo, clsInfo, null, isQualified, isList);
+
+        } else if (groupingChildResolvedNodes.isEmpty()
+                && isOnlyOneLeafPresentInGrouping(groupingChildResolvedLeaves)
+                && groupingChildResolvedLeafList.isEmpty()) {
+
+            YangLeaf leaf = groupingChildResolvedLeaves.get(0).get(0);
+            setLeafHolderFlag(node, true);
+            return getAttributeInfoForLeaf(leaf, yangPluginConfig);
+
+        } else if (groupingChildResolvedNodes.isEmpty()
+                && groupingChildResolvedLeaves.isEmpty()
+                && isOnlyOneLeafListPresentInGrouping(groupingChildResolvedLeafList)) {
+            YangLeafList leafList = groupingChildResolvedLeafList.get(0).get(0);
+            setLeafHolderFlag(node, true);
+            return getAttributeInfoForLeafList(leafList, yangPluginConfig);
+
+        } else if (groupingChildResolvedNodes.isEmpty()
+                && groupingChildResolvedLeaves.isEmpty()
+                && groupingChildResolvedLeafList.isEmpty()) {
+            return null;
+        } else {
+            return processNodeWhenMultipleContaintsArePresent(node);
+        }
+    }
+
+    /*Return true if only one leaf is present in grouping node.*/
+    private boolean isOnlyOneLeafPresentInGrouping(List<List<YangLeaf>> groupingChildResolvedLeaves) {
+        if (!groupingChildResolvedLeaves.isEmpty() &&
+                groupingChildResolvedLeaves.size() == 1) {
+            List<YangLeaf> leaves = groupingChildResolvedLeaves.get(0);
+            return leaves.size() == 1;
+        } else {
+            return false;
+        }
+    }
+
+    /*Returns true is only one leaf list is present in grouping node.*/
+    private boolean isOnlyOneLeafListPresentInGrouping(List<List<YangLeafList>> groupingChildResolvedLeafList) {
+
+        if (!groupingChildResolvedLeafList.isEmpty() &&
+                groupingChildResolvedLeafList.size() == 1) {
+            List<YangLeafList> leaves = groupingChildResolvedLeafList.get(0);
+            return leaves.size() == 1;
+        } else {
+            return false;
+        }
+    }
+
+    /**
      * Process input/output node when multiple leaf and child nodes are present.
      *
      * @param node input/output node
@@ -460,8 +597,8 @@
     /**
      * Adds type import to the RPC import list.
      *
-     * @param type YANG type
-     * @param isList is list attribute
+     * @param type         YANG type
+     * @param isList       is list attribute
      * @param pluginConfig plugin configurations
      * @return type import to the RPC import list
      */
@@ -492,13 +629,26 @@
      * @return true or false
      */
     private boolean addImportToService(JavaQualifiedTypeInfo importInfo) {
-        if (((TempJavaCodeFragmentFilesContainer) this.getParent()).getTempJavaCodeFragmentFiles()
-                .getServiceTempFiles().getJavaImportData().addImportInfo(importInfo)) {
-            return !((TempJavaCodeFragmentFilesContainer) this.getParent()).getTempJavaCodeFragmentFiles()
-                    .getServiceTempFiles().getJavaImportData().getImportSet().contains(importInfo);
-        } else {
+        JavaFileInfo fileInfo = ((JavaFileInfoContainer) this.getParent()).getJavaFileInfo();
+
+        if (importInfo.getClassInfo().contentEquals(SERVICE)
+                || importInfo.getClassInfo().contentEquals(COMPONENT)
+                || importInfo.getClassInfo().contentEquals(getCapitalCase(ACTIVATE))
+                || importInfo.getClassInfo().contentEquals(getCapitalCase(DEACTIVATE))
+                || importInfo.getClassInfo().contentEquals(REFERENCE_CARDINALITY)
+                || importInfo.getClassInfo().contentEquals(REFERENCE)
+                || importInfo.getClassInfo().contentEquals(getCapitalCase(fileInfo.getJavaName() + SERVICE))
+                || importInfo.getClassInfo().contentEquals(getCapitalCase(fileInfo.getJavaName() + MANAGER))) {
             return true;
         }
+
+        String className;
+        className = getCapitalCase(fileInfo.getJavaName()) + "Service";
+
+        return ((TempJavaCodeFragmentFilesContainer) this.getParent()).getTempJavaCodeFragmentFiles()
+                .getServiceTempFiles().getJavaImportData().addImportInfo(importInfo,
+                        className, fileInfo.getPackage());
+
     }
 
     /**
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaUses.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaUses.java
index f2d2ada..f000b99 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaUses.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/javamodel/YangJavaUses.java
@@ -16,7 +16,12 @@
 package org.onosproject.yangutils.translator.tojava.javamodel;
 
 import java.io.IOException;
+import java.util.List;
 
+import org.onosproject.yangutils.datamodel.YangGrouping;
+import org.onosproject.yangutils.datamodel.YangLeaf;
+import org.onosproject.yangutils.datamodel.YangLeafList;
+import org.onosproject.yangutils.datamodel.YangNode;
 import org.onosproject.yangutils.datamodel.YangUses;
 import org.onosproject.yangutils.translator.exception.TranslatorException;
 import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
@@ -24,15 +29,16 @@
 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFiles;
 import org.onosproject.yangutils.translator.tojava.utils.YangPluginConfig;
 
-import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_INTERFACE_WITH_BUILDER;
-import static org.onosproject.yangutils.translator.tojava.TempJavaFragmentFiles.addCurNodeInfoInParentTempFile;
+import static org.onosproject.yangutils.translator.tojava.TempJavaFragmentFiles.addCurNodeAsAttributeInTargetTempFile;
+import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getParentNodeInGenCode;
+import static org.onosproject.yangutils.translator.tojava.utils.YangJavaModelUtils.updatePackageInfo;
 
 /**
  * Represents uses information extended to support java code generation.
  */
 public class YangJavaUses
-        extends YangUses implements JavaCodeGeneratorInfo, JavaCodeGenerator {
-
+        extends YangUses
+        implements JavaCodeGeneratorInfo, JavaCodeGenerator {
 
     /**
      * Contains the information of the java file being generated.
@@ -51,7 +57,6 @@
     public YangJavaUses() {
         super();
         setJavaFileInfo(new JavaFileInfo());
-        getJavaFileInfo().setGeneratedFileTypes(GENERATE_INTERFACE_WITH_BUILDER);
     }
 
     /**
@@ -97,31 +102,57 @@
         tempFileHandle = fileHandle;
     }
 
-    /**
-     * Prepare the information for java code generation corresponding to YANG
-     * uses info.
-     *
-     * @param yangPlugin YANG plugin config
-     * @throws TranslatorException translator operation fail
-     */
+
     @Override
-    public void generateCodeEntry(YangPluginConfig yangPlugin) throws TranslatorException {
+    public void generateCodeEntry(YangPluginConfig yangPlugin)
+            throws TranslatorException {
         try {
-            addCurNodeInfoInParentTempFile(this, false, yangPlugin);
+            updatePackageInfo(this, yangPlugin);
+
+            if (!(getParentNodeInGenCode(this) instanceof JavaCodeGeneratorInfo)) {
+                throw new TranslatorException("invalid container of uses");
+            }
+            JavaCodeGeneratorInfo javaCodeGeneratorInfo = (JavaCodeGeneratorInfo) getParentNodeInGenCode(this);
+
+            if (javaCodeGeneratorInfo instanceof YangGrouping) {
+                /*
+                 * Do nothing, since it will taken care in the groupings uses.
+                 */
+                return;
+            }
+
+            for (List<YangLeaf> leavesList :
+                    getUsesResolvedLeavesList()) {
+                //add the resolved leaves to the parent as an attribute
+                javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles()
+                        .getBeanTempFiles().addLeavesInfoToTempFiles(leavesList, yangPlugin);
+            }
+
+            for (List<YangLeafList> listOfLeafLists :
+                    getUsesResolvedListOfLeafList()) {
+                //add the resolved leaf-list to the parent as an attribute
+                javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles()
+                        .getBeanTempFiles().addLeafListInfoToTempFiles(listOfLeafLists, yangPlugin);
+            }
+
+            for (YangNode usesResolvedNode :
+                    getUsesResolvedNodeList()) {
+                //add the resolved nodes to the parent as an attribute
+                addCurNodeAsAttributeInTargetTempFile(usesResolvedNode, yangPlugin,
+                        getParentNodeInGenCode(this));
+            }
+
         } catch (IOException e) {
-            throw new TranslatorException(
-                    "Failed to prepare generate code entry for container node " + this.getName());
+            throw new TranslatorException(e.getCause());
         }
     }
 
-    /**
-     * Create a java file using the YANG uses info.
-     *
-     * @throws TranslatorException translator operation fail
-     */
-    @Override
-    public void generateCodeExit() throws TranslatorException {
-        // no code generation will be done for uses.
-    }
 
+    @Override
+    public void generateCodeExit()
+            throws TranslatorException {
+        /*
+         * Do nothing.
+         */
+    }
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/AttributesJavaDataType.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/AttributesJavaDataType.java
index 9e7cc5c..19ed11d 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/AttributesJavaDataType.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/AttributesJavaDataType.java
@@ -16,6 +16,8 @@
 
 package org.onosproject.yangutils.translator.tojava.utils;
 
+import java.util.Stack;
+
 import org.onosproject.yangutils.datamodel.YangDataTypes;
 import org.onosproject.yangutils.datamodel.YangDerivedInfo;
 import org.onosproject.yangutils.datamodel.YangEnumeration;
@@ -26,6 +28,7 @@
 import org.onosproject.yangutils.translator.exception.TranslatorException;
 import org.onosproject.yangutils.translator.tojava.JavaFileInfo;
 import org.onosproject.yangutils.translator.tojava.JavaFileInfoContainer;
+import org.onosproject.yangutils.translator.tojava.javamodel.JavaCodeGeneratorInfo;
 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaEnumeration;
 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModule;
 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaSubModule;
@@ -34,6 +37,8 @@
 
 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCamelCase;
 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCapitalCase;
+import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCurNodePackage;
+import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getPackageDirPathFromJavaJPackage;
 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getRootPackage;
 import static org.onosproject.yangutils.utils.UtilConstants.BIG_INTEGER;
 import static org.onosproject.yangutils.utils.UtilConstants.BOOLEAN_DATA_TYPE;
@@ -119,7 +124,7 @@
      * Returns from string method parsed string.
      *
      * @param targetDataType target data type
-     * @param yangType YANG type
+     * @param yangType       YANG type
      * @return parsed string
      */
     public static String getParseFromStringMethod(String targetDataType, YangType<?> yangType) {
@@ -163,8 +168,8 @@
     /**
      * Returns java import class.
      *
-     * @param yangType YANG type
-     * @param isListAttr if the attribute need to be a list
+     * @param yangType     YANG type
+     * @param isListAttr   if the attribute need to be a list
      * @param pluginConfig plugin configurations
      * @return java import class
      */
@@ -199,8 +204,8 @@
                     return BOOLEAN_WRAPPER;
                 case ENUMERATION:
                     return getCapitalCase(
-                        getCamelCase(((YangJavaEnumeration) yangType.getDataTypeExtendedInfo()).getName(),
-                                pluginConfig));
+                            getCamelCase(((YangJavaEnumeration) yangType.getDataTypeExtendedInfo()).getName(),
+                                    pluginConfig));
                 case BITS:
                     return YANG_BITS_CLASS;
                 case BINARY:
@@ -215,13 +220,13 @@
                     return BOOLEAN_WRAPPER;
                 case UNION:
                     return getCapitalCase(getCamelCase(((YangJavaUnion) yangType.getDataTypeExtendedInfo()).getName(),
-                        pluginConfig));
+                            pluginConfig));
                 case INSTANCE_IDENTIFIER:
                     //TODO:INSTANCE_IDENTIFIER
                     break;
                 case DERIVED:
-                return getCapitalCase(
-                        getCamelCase(yangType.getDataTypeName(), pluginConfig));
+                    return getCapitalCase(
+                            getCamelCase(yangType.getDataTypeName(), pluginConfig));
                 default:
                     throw new TranslatorException("given data type is not supported.");
             }
@@ -235,8 +240,8 @@
                     return STRING_DATA_TYPE;
                 case ENUMERATION:
                     return getCapitalCase(
-                        getCamelCase(((YangJavaEnumeration) yangType.getDataTypeExtendedInfo()).getName(),
-                                pluginConfig));
+                            getCamelCase(((YangJavaEnumeration) yangType.getDataTypeExtendedInfo()).getName(),
+                                    pluginConfig));
                 case BITS:
                     return YANG_BITS_CLASS;
                 case BINARY:
@@ -251,13 +256,13 @@
                     return BOOLEAN_DATA_TYPE;
                 case UNION:
                     return getCapitalCase(getCamelCase(((YangJavaUnion) yangType.getDataTypeExtendedInfo()).getName(),
-                        pluginConfig));
+                            pluginConfig));
                 case INSTANCE_IDENTIFIER:
                     //TODO:INSTANCE_IDENTIFIER
                     break;
                 case DERIVED:
-                return getCapitalCase(
-                        getCamelCase(yangType.getDataTypeName(), pluginConfig));
+                    return getCapitalCase(
+                            getCamelCase(yangType.getDataTypeName(), pluginConfig));
                 default:
                     return null;
             }
@@ -268,8 +273,8 @@
     /**
      * Returns java import package.
      *
-     * @param yangType YANG type
-     * @param isListAttr if the attribute is of list type
+     * @param yangType         YANG type
+     * @param isListAttr       if the attribute is of list type
      * @param conflictResolver object of YANG to java naming conflict util
      * @return java import package
      */
@@ -352,7 +357,7 @@
     /**
      * Returns java package for typedef node.
      *
-     * @param type YANG type
+     * @param type             YANG type
      * @param conflictResolver object of YANG to java naming conflict util
      * @return java package for typedef node
      */
@@ -376,7 +381,7 @@
     /**
      * Returns java package for union node.
      *
-     * @param type YANG type
+     * @param type             YANG type
      * @param conflictResolver object of YANG to java naming conflict util
      * @return java package for union node
      */
@@ -396,7 +401,7 @@
     /**
      * Returns YANG enumeration's java package.
      *
-     * @param type YANG type
+     * @param type             YANG type
      * @param conflictResolver object of YANG to java naming conflict util
      * @return YANG enumeration's java package
      */
@@ -415,29 +420,87 @@
     /**
      * Returns package from parent node.
      *
-     * @param parent parent YANG node
+     * @param parent           parent YANG node
      * @param conflictResolver object of YANG to java naming conflict util
      * @return java package from parent node
      */
-    private static String getPackageFromParent(YangNode parent, YangToJavaNamingConflictUtil conflictResolver) {
+    private static String getPackageFromParent(YangNode parent,
+            YangToJavaNamingConflictUtil conflictResolver) {
         if (!(parent instanceof JavaFileInfoContainer)) {
             throw new TranslatorException("invalid child node is being processed.");
         }
         JavaFileInfo parentInfo = ((JavaFileInfoContainer) parent).getJavaFileInfo();
         if (parentInfo.getPackage() == null) {
-            if (parent instanceof YangJavaModule) {
-                YangJavaModule module = (YangJavaModule) parent;
-                String modulePkg = getRootPackage(module.getVersion(), module.getNameSpace().getUri(), module
-                        .getRevision().getRevDate(), conflictResolver);
-                return modulePkg + PERIOD + getCamelCase(module.getName(), conflictResolver).toLowerCase();
-            } else if (parent instanceof YangJavaSubModule) {
-                YangJavaSubModule submodule = (YangJavaSubModule) parent;
-                String subModulePkg = getRootPackage(submodule.getVersion(),
-                        submodule.getNameSpaceFromModule(submodule.getBelongsTo()),
-                        submodule.getRevision().getRevDate(), conflictResolver);
-                return subModulePkg + PERIOD + getCamelCase(submodule.getName(), conflictResolver).toLowerCase();
-            }
+            updateJavaFileInfo(parent, conflictResolver);
         }
         return parentInfo.getPackage() + PERIOD + parentInfo.getJavaName().toLowerCase();
     }
+
+    /**
+     * Update the referred data model nodes java file info, this will be called,
+     * when the linked node is yet to translate. Then resolve until the parent hierarchy.
+     *
+     * @param yangNode         node whose java info needs to be updated
+     * @param conflictResolver yang plugin config
+     */
+    public static void updateJavaFileInfo(YangNode yangNode,
+            YangToJavaNamingConflictUtil conflictResolver) {
+        Stack<YangNode> nodesToUpdatePackage = new Stack<YangNode>();
+
+        /*
+         * Add the nodes to be updated for package info in a stack.
+         */
+        while (yangNode != null
+                && ((JavaFileInfoContainer) yangNode)
+                .getJavaFileInfo().getPackage() == null) {
+            nodesToUpdatePackage.push(yangNode);
+            yangNode = yangNode.getParent();
+        }
+
+        /*
+         * If the package is not updated till root node, then root package needs to
+         * be updated.
+         */
+        if (yangNode == null) {
+            yangNode = nodesToUpdatePackage.pop();
+            String pkg;
+            if (yangNode instanceof YangJavaModule) {
+                YangJavaModule module = (YangJavaModule) yangNode;
+                pkg = getRootPackage(module.getVersion(), module.getNameSpace().getUri(), module
+                        .getRevision().getRevDate(), conflictResolver);
+            } else if (yangNode instanceof YangJavaSubModule) {
+                YangJavaSubModule submodule = (YangJavaSubModule) yangNode;
+                pkg = getRootPackage(submodule.getVersion(),
+                        submodule.getNameSpaceFromModule(submodule.getBelongsTo()),
+                        submodule.getRevision().getRevDate(), conflictResolver);
+            } else {
+                throw new TranslatorException("Invalid root node of data model tree");
+            }
+
+            ((JavaCodeGeneratorInfo) yangNode).getJavaFileInfo()
+                    .setJavaName(getCamelCase(yangNode.getName(), conflictResolver));
+            ((JavaCodeGeneratorInfo) yangNode).getJavaFileInfo()
+                    .setPackage(pkg);
+            ((JavaCodeGeneratorInfo) yangNode).getJavaFileInfo()
+                    .setPackageFilePath(getPackageDirPathFromJavaJPackage(
+                            ((JavaCodeGeneratorInfo) yangNode).getJavaFileInfo()
+                                    .getPackage()));
+        }
+
+        /**
+         * Parent of the node in stack is updated with java info,
+         * all the nodes can be popped and updated
+         */
+        while (nodesToUpdatePackage.size() != 0) {
+            yangNode = nodesToUpdatePackage.pop();
+            ((JavaCodeGeneratorInfo) yangNode).getJavaFileInfo()
+                    .setJavaName(getCamelCase(yangNode.getName(), conflictResolver));
+            ((JavaCodeGeneratorInfo) yangNode).getJavaFileInfo()
+                    .setPackage(getCurNodePackage(yangNode));
+            ((JavaCodeGeneratorInfo) yangNode).getJavaFileInfo()
+                    .setPackageFilePath(getPackageDirPathFromJavaJPackage(
+                            ((JavaCodeGeneratorInfo) yangNode).getJavaFileInfo()
+                                    .getPackage()));
+        }
+    }
 }
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaExtendsListHolder.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaExtendsListHolder.java
index 3ee83fd..36986b8 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaExtendsListHolder.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaExtendsListHolder.java
@@ -27,6 +27,7 @@
 import org.onosproject.yangutils.translator.tojava.JavaImportData;
 import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo;
 
+import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCapitalCase;
 import static org.onosproject.yangutils.translator.tojava.utils.TempJavaCodeFragmentFilesUtils.getTempJavaFragement;
 
 /**
@@ -58,7 +59,7 @@
     /**
      * Sets extends list.
      *
-     * @param extendsList list of classes need to be extended
+     * @param extendedClass map of classes need to be extended
      */
     private void setExtendedClassStore(Map<JavaQualifiedTypeInfo, Boolean> extendedClass) {
         this.extendedClassStore = extendedClass;
@@ -73,14 +74,13 @@
     public void addToExtendsList(JavaQualifiedTypeInfo info, YangNode node) {
         JavaFileInfo fileInfo = ((JavaFileInfoContainer) node).getJavaFileInfo();
 
-        if (!fileInfo.getPackage().equals(info.getPkgInfo())) {
-            JavaImportData importData = getTempJavaFragement(node).getJavaImportData();
-            importData.addImportInfo(info);
+        JavaImportData importData = getTempJavaFragement(node).getJavaImportData();
+        boolean qualified = importData.addImportInfo(info,
+                getCapitalCase(fileInfo.getJavaName()), fileInfo.getPackage());
 
             /*true means import should be added*/
-            getExtendedClassStore().put(info, true);
-        }
-        getExtendedClassStore().put(info, false);
+        getExtendedClassStore().put(info, qualified);
+
         addToExtendsList(info);
     }
 
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGeneratorUtils.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGeneratorUtils.java
index 0b951db..0ecc49e 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGeneratorUtils.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGeneratorUtils.java
@@ -83,7 +83,6 @@
 import static org.onosproject.yangutils.utils.UtilConstants.SLASH;
 import static org.onosproject.yangutils.utils.UtilConstants.SPACE;
 import static org.onosproject.yangutils.utils.UtilConstants.TRUE;
-import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.getJavaDoc;
 import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.BUILDER_CLASS;
 import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.BUILDER_INTERFACE;
 import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.ENUM_CLASS;
@@ -94,6 +93,7 @@
 import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.INTERFACE;
 import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.RPC_INTERFACE;
 import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.RPC_MANAGER;
+import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.getJavaDoc;
 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.insertDataIntoJavaFile;
 import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.parsePkg;
 
@@ -111,10 +111,10 @@
     /**
      * Returns a file object for generated file.
      *
-     * @param filePath file package path
-     * @param fileName file name
+     * @param fileName  file name
+     * @param filePath  file package path
      * @param extension file extension
-     * @param handle cached file handle
+     * @param handle    cached file handle
      * @return file object
      */
     public static File getFileObject(String filePath, String fileName, String extension, JavaFileInfo handle) {
@@ -125,7 +125,7 @@
     /**
      * Returns data stored in temporary files.
      *
-     * @param generatedTempFiles temporary file types
+     * @param generatedTempFiles    temporary file types
      * @param tempJavaFragmentFiles temp java fragment files
      * @return data stored in temporary files
      * @throws IOException when failed to get the data from temporary file handle
@@ -253,11 +253,11 @@
     /**
      * Initiates generation of file based on generated file type.
      *
-     * @param file generated file
-     * @param className generated file class name
-     * @param genType generated file type
-     * @param imports imports for the file
-     * @param pkg generated file package
+     * @param file         generated file
+     * @param className    generated file class name
+     * @param genType      generated file type
+     * @param imports      imports for the file
+     * @param pkg          generated file package
      * @param pluginConfig plugin configurations
      * @throws IOException when fails to generate a file
      */
@@ -276,17 +276,22 @@
     /**
      * Initiates generation of file based on generated file type.
      *
-     * @param file generated file
-     * @param genType generated file type
-     * @param imports imports for the file
-     * @param curNode current YANG node
+     * @param file      generated file
+     * @param genType   generated file type
+     * @param imports   imports for the file
+     * @param curNode   current YANG node
      * @param className class name
      * @throws IOException when fails to generate a file
      */
     public static void initiateJavaFileGeneration(File file, int genType, List<String> imports,
-            YangNode curNode, String className) throws IOException {
+            YangNode curNode, String className)
+            throws IOException {
 
         try {
+            if (file.exists()) {
+                throw new IOException(file.getName() + " is reused due to YANG naming");
+            }
+
             file.createNewFile();
             appendContents(file, genType, imports, curNode, className);
         } catch (IOException e) {
@@ -297,15 +302,16 @@
     /**
      * Appends all the contents into a generated java file.
      *
-     * @param file generated file
-     * @param genType generated file type
+     * @param file        generated file
+     * @param genType     generated file type
      * @param importsList list of java imports
-     * @param curNode current YANG node
-     * @param className class name
+     * @param curNode     current YANG node
+     * @param className   class name
      * @throws IOException
      */
     private static void appendContents(File file, int genType, List<String> importsList, YangNode curNode,
-            String className) throws IOException {
+            String className)
+            throws IOException {
 
         JavaFileInfo javaFileInfo = ((JavaFileInfoContainer) curNode).getJavaFileInfo();
 
@@ -321,39 +327,39 @@
             pkgString = parsePackageString(path, importsList);
         }
         switch (genType) {
-        case INTERFACE_MASK:
-            appendHeaderContents(file, pkgString, importsList);
-            write(file, genType, INTERFACE, curNode, className);
-            break;
-        case GENERATE_SERVICE_AND_MANAGER:
-            appendHeaderContents(file, pkgString, importsList);
-            write(file, genType, RPC_INTERFACE, curNode, className);
-            break;
-        case GENERATE_EVENT_CLASS:
-            appendHeaderContents(file, pkgString, importsList);
-            write(file, genType, EVENT, curNode, className);
-            break;
-        case GENERATE_EVENT_LISTENER_INTERFACE:
-            appendHeaderContents(file, pkgString, importsList);
-            write(file, genType, EVENT_LISTENER, curNode, className);
-            break;
-        case GENERATE_EVENT_SUBJECT_CLASS:
-            appendHeaderContents(file, pkgString, importsList);
-            write(file, genType, EVENT_SUBJECT_CLASS, curNode, className);
-            break;
-        default:
-            break;
+            case INTERFACE_MASK:
+                appendHeaderContents(file, pkgString, importsList);
+                write(file, genType, INTERFACE, curNode, className);
+                break;
+            case GENERATE_SERVICE_AND_MANAGER:
+                appendHeaderContents(file, pkgString, importsList);
+                write(file, genType, RPC_INTERFACE, curNode, className);
+                break;
+            case GENERATE_EVENT_CLASS:
+                appendHeaderContents(file, pkgString, importsList);
+                write(file, genType, EVENT, curNode, className);
+                break;
+            case GENERATE_EVENT_LISTENER_INTERFACE:
+                appendHeaderContents(file, pkgString, importsList);
+                write(file, genType, EVENT_LISTENER, curNode, className);
+                break;
+            case GENERATE_EVENT_SUBJECT_CLASS:
+                appendHeaderContents(file, pkgString, importsList);
+                write(file, genType, EVENT_SUBJECT_CLASS, curNode, className);
+                break;
+            default:
+                break;
         }
     }
 
     /**
      * Appends all the contents into a generated java file.
      *
-     * @param file generated file
-     * @param fileName generated file name
-     * @param genType generated file type
-     * @param importsList list of java imports
-     * @param pkg generated file package
+     * @param file         generated file
+     * @param fileName     generated file name
+     * @param genType      generated file type
+     * @param importsList  list of java imports
+     * @param pkg          generated file package
      * @param pluginConfig plugin configurations
      * @throws IOException when fails to append contents
      */
@@ -364,37 +370,37 @@
         String pkgString = parsePackageString(pkg, importsList);
 
         switch (genType) {
-        case IMPL_CLASS_MASK:
-            write(file, fileName, genType, IMPL_CLASS, pluginConfig);
-            break;
-        case BUILDER_INTERFACE_MASK:
-            write(file, fileName, genType, BUILDER_INTERFACE, pluginConfig);
-            break;
-        case GENERATE_TYPEDEF_CLASS:
-            appendHeaderContents(file, pkgString, importsList);
-            write(file, fileName, genType, IMPL_CLASS, pluginConfig);
-            break;
-        case BUILDER_CLASS_MASK:
-            appendHeaderContents(file, pkgString, importsList);
-            write(file, fileName, genType, BUILDER_CLASS, pluginConfig);
-            break;
-        case GENERATE_UNION_CLASS:
-            appendHeaderContents(file, pkgString, importsList);
-            write(file, fileName, genType, IMPL_CLASS, pluginConfig);
-            break;
-        case GENERATE_ENUM_CLASS:
-            appendHeaderContents(file, pkgString, importsList);
-            write(file, fileName, genType, ENUM_CLASS, pluginConfig);
-            break;
-        default:
-            break;
+            case IMPL_CLASS_MASK:
+                write(file, fileName, genType, IMPL_CLASS, pluginConfig);
+                break;
+            case BUILDER_INTERFACE_MASK:
+                write(file, fileName, genType, BUILDER_INTERFACE, pluginConfig);
+                break;
+            case GENERATE_TYPEDEF_CLASS:
+                appendHeaderContents(file, pkgString, importsList);
+                write(file, fileName, genType, IMPL_CLASS, pluginConfig);
+                break;
+            case BUILDER_CLASS_MASK:
+                appendHeaderContents(file, pkgString, importsList);
+                write(file, fileName, genType, BUILDER_CLASS, pluginConfig);
+                break;
+            case GENERATE_UNION_CLASS:
+                appendHeaderContents(file, pkgString, importsList);
+                write(file, fileName, genType, IMPL_CLASS, pluginConfig);
+                break;
+            case GENERATE_ENUM_CLASS:
+                appendHeaderContents(file, pkgString, importsList);
+                write(file, fileName, genType, ENUM_CLASS, pluginConfig);
+                break;
+            default:
+                break;
         }
     }
 
     /**
      * Removes base directory path from package and generates package string for file.
      *
-     * @param javaPkg generated java package
+     * @param javaPkg     generated java package
      * @param importsList list of imports
      * @return package string
      */
@@ -416,8 +422,8 @@
      * Appends other contents to interface, builder and typedef classes.
      * for example : ONOS copyright, imports and package.
      *
-     * @param file generated file
-     * @param pkg generated package
+     * @param file        generated file
+     * @param pkg         generated package
      * @param importsList list of imports
      * @throws IOException when fails to append contents
      */
@@ -443,11 +449,11 @@
     /**
      * Writes data to the specific generated file.
      *
-     * @param file generated file
-     * @param genType generated file type
+     * @param file        generated file
+     * @param genType     generated file type
      * @param javaDocType java doc type
-     * @param curNode current YANG node
-     * @param fileName file name
+     * @param curNode     current YANG node
+     * @param fileName    file name
      * @throws IOException when fails to write into a file
      */
     private static void write(File file, int genType, JavaDocType javaDocType, YangNode curNode, String fileName)
@@ -470,10 +476,10 @@
     /**
      * Writes data to the specific generated file.
      *
-     * @param file generated file
-     * @param fileName file name
-     * @param genType generated file type
-     * @param javaDocType java doc type
+     * @param file         generated file
+     * @param fileName     file name
+     * @param genType      generated file type
+     * @param javaDocType  java doc type
      * @param pluginConfig plugin configurations
      * @throws IOException
      */
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/TempJavaCodeFragmentFilesUtils.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/TempJavaCodeFragmentFilesUtils.java
index 617ac99..f70ec53 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/TempJavaCodeFragmentFilesUtils.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/TempJavaCodeFragmentFilesUtils.java
@@ -29,12 +29,7 @@
 import org.onosproject.yangutils.translator.tojava.TempJavaCodeFragmentFilesContainer;
 import org.onosproject.yangutils.translator.tojava.TempJavaFragmentFiles;
 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaAugment;
-import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaInput;
 import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaModule;
-import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaOutput;
-import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaSubModule;
-
-import static java.util.Collections.sort;
 
 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCapitalCase;
 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getSmallCase;
@@ -69,6 +64,8 @@
 import static org.onosproject.yangutils.utils.UtilConstants.TYPE;
 import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.updateFileHandle;
 
+import static java.util.Collections.sort;
+
 /**
  * Represents utilities for temporary java code fragments.
  */
@@ -83,8 +80,8 @@
     /**
      * Adds import for AugmentationHolders class.
      *
-     * @param curNode current YANG node
-     * @param imports list of imports
+     * @param curNode   current YANG node
+     * @param imports   list of imports
      * @param operation add or delete import
      */
     public static void addAugmentationHoldersImport(YangNode curNode, List<String> imports, boolean operation) {
@@ -95,8 +92,8 @@
     /**
      * Adds import for AugmentedInfo class.
      *
-     * @param curNode current YANG node
-     * @param imports list of imports
+     * @param curNode   current YANG node
+     * @param imports   list of imports
      * @param operation add or delete import
      */
     public static void addAugmentedInfoImport(YangNode curNode, List<String> imports, boolean operation) {
@@ -126,8 +123,8 @@
     /**
      * Updated imports with augmented nodes import.
      *
-     * @param curNode current YANG node
-     * @param imports list of imports
+     * @param curNode   current YANG node
+     * @param imports   list of imports
      * @param operation to add or to delete
      */
     public static void addAugmentedNodesImport(YangNode curNode, List<String> imports, boolean operation) {
@@ -156,7 +153,7 @@
     /**
      * Returns imports for augmented node.
      *
-     * @param parent parent YANG node
+     * @param parent      parent YANG node
      * @param targetNodes list of target nodes
      * @param isImplClass if impl class's import required
      * @return imports for augmented node
@@ -204,8 +201,8 @@
     /**
      * Adds import for array list.
      *
-     * @param curNode current YANG node
-     * @param imports list of imports
+     * @param curNode   current YANG node
+     * @param imports   list of imports
      * @param operation add or delete import
      */
     public static void addArrayListImport(YangNode curNode, List<String> imports, boolean operation) {
@@ -224,8 +221,8 @@
     /**
      * Adds listener's imports.
      *
-     * @param curNode currentYangNode.
-     * @param imports import list
+     * @param curNode   currentYangNode.
+     * @param imports   import list
      * @param operation add or remove
      * @param classInfo class info to be added to import list
      */
@@ -244,7 +241,7 @@
     /**
      * Adds annotations imports.
      *
-     * @param imports list if imports
+     * @param imports   list if imports
      * @param operation to add or to delete
      */
     public static void addAnnotationsImports(List<String> imports, boolean operation) {
@@ -269,7 +266,7 @@
     /**
      * Performs given operations on import list.
      *
-     * @param imports list of imports
+     * @param imports   list of imports
      * @param curImport current import
      * @param operation add or remove
      * @return import list
@@ -314,7 +311,7 @@
     /**
      * Closes the file handle for temporary file.
      *
-     * @param file file to be closed
+     * @param file        file to be closed
      * @param toBeDeleted flag to indicate if file needs to be deleted
      * @throws IOException when failed to close the file handle
      */
@@ -330,33 +327,6 @@
     }
 
     /**
-     * Detects collision between parent and child node which have same name.
-     * When parent and child node both have the same name in that case child node should be used with
-     * qualified name.
-     *
-     * @param curNode current YANG node
-     * @param qualifiedTypeInfo current node's qualified info
-     * @return true if collision is detected
-     */
-    public static boolean detectCollisionBwParentAndChildForImport(YangNode curNode,
-            JavaQualifiedTypeInfo qualifiedTypeInfo) {
-
-        YangNode parent = curNode.getParent();
-        if (parent instanceof YangJavaModule
-                || parent instanceof YangJavaSubModule
-                || parent instanceof YangJavaInput
-                || parent instanceof YangJavaOutput) {
-            return false;
-        }
-        String parentsClassInfo = getCapitalCase(((JavaFileInfoContainer) parent).getJavaFileInfo().getJavaName());
-        String childsClassInfo = qualifiedTypeInfo.getClassInfo();
-        if (childsClassInfo.equals(parentsClassInfo)) {
-            return true;
-        }
-        return false;
-    }
-
-    /**
      * Returns sorted import list.
      *
      * @param imports import list
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/YangJavaModelUtils.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/YangJavaModelUtils.java
index 8e02082..3f378c7 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/YangJavaModelUtils.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/translator/tojava/utils/YangJavaModelUtils.java
@@ -19,8 +19,6 @@
 import java.io.IOException;
 
 import org.onosproject.yangutils.datamodel.RpcNotificationContainer;
-import org.onosproject.yangutils.datamodel.YangAugment;
-import org.onosproject.yangutils.datamodel.YangAugmentationHolder;
 import org.onosproject.yangutils.datamodel.YangCase;
 import org.onosproject.yangutils.datamodel.YangChoice;
 import org.onosproject.yangutils.datamodel.YangLeavesHolder;
@@ -45,9 +43,6 @@
 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCapitalCase;
 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCurNodePackage;
 import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getPackageDirPathFromJavaJPackage;
-import static org.onosproject.yangutils.utils.UtilConstants.AUGMENTATION_HOLDER;
-import static org.onosproject.yangutils.utils.UtilConstants.AUGMENTED_INFO;
-import static org.onosproject.yangutils.utils.UtilConstants.PROVIDED_AUGMENTATION_CLASS_IMPORT_PKG;
 
 /**
  * Represents utility class for YANG java model.
@@ -64,7 +59,7 @@
      * Updates YANG java file package information.
      *
      * @param javaCodeGeneratorInfo YANG java file info node
-     * @param yangPluginConfig YANG plugin config
+     * @param yangPluginConfig      YANG plugin config
      * @throws IOException IO operations fails
      */
     public static void updatePackageInfo(JavaCodeGeneratorInfo javaCodeGeneratorInfo,
@@ -85,7 +80,7 @@
      * Updates YANG java file package information for specified package.
      *
      * @param javaCodeGeneratorInfo YANG java file info node
-     * @param yangPlugin YANG plugin config
+     * @param yangPlugin            YANG plugin config
      * @throws IOException IO operations fails
      */
     private static void updatePackageInfo(JavaCodeGeneratorInfo javaCodeGeneratorInfo, YangPluginConfig yangPlugin,
@@ -128,7 +123,7 @@
              */
             javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles()
                     .getServiceTempFiles().addCurNodeLeavesInfoToTempFiles(
-                            (YangNode) javaCodeGeneratorInfo, yangPluginConfig);
+                    (YangNode) javaCodeGeneratorInfo, yangPluginConfig);
             if ((YangNode) javaCodeGeneratorInfo instanceof YangJavaModule) {
                 if (!((YangJavaModule) javaCodeGeneratorInfo).getNotificationNodes().isEmpty()) {
                     updateNotificaitonNodeInfo(javaCodeGeneratorInfo, yangPluginConfig);
@@ -151,7 +146,7 @@
              */
             javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles()
                     .getBeanTempFiles().addCurNodeLeavesInfoToTempFiles(
-                            (YangNode) javaCodeGeneratorInfo, yangPluginConfig);
+                    (YangNode) javaCodeGeneratorInfo, yangPluginConfig);
         } else if (javaCodeGeneratorInfo instanceof YangTypeHolder) {
             /*
              * Typedef
@@ -194,11 +189,12 @@
      * Updates notification node info in service temporary file.
      *
      * @param javaCodeGeneratorInfo java code generator info
-     * @param yangPluginConfig plugin configurations
+     * @param yangPluginConfig      plugin configurations
      * @throws IOException when fails to do IO operations
      */
     private static void updateNotificaitonNodeInfo(JavaCodeGeneratorInfo javaCodeGeneratorInfo,
-            YangPluginConfig yangPluginConfig) throws IOException {
+            YangPluginConfig yangPluginConfig)
+            throws IOException {
         if ((YangNode) javaCodeGeneratorInfo instanceof YangJavaModule) {
             for (YangNode notificaiton : ((YangJavaModule) javaCodeGeneratorInfo).getNotificationNodes()) {
                 javaCodeGeneratorInfo.getTempJavaCodeFragmentFiles()
@@ -220,8 +216,8 @@
      * Generates code for the current ata model node and adds itself as an attribute in the parent.
      *
      * @param javaCodeGeneratorInfo YANG java file info node
-     * @param yangPlugin YANG plugin config
-     * @param isMultiInstance flag to indicate whether it's a list
+     * @param yangPlugin            YANG plugin config
+     * @param isMultiInstance       flag to indicate whether it's a list
      * @throws IOException IO operations fails
      */
     public static void generateCodeAndUpdateInParent(JavaCodeGeneratorInfo javaCodeGeneratorInfo,
@@ -246,7 +242,7 @@
      * Generates code for the current data model node and adds support for it to be augmented.
      *
      * @param javaCodeGeneratorInfo YANG java file info node
-     * @param yangPlugin YANG plugin config
+     * @param yangPlugin            YANG plugin config
      * @throws IOException IO operations fails
      */
     public static void generateCodeOfAugmentableNode(JavaCodeGeneratorInfo javaCodeGeneratorInfo,
@@ -259,8 +255,9 @@
         generateCodeOfNode(javaCodeGeneratorInfo, yangPlugin);
 
         /*
+        TODO: Need to use this, when augmentation is added in YMS
          * For augmentation of nodes.
-         */
+
         if (javaCodeGeneratorInfo instanceof YangAugmentationHolder) {
             JavaQualifiedTypeInfo augmentationHoldersInfo = new JavaQualifiedTypeInfo();
             augmentationHoldersInfo.setClassInfo(AUGMENTATION_HOLDER);
@@ -276,7 +273,7 @@
                     .addToExtendsList(augmentedInfo, (YangNode) javaCodeGeneratorInfo);
 
         }
-
+        */
         if (javaCodeGeneratorInfo instanceof YangCase) {
             YangNode parent = ((YangCase) javaCodeGeneratorInfo).getParent();
             JavaQualifiedTypeInfo parentsInfo = new JavaQualifiedTypeInfo();
@@ -297,7 +294,7 @@
      * Generates code for the current data model node.
      *
      * @param javaCodeGeneratorInfo YANG java file info node
-     * @param yangPluginConfig YANG plugin config
+     * @param yangPluginConfig      YANG plugin config
      * @throws IOException IO operations fails
      */
     public static void generateCodeOfNode(JavaCodeGeneratorInfo javaCodeGeneratorInfo,
@@ -314,8 +311,8 @@
      * Generates code for the root module/sub-module node.
      *
      * @param javaCodeGeneratorInfo YANG java file info node
-     * @param yangPluginConfig YANG plugin config
-     * @param rootPkg package of the root node
+     * @param yangPluginConfig      YANG plugin config
+     * @param rootPkg               package of the root node
      * @throws IOException IO operations fails
      */
     public static void generateCodeOfRootNode(JavaCodeGeneratorInfo javaCodeGeneratorInfo,
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/utils/UtilConstants.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/utils/UtilConstants.java
index 7e89998..adc7015 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/utils/UtilConstants.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/utils/UtilConstants.java
@@ -966,6 +966,7 @@
      * Static attribute for augmentable.
      */
     public static final String AUGMENTABLE = "Augmentable";
+
     /**
      * Static attribute for list.
      */
@@ -1018,6 +1019,11 @@
     public static final String COMPONENT_ANNOTATION = "@Component";
 
     /**
+     * Static attribute for component.
+     */
+    public static final String COMPONENT = "Component";
+
+    /**
      * Static attribute for immediate.
      */
     public static final String IMMEDIATE = "immediate";
@@ -1134,6 +1140,16 @@
             + "grouping for given uses";
 
     /**
+     * Static attribute for reference.
+     */
+    public static final String REFERENCE = "Reference";
+
+    /**
+     * Static attribute for ReferenceCardinality.
+     */
+    public static final String REFERENCE_CARDINALITY = "ReferenceCardinality";
+
+    /**
      * Creates an instance of util constants.
      */
     private UtilConstants() {
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/utils/io/impl/YangIoUtils.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/utils/io/impl/YangIoUtils.java
index 7120612..47e95c3 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/utils/io/impl/YangIoUtils.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/utils/io/impl/YangIoUtils.java
@@ -56,8 +56,8 @@
 import static org.onosproject.yangutils.utils.UtilConstants.YANG_RESOURCES;
 import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.appendFileContents;
 import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.updateFileHandle;
-import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.getJavaDoc;
 import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.PACKAGE_INFO;
+import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.getJavaDoc;
 import static org.slf4j.LoggerFactory.getLogger;
 
 /**
@@ -67,7 +67,7 @@
 
     private static final Logger log = getLogger(YangIoUtils.class);
     private static final String TARGET_RESOURCE_PATH = SLASH + TEMP + SLASH + YANG_RESOURCES + SLASH;
-    private static final int LINE_SIZE = 116;
+    private static final int LINE_SIZE = 118;
     private static final int SUB_LINE_SIZE = 112;
     private static final int ZERO = 0;
 
@@ -92,10 +92,10 @@
     /**
      * Adds package info file for the created directory.
      *
-     * @param path directory path
-     * @param classInfo class info for the package
-     * @param pack package of the directory
-     * @param isChildNode is it a child node
+     * @param path         directory path
+     * @param classInfo    class info for the package
+     * @param pack         package of the directory
+     * @param isChildNode  is it a child node
      * @param pluginConfig plugin configurations
      * @throws IOException when fails to create package info file
      */
@@ -159,7 +159,8 @@
      * @param dir generated directory in previous build
      * @throws IOException when failed to delete directory
      */
-    public static void deleteDirectory(String dir) throws IOException {
+    public static void deleteDirectory(String dir)
+            throws IOException {
         File generatedDirectory = new File(dir);
         if (generatedDirectory.exists()) {
             try {
@@ -177,7 +178,8 @@
      * @param root root directory
      * @throws IOException when fails to do IO operations.
      */
-    public static void searchAndDeleteTempDir(String root) throws IOException {
+    public static void searchAndDeleteTempDir(String root)
+            throws IOException {
         List<File> store = new LinkedList<>();
         Stack<String> stack = new Stack<>();
         stack.push(root);
@@ -207,7 +209,7 @@
     /**
      * Adds generated source directory to the compilation root.
      *
-     * @param source directory
+     * @param source  directory
      * @param project current maven project
      * @param context current build context
      */
@@ -220,7 +222,7 @@
     /**
      * Removes extra char from the string.
      *
-     * @param valueString string to be trimmed
+     * @param valueString    string to be trimmed
      * @param removealStirng extra chars
      * @return new string
      */
@@ -255,8 +257,8 @@
      * Returns the directory path of the package in canonical form.
      *
      * @param baseCodeGenPath base path where the generated files needs to be
-     *            put
-     * @param pathOfJavaPkg java package of the file being generated
+     *                        put
+     * @param pathOfJavaPkg   java package of the file being generated
      * @return absolute path of the package in canonical form
      */
     public static String getDirectory(String baseCodeGenPath, String pathOfJavaPkg) {
@@ -276,8 +278,8 @@
      * Returns the absolute path of the package in canonical form.
      *
      * @param baseCodeGenPath base path where the generated files needs to be
-     *            put
-     * @param pathOfJavaPkg java package of the file being generated
+     *                        put
+     * @param pathOfJavaPkg   java package of the file being generated
      * @return absolute path of the package in canonical form
      */
     public static String getAbsolutePackagePath(String baseCodeGenPath, String pathOfJavaPkg) {
@@ -288,8 +290,8 @@
      * Copies YANG files to the current project's output directory.
      *
      * @param yangFileInfo list of YANG files
-     * @param outputDir project's output directory
-     * @param project maven project
+     * @param outputDir    project's output directory
+     * @param project      maven project
      * @throws IOException when fails to copy files to destination resource directory
      */
     public static void copyYangFilesToTarget(Set<YangFileInfo> yangFileInfo, String outputDir, MavenProject project)
@@ -334,7 +336,8 @@
      * @param srcFile    main file
      * @throws IOException when fails to append contents
      */
-    public static void mergeJavaFiles(File appendFile, File srcFile) throws IOException {
+    public static void mergeJavaFiles(File appendFile, File srcFile)
+            throws IOException {
         try {
             appendFileContents(appendFile, srcFile);
         } catch (IOException e) {
@@ -349,7 +352,8 @@
      * @param data data which need to be inserted
      * @throws IOException when fails to insert into file
      */
-    public static void insertDataIntoJavaFile(File file, String data) throws IOException {
+    public static void insertDataIntoJavaFile(File file, String data)
+            throws IOException {
         try {
             updateFileHandle(file, data, false);
         } catch (IOException e) {
@@ -365,7 +369,8 @@
      * @return updated file
      * @throws IOException when fails to do IO operations.
      */
-    public static File validateLineLength(File dataFile) throws IOException {
+    public static File validateLineLength(File dataFile)
+            throws IOException {
         File tempFile = dataFile;
         FileReader fileReader = new FileReader(dataFile);
         BufferedReader bufferReader = new BufferedReader(fileReader);
