diff --git a/src/main/java/org/onosproject/yangutils/datamodel/YangContainer.java b/src/main/java/org/onosproject/yangutils/datamodel/YangContainer.java
index d251479..edd23b7 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/YangContainer.java
+++ b/src/main/java/org/onosproject/yangutils/datamodel/YangContainer.java
@@ -487,8 +487,9 @@
         CachedFileHandle handle = null;
         try {
             FileSystemUtil.createPackage(UtilConstants.YANG_GEN_DIR + getPackage(), getName());
-            handle = FileSystemUtil.createSourceFiles(getPackage(), getName(), GeneratedFileType.ALL);
-            handle.setFilePath(UtilConstants.YANG_GEN_DIR + getPackage().replace(".", "/"));
+            handle = FileSystemUtil.createSourceFiles(getPackage(), getName(),
+                    GeneratedFileType.GENERATE_INTERFACE_WITH_BUILDER);
+            handle.setRelativeFilePath(UtilConstants.YANG_GEN_DIR + getPackage().replace(".", "/"));
         } catch (IOException e) {
             throw new IOException("Failed to create the source files.");
         }
@@ -504,7 +505,6 @@
      */
     private void addAttributeInParent() {
         if (getParent() != null) {
-            getParent().getFileHandle().setChildsPackage(getPackage());
             getParent().getFileHandle().addAttributeInfo(null, getName(), false);
         }
     }
diff --git a/src/main/java/org/onosproject/yangutils/datamodel/YangDerivedType.java b/src/main/java/org/onosproject/yangutils/datamodel/YangDerivedType.java
index 8c9628c..e235480 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/YangDerivedType.java
+++ b/src/main/java/org/onosproject/yangutils/datamodel/YangDerivedType.java
@@ -1,16 +1,19 @@
-/*Copyright 2016.year Open Networking Laboratory
+/*
+ * Copyright 2016 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.
+ */
 
-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.datamodel;
 
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
@@ -18,6 +21,8 @@
 import org.onosproject.yangutils.utils.YangConstructType;
 
 /*-
+ * Reference RFC 6020.
+ *
  * The typedef Statement
  *
  * The "typedef" statement defines a new type that may be used locally
diff --git a/src/main/java/org/onosproject/yangutils/datamodel/YangList.java b/src/main/java/org/onosproject/yangutils/datamodel/YangList.java
index c0b569b..4903034 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/YangList.java
+++ b/src/main/java/org/onosproject/yangutils/datamodel/YangList.java
@@ -123,6 +123,8 @@
     private List<YangLeafList> listOfLeafList;
 
     /**
+     * Reference RFC 6020.
+     *
      * The "max-elements" statement, which is optional, takes as an argument a
      * positive integer or the string "unbounded", which puts a constraint on
      * valid list entries. A valid leaf-list or list always has at most
@@ -130,9 +132,11 @@
      *
      * If no "max-elements" statement is present, it defaults to "unbounded".
      */
-    private int maxElelements = Integer.MAX_VALUE;
+    private int maxElements = Integer.MAX_VALUE;
 
     /**
+     * Reference RFC 6020.
+     *
      * The "min-elements" statement, which is optional, takes as an argument a
      * non-negative integer that puts a constraint on valid list entries. A
      * valid leaf-list or list MUST have at least min-elements entries.
@@ -162,17 +166,15 @@
     private YangStatusType status = YangStatusType.CURRENT;
 
     /**
-     * package of the generated java code.
+     * Package of the generated java code.
      */
     private String pkg;
 
     /**
      * Constructor.
-     *
-     * @param type list node
      */
-    public YangList(YangNodeType type) {
-        super(type);
+    public YangList() {
+        super(YangNodeType.LIST_NODE);
     }
 
     /**
@@ -341,17 +343,17 @@
      *
      * @return the max elements
      */
-    public int getMaxElelements() {
-        return maxElelements;
+    public int getMaxElements() {
+        return maxElements;
     }
 
     /**
      * Set the max elements.
      *
-     * @param maxElelements the max elements
+     * @param max the max elements
      */
-    public void setMaxElelements(int maxElelements) {
-        this.maxElelements = maxElelements;
+    public void setMaxElements(int max) {
+        maxElements = max;
     }
 
     /**
@@ -447,8 +449,8 @@
         validateConfig(leaves, leafLists);
 
         /* A list must have atleast one key leaf if config is true */
-        if ((isConfig)
-                && ((keys == null) || ((leaves == null) && (leafLists == null)))) {
+        if (isConfig
+                && (keys == null || leaves == null && leafLists == null)) {
             throw new DataModelException("A list must have atleast one key leaf if config is true;");
         } else if (keys != null) {
             if (leaves != null) {
@@ -508,7 +510,7 @@
          * If a node has "config" set to "false", no node underneath it can have
          * "config" set to "true".
          */
-        if ((!isConfig) && (leaves != null)) {
+        if (!isConfig && leaves != null) {
             for (YangLeaf leaf : leaves) {
                 if (leaf.isConfig()) {
                     throw new DataModelException("If a list has \"config\" set to \"false\", no node underneath " +
@@ -517,7 +519,7 @@
             }
         }
 
-        if ((!isConfig) && (leafLists != null)) {
+        if (!isConfig && leafLists != null) {
             for (YangLeafList leafList : leafLists) {
                 if (leafList.isConfig()) {
                     throw new DataModelException("If a list has \"config\" set to \"false\", no node underneath " +
diff --git a/src/main/java/org/onosproject/yangutils/datamodel/YangModule.java b/src/main/java/org/onosproject/yangutils/datamodel/YangModule.java
index e56bdab..95bee5f 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/YangModule.java
+++ b/src/main/java/org/onosproject/yangutils/datamodel/YangModule.java
@@ -158,16 +158,13 @@
     private byte version;
 
     /**
-     * Package of the generated java code.
-     */
-    private String pkg;
-
-    /**
      * Cached Java File Handle.
      */
     private CachedFileHandle fileHandle;
 
     /*-
+     * Reference RFC 6020.
+     *
      * Nested typedefs and groupings.
      * Typedefs and groupings may appear nested under many YANG statements,
      * allowing these to be lexically scoped by the hierarchy under which
@@ -519,7 +516,10 @@
      */
     @Override
     public String getPackage() {
-        return pkg;
+        if (getFileHandle() != null) {
+            return getFileHandle().getRelativeFilePath().replace("/", ".");
+        }
+        return null;
     }
 
     /**
@@ -529,7 +529,10 @@
      */
     @Override
     public void setPackage(String pcg) {
-        pkg = pcg;
+        if (getFileHandle() != null) {
+            pcg.replace(".", "/");
+            getFileHandle().setRelativeFilePath(pcg);
+        }
     }
 
     /**
@@ -628,16 +631,16 @@
     public void generateJavaCodeEntry() throws IOException {
         String modPkg = JavaIdentifierSyntax.getRootPackage(getVersion(), getNameSpace().getUri(),
                 getRevision().getRevDate());
-        setPackage(modPkg);
 
         CachedFileHandle handle = null;
         try {
-            FileSystemUtil.createPackage(UtilConstants.YANG_GEN_DIR + getPackage(), getName());
-            handle = FileSystemUtil.createSourceFiles(getPackage(), getName(), GeneratedFileType.ALL);
-            handle.setFilePath(UtilConstants.YANG_GEN_DIR + getPackage().replace(".", "/"));
+            FileSystemUtil.createPackage(UtilConstants.YANG_GEN_DIR + modPkg, getName());
+            handle = FileSystemUtil.createSourceFiles(modPkg, getName(),
+                    GeneratedFileType.GENERATE_INTERFACE_WITH_BUILDER);
         } catch (IOException e) {
             throw new IOException("Failed to create the source files.");
         }
+
         setFileHandle(handle);
         addLeavesAttributes();
         addLeafListAttributes();
diff --git a/src/main/java/org/onosproject/yangutils/datamodel/YangPatternRestriction.java b/src/main/java/org/onosproject/yangutils/datamodel/YangPatternRestriction.java
index a229b9c..b06955e 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/YangPatternRestriction.java
+++ b/src/main/java/org/onosproject/yangutils/datamodel/YangPatternRestriction.java
@@ -1,16 +1,19 @@
-/*Copyright 2016.year Open Networking Laboratory
+/*
+ * Copyright 2016 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.
+ */
 
-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.datamodel;
 
 import java.util.LinkedList;
diff --git a/src/main/java/org/onosproject/yangutils/datamodel/YangRangeRestriction.java b/src/main/java/org/onosproject/yangutils/datamodel/YangRangeRestriction.java
index 88fdb42..aab79ed 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/YangRangeRestriction.java
+++ b/src/main/java/org/onosproject/yangutils/datamodel/YangRangeRestriction.java
@@ -1,16 +1,19 @@
-/*Copyright 2016.year Open Networking Laboratory
+/*
+ * Copyright 2016 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.
+ */
 
-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.datamodel;
 
 import java.util.LinkedList;
diff --git a/src/main/java/org/onosproject/yangutils/datamodel/YangStringRestriction.java b/src/main/java/org/onosproject/yangutils/datamodel/YangStringRestriction.java
index d2b6462..a583457 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/YangStringRestriction.java
+++ b/src/main/java/org/onosproject/yangutils/datamodel/YangStringRestriction.java
@@ -1,16 +1,19 @@
-/*Copyright 2016.year Open Networking Laboratory
+/*
+ * Copyright 2016 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.
+ */
 
-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.datamodel;
 
 import java.math.BigInteger;
diff --git a/src/main/java/org/onosproject/yangutils/datamodel/YangTypeDef.java b/src/main/java/org/onosproject/yangutils/datamodel/YangTypeDef.java
index a1abd8b..b1feb31 100644
--- a/src/main/java/org/onosproject/yangutils/datamodel/YangTypeDef.java
+++ b/src/main/java/org/onosproject/yangutils/datamodel/YangTypeDef.java
@@ -17,8 +17,8 @@
 
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
 import org.onosproject.yangutils.parser.Parsable;
-import org.onosproject.yangutils.utils.YangConstructType;
 import org.onosproject.yangutils.translator.CachedFileHandle;
+import org.onosproject.yangutils.utils.YangConstructType;
 
 /*-
  * Reference RFC 6020.
@@ -54,7 +54,6 @@
  */
 public class YangTypeDef extends YangNode implements YangCommonInfo, Parsable {
 
-
     /**
      * Default value in string, needs to be converted to the target object,
      * based on the type.
@@ -98,8 +97,6 @@
         super(YangNodeType.TYPEDEF_NODE);
     }
 
-
-
     /**
      * Get the default value.
      *
@@ -245,8 +242,8 @@
         if (type == null) {
             throw new DataModelException("Typedef does not have type info.");
         }
-        if ((type.getDataType() != YangDataTypes.DERIVED)
-                || (type.getDataTypeName() == null)) {
+        if (type.getDataType() != YangDataTypes.DERIVED
+                || type.getDataTypeName() == null) {
             throw new DataModelException("Typedef type is not derived.");
         }
 
diff --git a/src/main/java/org/onosproject/yangutils/parser/impl/YangUtilsParserManager.java b/src/main/java/org/onosproject/yangutils/parser/impl/YangUtilsParserManager.java
index b0b5edc..673736c 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/YangUtilsParserManager.java
+++ b/src/main/java/org/onosproject/yangutils/parser/impl/YangUtilsParserManager.java
@@ -36,8 +36,6 @@
  */
 public class YangUtilsParserManager implements YangUtilsParser {
 
-    public static final int SUB_STATEMENT_CARDINALITY = 1;
-
     @Override
     public YangNode getDataModel(String yangFile) throws IOException, ParserException {
 
diff --git a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BitsListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BitsListener.java
index c0c302f..9e5d583 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BitsListener.java
+++ b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BitsListener.java
@@ -46,11 +46,10 @@
 import org.onosproject.yangutils.datamodel.YangLeafList;
 import org.onosproject.yangutils.datamodel.YangType;
 import org.onosproject.yangutils.parser.Parsable;
-import static org.onosproject.yangutils.utils.YangConstructType.BITS_DATA;
-import static org.onosproject.yangutils.utils.YangConstructType.TYPE_DATA;
 import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
 import org.onosproject.yangutils.parser.exceptions.ParserException;
 import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
 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;
@@ -58,10 +57,12 @@
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yangutils.utils.YangConstructType.BITS_DATA;
+import static org.onosproject.yangutils.utils.YangConstructType.TYPE_DATA;
 
 /**
- * Implements listener based call back function corresponding to the "bits"
- * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ * Implements listener based call back function corresponding to the "bits" rule
+ * defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
  */
 public final class BitsListener {
 
@@ -79,7 +80,7 @@
      * @param ctx context object of the grammar rule
      */
     public static void processBitsEntry(TreeWalkListener listener,
-                                               GeneratedYangParser.BitsSpecificationContext ctx) {
+            GeneratedYangParser.BitsSpecificationContext ctx) {
 
         // Check for stack to be non empty.
         checkStackIsNotEmpty(listener, MISSING_HOLDER, BITS_DATA, "", ENTRY);
@@ -103,7 +104,7 @@
                 // TODO typedef, union, deviate.
                 default:
                     throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, TYPE_DATA,
-                            ((YangType) typeData).getDataTypeName(), ENTRY));
+                            ((YangType<?>) typeData).getDataTypeName(), ENTRY));
             }
             listener.getParsedDataStack().push(typeData);
             listener.getParsedDataStack().push(bitsNode);
@@ -120,13 +121,14 @@
      * @param ctx context object of the grammar rule
      */
     public static void processBitsExit(TreeWalkListener listener,
-                                              GeneratedYangParser.BitsSpecificationContext ctx) {
+            GeneratedYangParser.BitsSpecificationContext ctx) {
 
         // Check for stack to be non empty.
         checkStackIsNotEmpty(listener, MISSING_HOLDER, BITS_DATA, "", EXIT);
 
         Parsable tmpBitsNode = listener.getParsedDataStack().peek();
         if (tmpBitsNode instanceof YangBits) {
+            YangBits bitsNode = (YangBits) tmpBitsNode;
             listener.getParsedDataStack().pop();
 
             // Check for stack to be non empty.
@@ -135,8 +137,8 @@
             Parsable tmpNode = listener.getParsedDataStack().peek();
             switch (tmpNode.getYangConstructType()) {
                 case TYPE_DATA: {
-                    YangType typeNode = (YangType) tmpNode;
-                    typeNode.setDataTypeExtendedInfo((YangBits) tmpBitsNode);
+                    YangType<YangBits> typeNode = (YangType<YangBits>) tmpNode;
+                    typeNode.setDataTypeExtendedInfo(bitsNode);
                     break;
                 }
                 default:
diff --git a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/DefaultListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/DefaultListener.java
index 42b3cc4..18a81e4 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/DefaultListener.java
+++ b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/DefaultListener.java
@@ -45,13 +45,17 @@
 import org.onosproject.yangutils.parser.exceptions.ParserException;
 import org.onosproject.yangutils.parser.impl.TreeWalkListener;
 
-import static org.onosproject.yangutils.utils.YangConstructType.DEFAULT_DATA;
+
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
-import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yangutils.utils.YangConstructType.DEFAULT_DATA;
 
+/**
+ * Listener implementation for default YANG statement.
+ */
 public final class DefaultListener {
 
     /**
diff --git a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/EnumerationListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/EnumerationListener.java
index 5f98fa4..0dab0f1 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/EnumerationListener.java
+++ b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/EnumerationListener.java
@@ -46,11 +46,10 @@
 import org.onosproject.yangutils.datamodel.YangLeafList;
 import org.onosproject.yangutils.datamodel.YangType;
 import org.onosproject.yangutils.parser.Parsable;
-import static org.onosproject.yangutils.utils.YangConstructType.ENUMERATION_DATA;
-import static org.onosproject.yangutils.utils.YangConstructType.TYPE_DATA;
 import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
 import org.onosproject.yangutils.parser.exceptions.ParserException;
 import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
 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;
@@ -58,6 +57,8 @@
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yangutils.utils.YangConstructType.ENUMERATION_DATA;
+import static org.onosproject.yangutils.utils.YangConstructType.TYPE_DATA;
 
 /**
  * Implements listener based call back function corresponding to the
@@ -104,7 +105,7 @@
                 // TODO typedef, union, deviate.
                 default:
                     throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, TYPE_DATA,
-                            ((YangType) typeData).getDataTypeName(), ENTRY));
+                            ((YangType<?>) typeData).getDataTypeName(), ENTRY));
             }
             listener.getParsedDataStack().push(typeData);
             listener.getParsedDataStack().push(enumerationNode);
@@ -128,6 +129,7 @@
 
         Parsable tmpEnumerationNode = listener.getParsedDataStack().peek();
         if (tmpEnumerationNode instanceof YangEnumeration) {
+            YangEnumeration enumerationNode = (YangEnumeration) tmpEnumerationNode;
             listener.getParsedDataStack().pop();
 
             // Check for stack to be non empty.
@@ -136,8 +138,8 @@
             Parsable tmpNode = listener.getParsedDataStack().peek();
             switch (tmpNode.getYangConstructType()) {
                 case TYPE_DATA: {
-                    YangType typeNode = (YangType) tmpNode;
-                    typeNode.setDataTypeExtendedInfo((YangEnumeration) tmpEnumerationNode);
+                    YangType<YangEnumeration> typeNode = (YangType<YangEnumeration>) tmpNode;
+                    typeNode.setDataTypeExtendedInfo(enumerationNode);
                     break;
                 }
                 default:
diff --git a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ListListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ListListener.java
index 7692025..d71186e 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ListListener.java
+++ b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ListListener.java
@@ -20,12 +20,13 @@
 import org.onosproject.yangutils.datamodel.YangList;
 import org.onosproject.yangutils.datamodel.YangModule;
 import org.onosproject.yangutils.datamodel.YangNode;
-import org.onosproject.yangutils.datamodel.YangNodeType;
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
 import org.onosproject.yangutils.parser.Parsable;
 import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
 import org.onosproject.yangutils.parser.exceptions.ParserException;
 import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+import org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation;
+
 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;
@@ -35,7 +36,6 @@
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.UNHANDLED_PARSED_DATA;
-import org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateCardinality;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateCardinalityNonNull;
@@ -115,7 +115,7 @@
         String identifierName = ctx.IDENTIFIER().getText();
         detectCollidingChildUtil(listener, line, charPositionInLine, identifierName, LIST_DATA);
 
-        YangList yangList = new YangList(YangNodeType.LIST_NODE);
+        YangList yangList = new YangList();
         yangList.setName(ctx.IDENTIFIER().getText());
 
         /*
@@ -128,8 +128,8 @@
         }
 
         Parsable curData = listener.getParsedDataStack().peek();
-        if ((curData instanceof YangModule) || (curData instanceof YangContainer)
-                || (curData instanceof YangList)) {
+        if (curData instanceof YangModule || curData instanceof YangContainer
+                || curData instanceof YangList) {
             curNode = (YangNode) curData;
             try {
                 curNode.addChild(yangList);
diff --git a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/MaxElementsListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/MaxElementsListener.java
index 72ba44d..da8a666 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/MaxElementsListener.java
+++ b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/MaxElementsListener.java
@@ -23,12 +23,12 @@
 import org.onosproject.yangutils.parser.exceptions.ParserException;
 import org.onosproject.yangutils.parser.impl.TreeWalkListener;
 
-import static org.onosproject.yangutils.utils.YangConstructType.MAX_ELEMENT_DATA;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
 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_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yangutils.utils.YangConstructType.MAX_ELEMENT_DATA;
 
 /*
  * Reference: RFC6020 and YANG ANTLR Grammar
@@ -44,8 +44,9 @@
  */
 
 /**
- * Implements listener based call back function corresponding to the "max-elements"
- * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ * Implements listener based call back function corresponding to the
+ * "max-elements" rule defined in ANTLR grammar file for corresponding ABNF rule
+ * in RFC 6020.
  */
 public final class MaxElementsListener {
 
@@ -56,15 +57,14 @@
     }
 
     /**
-     * It is called when parser receives an input matching the grammar
-     * rule (max-elements), performs validation and updates the data model
-     * tree.
+     * It is called when parser receives an input matching the grammar rule
+     * (max-elements), performs validation and updates the data model tree.
      *
      * @param listener listener's object
      * @param ctx context object of the grammar rule
      */
     public static void processMaxElementsEntry(TreeWalkListener listener,
-                                             GeneratedYangParser.MaxElementsStatementContext ctx) {
+            GeneratedYangParser.MaxElementsStatementContext ctx) {
         int maxElementsValue;
 
         // Check for stack to be non empty.
@@ -84,7 +84,7 @@
                 break;
             case LIST_DATA:
                 YangList yangList = (YangList) tmpData;
-                yangList.setMaxElelements(maxElementsValue);
+                yangList.setMaxElements(maxElementsValue);
                 break;
             default:
                 throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, MAX_ELEMENT_DATA, "", ENTRY));
diff --git a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/NamespaceListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/NamespaceListener.java
index a2cf36c..b30d45c 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/NamespaceListener.java
+++ b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/NamespaceListener.java
@@ -16,6 +16,8 @@
 
 package org.onosproject.yangutils.parser.impl.listeners;
 
+import java.net.URI;
+
 import org.onosproject.yangutils.datamodel.YangModule;
 import org.onosproject.yangutils.datamodel.YangNameSpace;
 import org.onosproject.yangutils.parser.Parsable;
@@ -23,14 +25,12 @@
 import org.onosproject.yangutils.parser.exceptions.ParserException;
 import org.onosproject.yangutils.parser.impl.TreeWalkListener;
 
-import java.net.URI;
-
-import static org.onosproject.yangutils.utils.YangConstructType.NAMESPACE_DATA;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
 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_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yangutils.utils.YangConstructType.NAMESPACE_DATA;
 
 /*
  * Reference: RFC6020 and YANG ANTLR Grammar
@@ -74,7 +74,7 @@
      * @param ctx context object of the grammar rule
      */
     public static void processNamespaceEntry(TreeWalkListener listener,
-                                             GeneratedYangParser.NamespaceStatementContext ctx) {
+            GeneratedYangParser.NamespaceStatementContext ctx) {
 
         // Check for stack to be non empty.
         checkStackIsNotEmpty(listener, MISSING_HOLDER, NAMESPACE_DATA, ctx.string().getText(), ENTRY);
@@ -89,16 +89,16 @@
         // Obtain the node of the stack.
         Parsable tmpNode = listener.getParsedDataStack().peek();
         switch (tmpNode.getYangConstructType()) {
-        case MODULE_DATA: {
-            YangModule module = (YangModule) tmpNode;
-            YangNameSpace uri = new YangNameSpace();
-            uri.setUri(ctx.string().getText());
-            module.setNameSpace(uri);
-            break;
-        }
-        default:
-            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, NAMESPACE_DATA,
-                                                                    ctx.string().getText(), ENTRY));
+            case MODULE_DATA: {
+                YangModule module = (YangModule) tmpNode;
+                YangNameSpace uri = new YangNameSpace();
+                uri.setUri(ctx.string().getText());
+                module.setNameSpace(uri);
+                break;
+            }
+            default:
+                throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, NAMESPACE_DATA,
+                        ctx.string().getText(), ENTRY));
         }
     }
 
@@ -110,9 +110,8 @@
      */
     private static boolean validateUriValue(String uri) {
         uri = uri.replace("\"", "");
-        final URI tmpUri;
         try {
-            tmpUri = URI.create(uri);
+            URI.create(uri);
         } catch (Exception e1) {
             return false;
         }
diff --git a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/PositionListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/PositionListener.java
index 41835d6..43e600b 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/PositionListener.java
+++ b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/PositionListener.java
@@ -36,15 +36,16 @@
 import org.onosproject.yangutils.datamodel.YangBit;
 import org.onosproject.yangutils.datamodel.YangBits;
 import org.onosproject.yangutils.parser.Parsable;
-import static org.onosproject.yangutils.utils.YangConstructType.POSITION_DATA;
 import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
 import org.onosproject.yangutils.parser.exceptions.ParserException;
 import org.onosproject.yangutils.parser.impl.TreeWalkListener;
+
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
 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_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yangutils.utils.YangConstructType.POSITION_DATA;
 
 /**
  * Implements listener based call back function corresponding to the "position"
@@ -69,7 +70,7 @@
      * @param ctx context object of the grammar rule
      */
     public static void processPositionEntry(TreeWalkListener listener,
-                                            GeneratedYangParser.PositionStatementContext ctx) {
+            GeneratedYangParser.PositionStatementContext ctx) {
 
         // Check for stack to be non empty.
         checkStackIsNotEmpty(listener, MISSING_HOLDER, POSITION_DATA, ctx.INTEGER().getText(), ENTRY);
@@ -102,7 +103,7 @@
      * @return validation result
      */
     private static boolean isBitPositionValid(TreeWalkListener listener,
-                                           GeneratedYangParser.PositionStatementContext ctx) {
+            GeneratedYangParser.PositionStatementContext ctx) {
         Parsable bitNode = listener.getParsedDataStack().pop();
 
         // Check for stack to be non empty.
diff --git a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/RevisionDateListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/RevisionDateListener.java
index 17fe6b7..03f1cb1 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/RevisionDateListener.java
+++ b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/RevisionDateListener.java
@@ -16,6 +16,10 @@
 
 package org.onosproject.yangutils.parser.impl.listeners;
 
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
 import org.onosproject.yangutils.datamodel.YangImport;
 import org.onosproject.yangutils.datamodel.YangInclude;
 import org.onosproject.yangutils.parser.Parsable;
@@ -23,16 +27,12 @@
 import org.onosproject.yangutils.parser.exceptions.ParserException;
 import org.onosproject.yangutils.parser.impl.TreeWalkListener;
 
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import static org.onosproject.yangutils.utils.YangConstructType.REVISION_DATE_DATA;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
 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_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yangutils.utils.YangConstructType.REVISION_DATE_DATA;
 
 /*
  * Reference: RFC6020 and YANG ANTLR Grammar
@@ -83,11 +83,11 @@
      * @param ctx context object of the grammar rule
      */
     public static void processRevisionDateEntry(TreeWalkListener listener,
-                                                GeneratedYangParser.RevisionDateStatementContext ctx) {
+            GeneratedYangParser.RevisionDateStatementContext ctx) {
 
         // Check for stack to be non empty.
         checkStackIsNotEmpty(listener, MISSING_HOLDER, REVISION_DATE_DATA, ctx.DATE_ARG().getText(),
-                             ENTRY);
+                ENTRY);
 
         if (!isDateValid(ctx.DATE_ARG().getText())) {
             ParserException parserException = new ParserException("YANG file error: Input date is not correct");
@@ -99,19 +99,19 @@
         // Obtain the node of the stack.
         Parsable tmpNode = listener.getParsedDataStack().peek();
         switch (tmpNode.getYangConstructType()) {
-        case IMPORT_DATA: {
-            YangImport importNode = (YangImport) tmpNode;
-            importNode.setRevision(ctx.DATE_ARG().getText());
-            break;
-        }
-        case INCLUDE_DATA: {
-            YangInclude includeNode = (YangInclude) tmpNode;
-            includeNode.setRevision(ctx.DATE_ARG().getText());
-            break;
-        }
-        default:
-            throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, REVISION_DATE_DATA,
-                                                                    ctx.DATE_ARG().getText(), ENTRY));
+            case IMPORT_DATA: {
+                YangImport importNode = (YangImport) tmpNode;
+                importNode.setRevision(ctx.DATE_ARG().getText());
+                break;
+            }
+            case INCLUDE_DATA: {
+                YangInclude includeNode = (YangInclude) tmpNode;
+                includeNode.setRevision(ctx.DATE_ARG().getText());
+                break;
+            }
+            default:
+                throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, REVISION_DATE_DATA,
+                        ctx.DATE_ARG().getText(), ENTRY));
         }
     }
 
diff --git a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeDefListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeDefListener.java
index 5ba9780..d2af63e 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeDefListener.java
+++ b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeDefListener.java
@@ -58,12 +58,22 @@
 import org.onosproject.yangutils.datamodel.YangTypeDef;
 import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
 import org.onosproject.yangutils.parser.Parsable;
-import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateCardinality;
-import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateCardinalityEqualsOne;
 import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
 import org.onosproject.yangutils.parser.exceptions.ParserException;
 import org.onosproject.yangutils.parser.impl.TreeWalkListener;
 
+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.ListenerErrorType.INVALID_CONTENT;
+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;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.UNHANDLED_PARSED_DATA;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateCardinality;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateCardinalityEqualsOne;
 import static org.onosproject.yangutils.utils.YangConstructType.DEFAULT_DATA;
 import static org.onosproject.yangutils.utils.YangConstructType.DESCRIPTION_DATA;
 import static org.onosproject.yangutils.utils.YangConstructType.REFERENCE_DATA;
@@ -71,15 +81,6 @@
 import static org.onosproject.yangutils.utils.YangConstructType.TYPEDEF_DATA;
 import static org.onosproject.yangutils.utils.YangConstructType.TYPE_DATA;
 import static org.onosproject.yangutils.utils.YangConstructType.UNITS_DATA;
-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.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;
-import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.UNHANDLED_PARSED_DATA;
-import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
 
 /**
  * Implements listener based call back function corresponding to the "typedef"
@@ -122,8 +123,8 @@
 
         Parsable curData = listener.getParsedDataStack().peek();
 
-        if ((curData instanceof YangModule) | (curData instanceof YangSubModule) | (curData instanceof YangContainer)
-                | (curData instanceof YangList)) {
+        if (curData instanceof YangModule || curData instanceof YangSubModule || curData instanceof YangContainer
+                || curData instanceof YangList) {
             /*
              * TODO YangGrouping, YangRpc, YangInput, YangOutput, Notification.
              */
@@ -159,8 +160,8 @@
             try {
                 typeDefNode.validateDataOnExit();
             } catch (DataModelException e) {
-                // TODO Auto-generated catch block
-                e.printStackTrace();
+                throw new ParserException(constructListenerErrorMessage(INVALID_CONTENT, TYPEDEF_DATA,
+                        ctx.IDENTIFIER().getText(), EXIT));
             }
 
             listener.getParsedDataStack().pop();
diff --git a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeListener.java
index 18a7aef..5d6a744 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeListener.java
+++ b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeListener.java
@@ -27,7 +27,6 @@
 import org.onosproject.yangutils.parser.exceptions.ParserException;
 import org.onosproject.yangutils.parser.impl.TreeWalkListener;
 
-import static org.onosproject.yangutils.utils.YangConstructType.TYPE_DATA;
 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;
@@ -35,6 +34,7 @@
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
 import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
+import static org.onosproject.yangutils.utils.YangConstructType.TYPE_DATA;
 
 /*
  * Reference: RFC6020 and YANG ANTLR Grammar
@@ -110,11 +110,11 @@
         switch (tmpData.getYangConstructType()) {
             case LEAF_DATA:
                 YangLeaf leaf = (YangLeaf) tmpData;
-                leaf.setDataType((YangType) type);
+                leaf.setDataType((YangType<?>) type);
                 break;
             case LEAF_LIST_DATA:
                 YangLeafList leafList = (YangLeafList) tmpData;
-                leafList.setDataType((YangType) type);
+                leafList.setDataType((YangType<?>) type);
                 break;
             case TYPEDEF_DATA:
 
@@ -128,15 +128,15 @@
                 }
 
                 YangDerivedType derivedTypeInfo = new YangDerivedType();
-                if (((YangType) type).getDataType() != YangDataTypes.DERIVED) {
-                    derivedTypeInfo.setEffectiveYangBuiltInType(((YangType) type).getDataType());
+                if (((YangType<?>) type).getDataType() != YangDataTypes.DERIVED) {
+                    derivedTypeInfo.setEffectiveYangBuiltInType(((YangType<?>) type).getDataType());
                 } else {
                     /*
                      * It will be resolved in the validate data model at exit.
                      * Nothing needs to be done.
                      */
                 }
-                derivedTypeInfo.setBaseType((YangType) type);
+                derivedTypeInfo.setBaseType((YangType<?>) type);
                 derivedType.setDataTypeExtendedInfo(derivedTypeInfo);
 
                 break;
diff --git a/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ListenerValidation.java b/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ListenerValidation.java
index d460634..784b2d5 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ListenerValidation.java
+++ b/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ListenerValidation.java
@@ -16,17 +16,18 @@
 
 package org.onosproject.yangutils.parser.impl.parserutils;
 
+import java.util.List;
+
 import org.onosproject.yangutils.datamodel.YangContainer;
 import org.onosproject.yangutils.datamodel.YangList;
 import org.onosproject.yangutils.datamodel.YangNode;
 import org.onosproject.yangutils.parser.Parsable;
 import org.onosproject.yangutils.parser.exceptions.ParserException;
 import org.onosproject.yangutils.parser.impl.TreeWalkListener;
-import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
 import org.onosproject.yangutils.utils.YangConstructType;
-import static org.onosproject.yangutils.utils.YangConstructType.getYangConstructType;
 
-import java.util.List;
+import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
+import static org.onosproject.yangutils.utils.YangConstructType.getYangConstructType;
 
 /**
  * It's a utility to carry out listener validation.
@@ -50,8 +51,8 @@
      * @param errorLocation location where error occurred
      */
     public static void checkStackIsNotEmpty(TreeWalkListener listener, ListenerErrorType errorType,
-                                            YangConstructType yangConstructType, String parsableDataTypeName,
-                                            ListenerErrorLocation errorLocation) {
+            YangConstructType yangConstructType, String parsableDataTypeName,
+            ListenerErrorLocation errorLocation) {
         if (listener.getParsedDataStack().empty()) {
             /*
              * If stack is empty it indicates error condition, value of
@@ -59,7 +60,7 @@
              * attached to parsable data type.
              */
             String message = constructListenerErrorMessage(errorType, yangConstructType, parsableDataTypeName,
-                                                           errorLocation);
+                    errorLocation);
             throw new ParserException(message);
         }
     }
@@ -75,8 +76,8 @@
      * @param errorLocation location where error occurred
      */
     public static void checkStackIsEmpty(TreeWalkListener listener, ListenerErrorType errorType,
-                                         YangConstructType yangConstructType, String parsableDataTypeName,
-                                         ListenerErrorLocation errorLocation) {
+            YangConstructType yangConstructType, String parsableDataTypeName,
+            ListenerErrorLocation errorLocation) {
 
         if (!listener.getParsedDataStack().empty()) {
             /*
@@ -85,14 +86,14 @@
              * attached to parsable data type.
              */
             String message = constructListenerErrorMessage(errorType, yangConstructType, parsableDataTypeName,
-                                                           errorLocation);
+                    errorLocation);
             throw new ParserException(message);
         }
     }
 
     /**
-     * Returns parent node config value, if top node does not specify a config statement
-     * then default value true is returned.
+     * Returns parent node config value, if top node does not specify a config
+     * statement then default value true is returned.
      *
      * @param listener listener's object
      * @return true/false parent's config value
@@ -117,14 +118,14 @@
      *
      * @param childContext child's context
      * @param yangChildConstruct child construct for whom cardinality is to be
-     *                           validated
+     *            validated
      * @param yangParentConstruct parent construct
      * @param parentName parent name
      * @throws ParserException exception if cardinality check fails
      */
     public static void validateCardinality(List<?> childContext, YangConstructType yangChildConstruct,
-                                           YangConstructType yangParentConstruct, String parentName)
-            throws ParserException {
+            YangConstructType yangParentConstruct, String parentName)
+                    throws ParserException {
 
         if (!childContext.isEmpty() && childContext.size() != 1) {
             ParserException parserException = new ParserException("YANG file error: Invalid cardinality of "
@@ -139,14 +140,13 @@
      *
      * @param childContext child's context
      * @param yangChildConstruct child construct for whom cardinality is to be
-     *                           validated
+     *            validated
      * @param yangParentConstruct parent construct
      * @param parentName parent name
      * @throws ParserException exception if cardinality check fails
      */
     public static void validateCardinalityEqualsOne(List<?> childContext, YangConstructType yangChildConstruct,
-                                                    YangConstructType yangParentConstruct, String parentName)
-            throws ParserException {
+            YangConstructType yangParentConstruct, String parentName) throws ParserException {
 
         if (childContext.isEmpty() || childContext.size() != 1) {
             ParserException parserException = new ParserException("YANG file error: Invalid cardinality of "
@@ -161,14 +161,13 @@
      *
      * @param childContext child's context
      * @param yangChildConstruct child construct for whom cardinality is to be
-     *                           validated
+     *            validated
      * @param yangParentConstruct parent construct
      * @param parentName parent name
      * @throws ParserException exception if cardinality check fails
      */
     public static void validateCardinalityNonNull(List<?> childContext, YangConstructType yangChildConstruct,
-                                                  YangConstructType yangParentConstruct, String parentName)
-            throws ParserException {
+            YangConstructType yangParentConstruct, String parentName) throws ParserException {
 
         if (childContext.isEmpty()) {
             ParserException parserException = new ParserException("YANG file error: Invalid cardinality of "
diff --git a/src/main/java/org/onosproject/yangutils/translator/CachedFileHandle.java b/src/main/java/org/onosproject/yangutils/translator/CachedFileHandle.java
index 4d7e51b..4c2f808 100644
--- a/src/main/java/org/onosproject/yangutils/translator/CachedFileHandle.java
+++ b/src/main/java/org/onosproject/yangutils/translator/CachedFileHandle.java
@@ -29,31 +29,31 @@
     /**
      * Add a new attribute to the file(s).
      *
-     * @param attrType data type of the added attribute.
-     * @param name name of the attribute.
+     * @param attrType data type of the added attribute
+     * @param name name of the attribute
      * @param isListAttr if the current added attribute needs to be maintained
-     *            in a list.
+     *            in a list
      */
     void addAttributeInfo(YangType<?> attrType, String name, boolean isListAttr);
 
     /**
      * Flushes the cached contents to the target file, frees used resources.
      *
-     * @throws IOException when failes to generated java files.
+     * @throws IOException when failes to generated java files
      */
     void close() throws IOException;
 
     /**
-     * Sets child package path for import.
-     *
-     * @param pkg child's package path
-     */
-    void setChildsPackage(String pkg);
-
-    /**
      * Sets directory package path for code generation.
      *
      * @param filePath directory package path for code generation
      */
-    void setFilePath(String filePath);
+    void setRelativeFilePath(String filePath);
+
+    /**
+     * Gets directory package path for code generation.
+     *
+     * @return directory package path for code generation
+     */
+    String getRelativeFilePath();
 }
diff --git a/src/main/java/org/onosproject/yangutils/translator/CodeGenerator.java b/src/main/java/org/onosproject/yangutils/translator/CodeGenerator.java
index ec5a0e5..82e15a6 100644
--- a/src/main/java/org/onosproject/yangutils/translator/CodeGenerator.java
+++ b/src/main/java/org/onosproject/yangutils/translator/CodeGenerator.java
@@ -26,14 +26,14 @@
     /**
      * Traverse the schema of application and generate corresponding code.
      *
-     * @throws IOException when fails to translate the data model tree.
+     * @throws IOException when fails to translate the data model tree
      */
     void generateJavaCodeEntry() throws IOException;
 
     /**
      * Traverse the schema of application and generate corresponding code.
      *
-     * @throws IOException when fails to generate java code.
+     * @throws IOException when fails to generate java code
      */
     void generateJavaCodeExit() throws IOException;
 
diff --git a/src/main/java/org/onosproject/yangutils/translator/GeneratedFileType.java b/src/main/java/org/onosproject/yangutils/translator/GeneratedFileType.java
index b623fb1..95dfdd3 100644
--- a/src/main/java/org/onosproject/yangutils/translator/GeneratedFileType.java
+++ b/src/main/java/org/onosproject/yangutils/translator/GeneratedFileType.java
@@ -19,29 +19,41 @@
 /**
  * Type of files generated.
  */
-public enum GeneratedFileType {
+public final class GeneratedFileType {
+
+    /**
+     * prevent creating attributes.
+     */
+    private GeneratedFileType() {
+    }
+
     /**
      * Interface file.
      */
-    INTERFACE,
-
-    /**
-     * Builder class file.
-     */
-    BUILDER_CLASS,
+    public static final int INTERFACE_MASK = 1;
 
     /**
      * Builder interface file.
      */
-    BUILDER_INTERFACE,
+    public static final int BUILDER_INTERFACE_MASK = 2;
+
+    /**
+     * Builder class file.
+     */
+    public static final int BUILDER_CLASS_MASK = 4;
 
     /**
      * Impl class file.
      */
-    IMPL,
+    public static final int IMPL_CLASS_MASK = 8;
 
     /**
-     * interface and class file.
+     * Interface and class file.
      */
-    ALL
+    public static final int GENERATE_INTERFACE_WITH_BUILDER = 15;
+
+    /**
+     * Java class corresponding to typedef.
+     */
+    public static final int GENERATE_TYPEDEF_CLASS = 16;
 }
diff --git a/src/main/java/org/onosproject/yangutils/translator/tojava/AttributeInfo.java b/src/main/java/org/onosproject/yangutils/translator/tojava/AttributeInfo.java
index f2c1562..9cb1c28 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/AttributeInfo.java
+++ b/src/main/java/org/onosproject/yangutils/translator/tojava/AttributeInfo.java
@@ -16,20 +16,12 @@
 
 package org.onosproject.yangutils.translator.tojava;
 
-import java.io.Serializable;
-
 import org.onosproject.yangutils.datamodel.YangType;
-import org.onosproject.yangutils.translator.tojava.utils.AttributesJavaDataType;
 
 /**
  * Maintains the attribute info corresponding to class/interface generated.
  */
-public class AttributeInfo implements Serializable {
-
-    /**
-     * version of serialized info.
-     */
-    private static final long serialVersionUID = 201602151004L;
+public class AttributeInfo {
 
     /**
      * The data type info of attribute.
@@ -44,7 +36,7 @@
     /**
      * If the added attribute is a list of info.
      */
-    private boolean isListAttr;
+    private boolean isListAttr = false;
 
     /**
      * If the added attribute has to be accessed in a fully qualified manner.
@@ -52,6 +44,12 @@
     private boolean isQualifiedName;
 
     /**
+     * The class info will be used to set the attribute type and package info
+     * will be use for qualified name.
+     */
+    private ImportInfo importInfo;
+
+    /**
      * Default constructor.
      */
     public AttributeInfo() {
@@ -60,7 +58,7 @@
     /**
      * Get the data type info of attribute.
      *
-     * @return the data type info of attribute.
+     * @return the data type info of attribute
      */
     public YangType<?> getAttributeType() {
         return attrType;
@@ -69,19 +67,17 @@
     /**
      * Set the data type info of attribute.
      *
-     * @param type the data type info of attribute.
+     * @param type the data type info of attribute
      */
     public void setAttributeType(YangType<?> type) {
 
-        if (type != null) {
-            attrType = AttributesJavaDataType.getJavaDataType(type);
-        }
+        attrType = type;
     }
 
     /**
      * Get name of the attribute.
      *
-     * @return name of the attribute.
+     * @return name of the attribute
      */
     public String getAttributeName() {
         return name;
@@ -90,7 +86,7 @@
     /**
      * Set name of the attribute.
      *
-     * @param attrName name of the attribute.
+     * @param attrName name of the attribute
      */
     public void setAttributeName(String attrName) {
         name = attrName;
@@ -99,7 +95,7 @@
     /**
      * Get if the added attribute is a list of info.
      *
-     * @return the if the added attribute is a list of info.
+     * @return the if the added attribute is a list of info
      */
     public boolean isListAttr() {
         return isListAttr;
@@ -108,7 +104,7 @@
     /**
      * Set if the added attribute is a list of info.
      *
-     * @param isList if the added attribute is a list of info.
+     * @param isList if the added attribute is a list of info
      */
     public void setListAttr(boolean isList) {
         isListAttr = isList;
@@ -130,10 +126,29 @@
      * manner.
      *
      * @param isQualified if the added attribute has to be accessed in a fully
-     *            qualified manner.
+     *            qualified manner
      */
     public void setQualifiedName(boolean isQualified) {
         isQualifiedName = isQualified;
     }
 
+    /**
+     * Get the import info for the attribute type. It will be null, of the type
+     * is basic built-in java type.
+     *
+     * @return import info
+     */
+    public ImportInfo getImportInfo() {
+        return importInfo;
+    }
+
+    /**
+     * Set the import info for the attribute type.
+     *
+     * @param importInfo import info for the attribute type
+     */
+    public void setImportInfo(ImportInfo importInfo) {
+        this.importInfo = importInfo;
+    }
+
 }
diff --git a/src/main/java/org/onosproject/yangutils/translator/tojava/CachedJavaFileHandle.java b/src/main/java/org/onosproject/yangutils/translator/tojava/CachedJavaFileHandle.java
index c6fcea4..40c5b0e 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/CachedJavaFileHandle.java
+++ b/src/main/java/org/onosproject/yangutils/translator/tojava/CachedJavaFileHandle.java
@@ -18,20 +18,18 @@
 
 import java.io.File;
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.SortedSet;
 import java.util.TreeSet;
 
 import org.onosproject.yangutils.datamodel.YangType;
+import org.onosproject.yangutils.datamodel.YangTypeDef;
 import org.onosproject.yangutils.translator.CachedFileHandle;
 import org.onosproject.yangutils.translator.GeneratedFileType;
 import org.onosproject.yangutils.translator.tojava.utils.AttributesJavaDataType;
-import org.onosproject.yangutils.translator.tojava.utils.JavaCodeSnippetGen;
 import org.onosproject.yangutils.translator.tojava.utils.JavaFileGenerator;
 import org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax;
-import org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator;
 import org.onosproject.yangutils.utils.UtilConstants;
 
 /**
@@ -47,17 +45,7 @@
      * The type(s) of java source file(s) to be generated when the cached file
      * handle is closed.
      */
-    private GeneratedFileType genFileTypes;
-
-    /**
-     * Java package in which the class/interface needs to be generated.
-     */
-    private String pkg;
-
-    /**
-     * Java package in which the child class/interface needs to be generated.
-     */
-    private String childsPkg;
+    private int genFileTypes;
 
     /**
      * Name of the object in YANG file.
@@ -68,7 +56,7 @@
      * Sorted set of import info, to be used to maintain the set of classes to
      * be imported in the generated class.
      */
-    private SortedSet<String> importSet;
+    private SortedSet<ImportInfo> importSet;
 
     /**
      * Cached list of attribute info.
@@ -78,7 +66,12 @@
     /**
      * File generation directory path.
      */
-    private String filePath;
+    private String relativeFilePath;
+
+    /**
+     * Typedef Info.
+     */
+    private YangTypeDef typedefInfo;
 
     /**
      * Prevent invoking default constructor.
@@ -91,14 +84,16 @@
      * Create a cached file handle which takes care of adding attributes to the
      * generated java file.
      *
-     * @param pcg package in which class/interface need to be generated.
-     * @param yangName name of the attribute in YANG file.
-     * @param types the types of files that needs to be generated.
-     * @throws IOException file IO exception.
+     * @param pcg package in which class/interface need to be generated
+     * @param yangName name of the attribute in YANG file
+     * @param types the types of files that needs to be generated
+     * @throws IOException file IO exception
      */
-    public CachedJavaFileHandle(String pcg, String yangName, GeneratedFileType types) throws IOException {
+    public CachedJavaFileHandle(String pcg, String yangName, int types) throws IOException {
+        setCachedAttributeList(new LinkedList<AttributeInfo>());
+        setImportSet(new TreeSet<ImportInfo>());
+        setRelativeFilePath(pcg.replace(".", "/"));
         setGeneratedFileTypes(types);
-        setPackage(pcg);
         setYangName(yangName);
     }
 
@@ -107,9 +102,9 @@
      * definition.
      *
      * @return the types of files being generated corresponding to the YANG
-     *         definition.
+     *         definition
      */
-    public GeneratedFileType getGeneratedFileTypes() {
+    public int getGeneratedFileTypes() {
         return genFileTypes;
     }
 
@@ -118,16 +113,16 @@
      * definition.
      *
      * @param fileTypes the types of files being generated corresponding to the
-     *            YANG definition.
+     *            YANG definition
      */
-    public void setGeneratedFileTypes(GeneratedFileType fileTypes) {
+    public void setGeneratedFileTypes(int fileTypes) {
         genFileTypes = fileTypes;
     }
 
     /**
      * Get the corresponding name defined in YANG.
      *
-     * @return the corresponding name defined in YANG.
+     * @return the corresponding name defined in YANG
      */
     public String getYangName() {
         return yangName;
@@ -136,59 +131,27 @@
     /**
      * Set the corresponding name defined in YANG.
      *
-     * @param yangName the corresponding name defined in YANG.
+     * @param yangName the corresponding name defined in YANG
      */
     public void setYangName(String yangName) {
         this.yangName = yangName;
     }
 
     /**
-     * Get the java package.
-     *
-     * @return the java package.
-     */
-    public String getPackage() {
-        return pkg;
-    }
-
-    /**
-     * Set the java package.
-     *
-     * @param pcg the package to set
-     */
-    public void setPackage(String pcg) {
-        pkg = pcg;
-    }
-
-    /**
-     * Get the java package.
-     *
-     * @return the java package.
-     */
-    public String getChildsPackage() {
-        return childsPkg;
-    }
-
-    @Override
-    public void setChildsPackage(String pcg) {
-        childsPkg = pcg;
-    }
-
-    /**
      * Get the set containing the imported class/interface info.
      *
-     * @return the set containing the imported class/interface info.
+     * @return the set containing the imported class/interface info
      */
-    public SortedSet<String> getImportSet() {
+    public SortedSet<ImportInfo> getImportSet() {
         return importSet;
     }
 
     /**
      * Assign the set containing the imported class/interface info.
      *
-     * @param importSet the set containing the imported class/interface info.
+     * @param importSet the set containing the imported class/interface info
      */
-    private void setImportSet(SortedSet<String> importSet) {
+    private void setImportSet(SortedSet<ImportInfo> importSet) {
         this.importSet = importSet;
     }
 
@@ -197,25 +160,17 @@
      * set. If already part of the set, return false, else add to set and return
      * true.
      *
-     * @param importInfo class/interface info being imported.
+     * @param importInfo class/interface info being imported
      * @return status of new addition of class/interface to the import set
      */
     public boolean addImportInfo(ImportInfo importInfo) {
-        /*
-         * implement the import info adding. The return value will be used to
-         * check if the qualified name will be used or class/interface name will
-         * be used in the generated class.
-         */
-        if (getImportSet() == null) {
-            setImportSet(new TreeSet<String>());
-        }
-        return getImportSet().add(JavaCodeSnippetGen.getImportText(importInfo));
+        return getImportSet().add(importInfo);
     }
 
     /**
      * Get the list of cached attribute list.
      *
-     * @return the set containing the imported class/interface info.
+     * @return the set containing the imported class/interface info
      */
     public List<AttributeInfo> getCachedAttributeList() {
         return attributeList;
@@ -224,33 +179,39 @@
     /**
      * Set the cached attribute list.
      *
-     * @param attrList attribute list.
+     * @param attrList attribute list
      */
     private void setCachedAttributeList(List<AttributeInfo> attrList) {
         attributeList = attrList;
     }
 
-    @Override
-    public void setFilePath(String path) {
-        filePath = path;
-    }
-
     /**
-     * Set the cached attribute list.
+     * Set the package relative path.
      *
-     * @param attrList attribute list.
+     * @param path package relative path
      */
-    private String getFilePath() {
-        return filePath;
+    @Override
+    public void setRelativeFilePath(String path) {
+        relativeFilePath = path;
     }
 
     /**
-     * Flush the cached attribute list to the serialized file.
+     * Get the package relative path.
+     *
+     * @return package relative path
      */
-    private void flushCacheAttrToSerFile(String className) {
+    @Override
+    public String getRelativeFilePath() {
+        return relativeFilePath;
+    }
+
+    /**
+     * Flush the cached attribute list to the corresponding temporary file.
+     */
+    private void flushCacheAttrToTempFile() {
 
         for (AttributeInfo attr : getCachedAttributeList()) {
-            JavaFileGenerator.parseAttributeInfo(attr, getGeneratedFileTypes(), className);
+            JavaFileGenerator.parseAttributeInfo(attr, getGeneratedFileTypes(), getYangName());
         }
 
         /*
@@ -262,88 +223,61 @@
     /**
      * Add a new attribute to the file(s).
      *
-     * @param attrType data type of the added attribute.
-     * @param name name of the attribute.
+     * @param attrType data type of the added attribute
+     * @param name name of the attribute
      * @param isListAttr if the current added attribute needs to be maintained
-     *            in a list.
+     *            in a list
      */
     @Override
     public void addAttributeInfo(YangType<?> attrType, String name, boolean isListAttr) {
+        /* YANG name is mapped to java name */
+        name = JavaIdentifierSyntax.getCamelCase(name);
+
+        ImportInfo importInfo = new ImportInfo();
+        boolean isImport = false;
 
         AttributeInfo newAttr = new AttributeInfo();
         if (attrType != null) {
             newAttr.setAttributeType(attrType);
-        } else {
-            ImportInfo importInfo = new ImportInfo();
-            importInfo.setPkgInfo(getChildsPackage());
-            importInfo.setClassInfo(JavaIdentifierSyntax.getCaptialCase(name));
-            if (getImportSet() != null) {
-                getImportSet().add(JavaCodeSnippetGen.getImportText(importInfo));
+            String importStr = AttributesJavaDataType.getJavaImportClass(attrType, isListAttr);
+            if (importStr != null) {
+                importInfo.setClassInfo(importStr);
+                importStr = AttributesJavaDataType.getJavaImportPackage(attrType, isListAttr);
+                importInfo.setPkgInfo(importStr);
+                isImport = true;
             } else {
-                SortedSet<String> newImportInfo = new TreeSet<>();
-                newImportInfo.add(JavaCodeSnippetGen.getImportText(importInfo));
-                setImportSet(newImportInfo);
+                importStr = AttributesJavaDataType.getJavaDataType(attrType);
+                if (importStr == null) {
+                    throw new RuntimeException("not supported data type");
+                    //TODO: need to change to translator exception.
+                }
+                importInfo.setClassInfo(importStr);
             }
 
-            newAttr.setQualifiedName(getQualifiedFlag(JavaCodeSnippetGen.getImportText(importInfo)));
+        } else {
+            importInfo.setClassInfo(JavaIdentifierSyntax.getCaptialCase(name));
+
+            importInfo.setPkgInfo(getRelativeFilePath().replace('/', '.')
+                    + "." + getYangName());
+            isImport = true;
         }
+
+        newAttr.setQualifiedName(false);
+        if (isImport) {
+            boolean isNewImport = addImportInfo(importInfo);
+            if (!isNewImport) {
+                newAttr.setQualifiedName(true);
+            }
+        }
+
         newAttr.setAttributeName(name);
         newAttr.setListAttr(isListAttr);
+        newAttr.setImportInfo(importInfo);
 
-        if (newAttr.isListAttr()) {
-            newAttr.setAttributeType(AttributesJavaDataType.getListString(newAttr));
+        if (getCachedAttributeList().size() == MAX_CACHABLE_ATTR) {
+            flushCacheAttrToTempFile();
         }
-
-        if (isListAttr) {
-            String listImport = UtilConstants.COLLECTION_IMPORTS + UtilConstants.LIST + UtilConstants.SEMI_COLAN
-                    + UtilConstants.NEW_LINE + UtilConstants.NEW_LINE;
-            if (getImportSet() != null) {
-                getImportSet().add(listImport);
-            } else {
-                SortedSet<String> newImportInfo = new TreeSet<>();
-                newImportInfo.add(listImport);
-                setImportSet(newImportInfo);
-            }
-
-            newAttr.setQualifiedName(getQualifiedFlag(listImport));
-        }
-
-        if (getCachedAttributeList() != null) {
-            if (getCachedAttributeList().size() == MAX_CACHABLE_ATTR) {
-                flushCacheAttrToSerFile(getYangName());
-            }
-            getCachedAttributeList().add(newAttr);
-        } else {
-            List<AttributeInfo> newAttributeInfo = new LinkedList<>();
-            newAttributeInfo.add(newAttr);
-            setCachedAttributeList(newAttributeInfo);
-        }
-    }
-
-    /**
-     * Check if the import set does not have a class info same as the new class
-     * info, if so the new class info be added to the import set. Otherwise
-     * check if the corresponding package info is same as the new package info,
-     * if so no need to qualified access, otherwise, it needs qualified access.
-     *
-     * @param newImportInfo new import info to be check for qualified access or
-     *            not and updated in the import set accordingly.
-     * @return if the new attribute needs to be accessed in a qualified manner.
-     */
-    private boolean getQualifiedFlag(String newImportInfo) {
-        for (String curImportInfo : getImportSet()) {
-            if (curImportInfo.equals(newImportInfo)) {
-                /*
-                 * If import is already existing import with same package, we
-                 * don't need qualified access, otherwise it needs to be
-                 * qualified access.
-                 */
-                return !curImportInfo.equals(newImportInfo);
-            }
-        }
-
-        getImportSet().add(newImportInfo);
-        return false;
+        getCachedAttributeList().add(newAttr);
     }
 
     /**
@@ -352,10 +286,12 @@
     @Override
     public void close() throws IOException {
 
+        flushCacheAttrToTempFile();
+
         String className = getYangName();
         className = JavaIdentifierSyntax.getCaptialCase(className);
-        String filePath = getFilePath();
-        GeneratedFileType fileType = getGeneratedFileTypes();
+        String path = getRelativeFilePath();
+        int fileType = getGeneratedFileTypes();
 
         /*
          * TODO: add the file header using
@@ -363,45 +299,46 @@
          */
 
         List<String> imports = new LinkedList<>();
+        String importString;
 
-        if (getCachedAttributeList() != null) {
-            MethodsGenerator.setAttrInfo(getCachedAttributeList());
-            for (AttributeInfo attr : getCachedAttributeList()) {
-
-                if (getImportSet() != null) {
-                    imports = new ArrayList<>(getImportSet());
-                }
+        for (ImportInfo importInfo : getImportSet()) {
+            importString = "";
+            if (importInfo.getPkgInfo() != null) {
+                importString = importString + importInfo.getPkgInfo() + ".";
             }
+            importString = importString + importInfo.getClassInfo();
+            imports.add(importString);
         }
 
         /**
          * Start generation of files.
          */
-        if (fileType.equals(GeneratedFileType.INTERFACE) || fileType.equals(GeneratedFileType.ALL)) {
+        if ((fileType & GeneratedFileType.INTERFACE_MASK) != 0
+                || fileType == GeneratedFileType.GENERATE_INTERFACE_WITH_BUILDER) {
 
             /**
              * Create interface file.
              */
             String interfaceFileName = className;
-            File interfaceFile = new File(filePath + File.separator + interfaceFileName + JAVA_FILE_EXTENSION);
+            File interfaceFile = JavaFileGenerator.getFileObject(path, interfaceFileName, JAVA_FILE_EXTENSION);
             interfaceFile = JavaFileGenerator.generateInterfaceFile(interfaceFile, className, imports,
-                    getCachedAttributeList(), getPackage());
+                    getCachedAttributeList(), path.replace('/', '.'));
 
             /**
              * Create temp builder interface file.
              */
             String builderInterfaceFileName = className + UtilConstants.BUILDER + UtilConstants.INTERFACE;
-            File builderInterfaceFile = new File(
-                    filePath + File.separator + builderInterfaceFileName + TEMP_FILE_EXTENSION);
+            File builderInterfaceFile = JavaFileGenerator.getFileObject(path, builderInterfaceFileName,
+                    TEMP_FILE_EXTENSION);
             builderInterfaceFile = JavaFileGenerator.generateBuilderInterfaceFile(builderInterfaceFile, className,
-                    getPackage(), getCachedAttributeList());
+                    path.replace('/', '.'), getCachedAttributeList());
 
             /**
              * Append builder interface file to interface file and close it.
              */
             JavaFileGenerator.appendFileContents(builderInterfaceFile, interfaceFile);
             JavaFileGenerator.insert(interfaceFile,
-                    JavaFileGenerator.closeFile(GeneratedFileType.INTERFACE, interfaceFileName));
+                    JavaFileGenerator.closeFile(GeneratedFileType.INTERFACE_MASK, interfaceFileName));
 
             /**
              * Remove temp files.
@@ -409,33 +346,32 @@
             JavaFileGenerator.clean(builderInterfaceFile);
         }
 
-        if (fileType.equals(GeneratedFileType.BUILDER_CLASS) || fileType.equals(GeneratedFileType.ALL)) {
+        if ((fileType & GeneratedFileType.BUILDER_CLASS_MASK) != 0
+                || fileType == GeneratedFileType.GENERATE_INTERFACE_WITH_BUILDER) {
 
             /**
              * Create builder class file.
              */
             String builderFileName = className + UtilConstants.BUILDER;
-            File builderFile = new File(filePath + File.separator + builderFileName + JAVA_FILE_EXTENSION);
-            MethodsGenerator.setBuilderClassName(className + UtilConstants.BUILDER);
-
-            builderFile = JavaFileGenerator.generateBuilderClassFile(builderFile, className, imports, getPackage(),
-                    getCachedAttributeList());
+            File builderFile = JavaFileGenerator.getFileObject(path, builderFileName, JAVA_FILE_EXTENSION);
+            builderFile = JavaFileGenerator.generateBuilderClassFile(builderFile, className, imports,
+                    path.replace('/', '.'), getCachedAttributeList());
 
             /**
              * Create temp impl class file.
              */
 
             String implFileName = className + UtilConstants.IMPL;
-            File implTempFile = new File(filePath + File.separator + implFileName + TEMP_FILE_EXTENSION);
-            implTempFile = JavaFileGenerator.generateImplClassFile(implTempFile, className, getPackage(),
-                    getCachedAttributeList());
+            File implTempFile = JavaFileGenerator.getFileObject(path, implFileName, TEMP_FILE_EXTENSION);
+            implTempFile = JavaFileGenerator.generateImplClassFile(implTempFile, className,
+                    path.replace('/', '.'), getCachedAttributeList());
 
             /**
              * Append impl class to builder class and close it.
              */
             JavaFileGenerator.appendFileContents(implTempFile, builderFile);
             JavaFileGenerator.insert(builderFile,
-                    JavaFileGenerator.closeFile(GeneratedFileType.BUILDER_CLASS, builderFileName));
+                    JavaFileGenerator.closeFile(GeneratedFileType.BUILDER_CLASS_MASK, builderFileName));
 
             /**
              * Remove temp files.
@@ -443,4 +379,12 @@
             JavaFileGenerator.clean(implTempFile);
         }
     }
+
+    public YangTypeDef getTypedefInfo() {
+        return typedefInfo;
+    }
+
+    public void setTypedefInfo(YangTypeDef typedefInfo) {
+        this.typedefInfo = typedefInfo;
+    }
 }
diff --git a/src/main/java/org/onosproject/yangutils/translator/tojava/ImportInfo.java b/src/main/java/org/onosproject/yangutils/translator/tojava/ImportInfo.java
index 76d691d..693bbcb 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/ImportInfo.java
+++ b/src/main/java/org/onosproject/yangutils/translator/tojava/ImportInfo.java
@@ -23,7 +23,7 @@
 /**
  * Maintains the information about individual imports in the generated file.
  */
-public class ImportInfo {
+public class ImportInfo implements Comparable {
 
     /**
      * Package location where the imported class/interface is defined.
@@ -31,7 +31,7 @@
     private String pkgInfo;
 
     /**
-     * class/interface being referenced.
+     * Class/interface being referenced.
      */
     private String classInfo;
 
@@ -44,7 +44,7 @@
     /**
      * Get the imported package info.
      *
-     * @return the imported package info.
+     * @return the imported package info
      */
     public String getPkgInfo() {
         return pkgInfo;
@@ -53,7 +53,7 @@
     /**
      * Set the imported package info.
      *
-     * @param pkgInfo the imported package info.
+     * @param pkgInfo the imported package info
      */
     public void setPkgInfo(String pkgInfo) {
         this.pkgInfo = pkgInfo;
@@ -62,7 +62,7 @@
     /**
      * Get the imported class/interface info.
      *
-     * @return the imported class/interface info.
+     * @return the imported class/interface info
      */
     public String getClassInfo() {
         return classInfo;
@@ -71,7 +71,7 @@
     /**
      * Set the imported class/interface info.
      *
-     * @param classInfo the imported class/interface info.
+     * @param classInfo the imported class/interface info
      */
     public void setClassInfo(String classInfo) {
         this.classInfo = classInfo;
@@ -114,4 +114,20 @@
                 .add("classInfo", classInfo).toString();
     }
 
+    /**
+     * Check that there is no 2 objects with the same class name.
+     *
+     * @param o compared import info.
+     */
+    @Override
+    public int compareTo(Object o) {
+        ImportInfo other;
+        if (o instanceof ImportInfo) {
+            other = (ImportInfo) o;
+        } else {
+            return -1;
+        }
+        return getClassInfo().compareTo(other.getClassInfo());
+    }
+
 }
diff --git a/src/main/java/org/onosproject/yangutils/translator/tojava/JavaCodeGenerator.java b/src/main/java/org/onosproject/yangutils/translator/tojava/JavaCodeGenerator.java
index 20cc584..308020b 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/JavaCodeGenerator.java
+++ b/src/main/java/org/onosproject/yangutils/translator/tojava/JavaCodeGenerator.java
@@ -34,8 +34,9 @@
     /**
      * Generate Java code files corresponding to the YANG schema.
      *
-     * @param rootNode root node of the data model tree.
-     * @throws IOException when fails to generate java code file the current node.
+     * @param rootNode root node of the data model tree
+     * @throws IOException when fails to generate java code file the current
+     *             node
      */
     public static void generateJavaCode(YangNode rootNode) throws IOException {
         YangNode curNode = rootNode;
@@ -45,10 +46,10 @@
             if (curTraversal != TraversalType.PARENT) {
                 curNode.generateJavaCodeEntry();
             }
-            if (curTraversal != TraversalType.PARENT && (curNode.getChild() != null)) {
+            if (curTraversal != TraversalType.PARENT && curNode.getChild() != null) {
                 curTraversal = TraversalType.CHILD;
                 curNode = curNode.getChild();
-            } else if ((curNode.getNextSibling() != null)) {
+            } else if (curNode.getNextSibling() != null) {
                 curNode.generateJavaCodeExit();
                 curTraversal = TraversalType.SIBILING;
                 curNode = curNode.getNextSibling();
diff --git a/src/main/java/org/onosproject/yangutils/translator/tojava/utils/AttributesJavaDataType.java b/src/main/java/org/onosproject/yangutils/translator/tojava/utils/AttributesJavaDataType.java
index e2d27ac..70869b2 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/utils/AttributesJavaDataType.java
+++ b/src/main/java/org/onosproject/yangutils/translator/tojava/utils/AttributesJavaDataType.java
@@ -18,7 +18,6 @@
 
 import org.onosproject.yangutils.datamodel.YangDataTypes;
 import org.onosproject.yangutils.datamodel.YangType;
-import org.onosproject.yangutils.translator.tojava.AttributeInfo;
 import org.onosproject.yangutils.utils.UtilConstants;
 
 /**
@@ -33,41 +32,14 @@
     }
 
     /**
-     * Returns YANG type.
+     * Returns java type.
      *
      * @param yangType YANG type
-     * @return YANG type
+     * @return java type
      */
-    public static YangType<?> getJavaDataType(YangType<?> yangType) {
-        yangType.setDataTypeName(yangType.getDataTypeName().replace("\"", ""));
-        if (yangType.getDataType() != null) {
-            yangType.setDataTypeName(parseYangDataType(yangType.getDataType()));
-        }
-        return yangType;
-    }
+    public static String getJavaDataType(YangType<?> yangType) {
+        YangDataTypes type = yangType.getDataType();
 
-    /**
-     * Returns list string as attribute name when attribute is a list.
-     *
-     * @param attr attribute info.
-     * @return list attribute
-     */
-    @SuppressWarnings("rawtypes")
-    public static YangType<?> getListString(AttributeInfo attr) {
-        String listString = JavaCodeSnippetGen.getListAttribute(attr.getAttributeType().getDataTypeName());
-        YangType<?> type = new YangType();
-        type.setDataTypeName(listString);
-        attr.setAttributeType(type);
-        return type;
-    }
-
-    /**
-     * Parses YANG data type and returns corresponding java data type.
-     *
-     * @param type YANG data type
-     * @return java data type
-     */
-    private static String parseYangDataType(YangDataTypes type) {
         if (type.equals(YangDataTypes.INT8)) {
             return UtilConstants.BYTE;
         } else if (type.equals(YangDataTypes.INT16)) {
@@ -111,4 +83,161 @@
         }
         return null;
     }
+
+    /**
+     * Returns java import class.
+     *
+     * @param yangType YANG type
+     * @param isListAttr if the attribute need to be a list
+     * @return java import class
+     */
+    public static String getJavaImportClass(YangType<?> yangType, boolean isListAttr) {
+        YangDataTypes type = yangType.getDataType();
+
+        if (isListAttr) {
+            if (type.equals(YangDataTypes.INT8)) {
+                return UtilConstants.BYTE_WRAPPER;
+            } else if (type.equals(YangDataTypes.INT16)) {
+                return UtilConstants.SHORT_WRAPPER;
+            } else if (type.equals(YangDataTypes.INT32)) {
+                return UtilConstants.INTEGER_WRAPPER;
+            } else if (type.equals(YangDataTypes.INT64)) {
+                return UtilConstants.LONG_WRAPPER;
+            } else if (type.equals(YangDataTypes.UINT8)) {
+                return UtilConstants.SHORT_WRAPPER;
+            } else if (type.equals(YangDataTypes.UINT16)) {
+                return UtilConstants.INTEGER_WRAPPER;
+            } else if (type.equals(YangDataTypes.UINT32)) {
+                return UtilConstants.LONG_WRAPPER;
+            } else if (type.equals(YangDataTypes.UINT64)) {
+                //TODO: BIGINTEGER.
+            } else if (type.equals(YangDataTypes.DECIMAL64)) {
+                //TODO: DECIMAL64.
+            } else if (type.equals(YangDataTypes.STRING)) {
+                return UtilConstants.STRING;
+            } else if (type.equals(YangDataTypes.BOOLEAN)) {
+                return UtilConstants.BOOLEAN_WRAPPER;
+            } else if (type.equals(YangDataTypes.ENUMERATION)) {
+                //TODO: ENUMERATION.
+            } else if (type.equals(YangDataTypes.BITS)) {
+                //TODO:BITS
+            } else if (type.equals(YangDataTypes.BINARY)) {
+                //TODO:BINARY
+            } else if (type.equals(YangDataTypes.LEAFREF)) {
+                //TODO:LEAFREF
+            } else if (type.equals(YangDataTypes.IDENTITYREF)) {
+                //TODO:IDENTITYREF
+            } else if (type.equals(YangDataTypes.EMPTY)) {
+                //TODO:EMPTY
+            } else if (type.equals(YangDataTypes.UNION)) {
+                //TODO:UNION
+            } else if (type.equals(YangDataTypes.INSTANCE_IDENTIFIER)) {
+                //TODO:INSTANCE_IDENTIFIER
+            } else if (type.equals(YangDataTypes.DERIVED)) {
+                //TODO:DERIVED
+            }
+        } else {
+            if (type.equals(YangDataTypes.UINT64)) {
+                //TODO: BIGINTEGER.
+            } else if (type.equals(YangDataTypes.DECIMAL64)) {
+                //TODO: DECIMAL64.
+            } else if (type.equals(YangDataTypes.STRING)) {
+                return UtilConstants.STRING;
+            } else if (type.equals(YangDataTypes.ENUMERATION)) {
+                //TODO: ENUMERATION.
+            } else if (type.equals(YangDataTypes.BITS)) {
+                //TODO:BITS
+            } else if (type.equals(YangDataTypes.BINARY)) {
+                //TODO:BINARY
+            } else if (type.equals(YangDataTypes.LEAFREF)) {
+                //TODO:LEAFREF
+            } else if (type.equals(YangDataTypes.IDENTITYREF)) {
+                //TODO:IDENTITYREF
+            } else if (type.equals(YangDataTypes.EMPTY)) {
+                //TODO:EMPTY
+            } else if (type.equals(YangDataTypes.UNION)) {
+                //TODO:UNION
+            } else if (type.equals(YangDataTypes.INSTANCE_IDENTIFIER)) {
+                //TODO:INSTANCE_IDENTIFIER
+            } else if (type.equals(YangDataTypes.DERIVED)) {
+                //TODO:DERIVED
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Returns java import package.
+     *
+     * @param yangType YANG type
+     * @param isListAttr if the attribute is of list type
+     * @return java import package
+     */
+    public static String getJavaImportPackage(YangType<?> yangType, boolean isListAttr) {
+        YangDataTypes type = yangType.getDataType();
+
+        if (isListAttr) {
+            if (type.equals(YangDataTypes.INT8)
+                    || type.equals(YangDataTypes.INT16)
+                    || type.equals(YangDataTypes.INT32)
+                    || type.equals(YangDataTypes.INT64)
+                    || type.equals(YangDataTypes.UINT8)
+                    || type.equals(YangDataTypes.UINT16)
+                    || type.equals(YangDataTypes.UINT32)
+                    || type.equals(YangDataTypes.STRING)
+                    || type.equals(YangDataTypes.BOOLEAN)) {
+                return UtilConstants.JAVA_LANG;
+            } else if (type.equals(YangDataTypes.UINT64)) {
+                //TODO: BIGINTEGER.
+            } else if (type.equals(YangDataTypes.DECIMAL64)) {
+                //TODO: DECIMAL64.
+            } else if (type.equals(YangDataTypes.ENUMERATION)) {
+                //TODO: ENUMERATION.
+            } else if (type.equals(YangDataTypes.BITS)) {
+                //TODO:BITS
+            } else if (type.equals(YangDataTypes.BINARY)) {
+                //TODO:BINARY
+            } else if (type.equals(YangDataTypes.LEAFREF)) {
+                //TODO:LEAFREF
+            } else if (type.equals(YangDataTypes.IDENTITYREF)) {
+                //TODO:IDENTITYREF
+            } else if (type.equals(YangDataTypes.EMPTY)) {
+                //TODO:EMPTY
+            } else if (type.equals(YangDataTypes.UNION)) {
+                //TODO:UNION
+            } else if (type.equals(YangDataTypes.INSTANCE_IDENTIFIER)) {
+                //TODO:INSTANCE_IDENTIFIER
+            } else if (type.equals(YangDataTypes.DERIVED)) {
+                //TODO:DERIVED
+            }
+        } else {
+
+            if (type.equals(YangDataTypes.UINT64)) {
+                //TODO: BIGINTEGER.
+            } else if (type.equals(YangDataTypes.DECIMAL64)) {
+                //TODO: DECIMAL64.
+            } else if (type.equals(YangDataTypes.STRING)) {
+                return UtilConstants.JAVA_LANG;
+            } else if (type.equals(YangDataTypes.ENUMERATION)) {
+                //TODO: ENUMERATION.
+            } else if (type.equals(YangDataTypes.BITS)) {
+                //TODO:BITS
+            } else if (type.equals(YangDataTypes.BINARY)) {
+                //TODO:BINARY
+            } else if (type.equals(YangDataTypes.LEAFREF)) {
+                //TODO:LEAFREF
+            } else if (type.equals(YangDataTypes.IDENTITYREF)) {
+                //TODO:IDENTITYREF
+            } else if (type.equals(YangDataTypes.EMPTY)) {
+                //TODO:EMPTY
+            } else if (type.equals(YangDataTypes.UNION)) {
+                //TODO:UNION
+            } else if (type.equals(YangDataTypes.INSTANCE_IDENTIFIER)) {
+                //TODO:INSTANCE_IDENTIFIER
+            } else if (type.equals(YangDataTypes.DERIVED)) {
+                //TODO:DERIVED
+            }
+        }
+        return null;
+    }
 }
diff --git a/src/main/java/org/onosproject/yangutils/translator/tojava/utils/ClassDefinitionGenerator.java b/src/main/java/org/onosproject/yangutils/translator/tojava/utils/ClassDefinitionGenerator.java
index 736f40c..41a3117 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/utils/ClassDefinitionGenerator.java
+++ b/src/main/java/org/onosproject/yangutils/translator/tojava/utils/ClassDefinitionGenerator.java
@@ -31,30 +31,31 @@
     }
 
     /**
-     * Generate class definition for specific classes.
+     * Based on the file type and the YANG name of the file, generate the class
+     * / interface definition start.
      *
      * @param genFileTypes generated file type
      * @param yangName class name
      * @return class definition
      */
-    public static String generateClassDefinition(GeneratedFileType genFileTypes, String yangName) {
+    public static String generateClassDefinition(int genFileTypes, String yangName) {
 
         /**
-         * based on the file type and the YANG name of the file, generate
-         * the class / interface definition start.
+         * based on the file type and the YANG name of the file, generate the
+         * class / interface definition start.
          */
-        if (genFileTypes.equals(GeneratedFileType.INTERFACE)) {
+        if ((genFileTypes & GeneratedFileType.INTERFACE_MASK) != 0) {
 
             return getInterfaceDefinition(yangName);
-        } else if (genFileTypes.equals(GeneratedFileType.BUILDER_CLASS)) {
+        } else if ((genFileTypes & GeneratedFileType.BUILDER_CLASS_MASK) != 0) {
 
             return getBuilderClassDefinition(yangName);
-        } else if (genFileTypes.equals(GeneratedFileType.IMPL)) {
+        } else if ((genFileTypes & GeneratedFileType.IMPL_CLASS_MASK) != 0) {
 
             return getImplClassDefinition(yangName);
-        } else if (genFileTypes.equals(GeneratedFileType.BUILDER_INTERFACE)) {
+        } else if ((genFileTypes & GeneratedFileType.BUILDER_INTERFACE_MASK) != 0) {
 
-            return getBuilderInterfaceDefinition();
+            return getBuilderInterfaceDefinition(yangName);
         }
         return null;
     }
@@ -74,10 +75,12 @@
     /**
      * Returns builder interface file class definition.
      *
+     * @param yangName java class name, corresponding to which the builder class
+     *            is being generated
      * @return definition
      */
-    private static String getBuilderInterfaceDefinition() {
-        return UtilConstants.INTERFACE + UtilConstants.SPACE + UtilConstants.BUILDER + UtilConstants.SPACE
+    private static String getBuilderInterfaceDefinition(String yangName) {
+        return UtilConstants.INTERFACE + UtilConstants.SPACE + yangName + UtilConstants.BUILDER + UtilConstants.SPACE
                 + UtilConstants.OPEN_CURLY_BRACKET + UtilConstants.NEW_LINE;
     }
 
diff --git a/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaCodeSnippetGen.java b/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaCodeSnippetGen.java
index a470aef..4d6a475 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaCodeSnippetGen.java
+++ b/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaCodeSnippetGen.java
@@ -16,12 +16,7 @@
 
 package org.onosproject.yangutils.translator.tojava.utils;
 
-import java.util.List;
-import java.util.SortedSet;
-
-import org.onosproject.yangutils.datamodel.YangType;
 import org.onosproject.yangutils.translator.GeneratedFileType;
-import org.onosproject.yangutils.translator.tojava.GeneratedMethodTypes;
 import org.onosproject.yangutils.translator.tojava.ImportInfo;
 import org.onosproject.yangutils.utils.UtilConstants;
 
@@ -39,7 +34,7 @@
     /**
      * Get the java file header comment.
      *
-     * @return the java file header comment.
+     * @return the java file header comment
      */
     public static String getFileHeaderComment() {
 
@@ -50,37 +45,26 @@
     }
 
     /**
-     * reorder the import list based on the ONOS import rules.
-     *
-     * @param importInfo the set of classes/interfaces to be imported.
-     * @return string of import info.
-     */
-    public List<ImportInfo> sortImportOrder(SortedSet<ImportInfo> importInfo) {
-        /* TODO: reorder the import list based on the ONOS import rules. */
-        return null;
-    }
-
-    /**
      * Get the textual java code information corresponding to the import list.
      *
-     * @param importInfo import info.
+     * @param importInfo import info
      * @return the textual java code information corresponding to the import
-     *         list.
+     *         list
      */
     public static String getImportText(ImportInfo importInfo) {
         return UtilConstants.IMPORT + importInfo.getPkgInfo() + UtilConstants.PERIOD + importInfo.getClassInfo()
-        + UtilConstants.SEMI_COLAN + UtilConstants.NEW_LINE;
+                + UtilConstants.SEMI_COLAN + UtilConstants.NEW_LINE;
     }
 
     /**
      * Based on the file type and the YANG name of the file, generate the class
      * / interface definition start.
      *
-     * @param genFileTypes type of file being generated.
-     * @param yangName YANG name.
-     * @return corresponding textual java code information.
+     * @param genFileTypes type of file being generated
+     * @param yangName YANG name
+     * @return corresponding textual java code information
      */
-    public static String getJavaClassDefStart(GeneratedFileType genFileTypes, String yangName) {
+    public static String getJavaClassDefStart(int genFileTypes, String yangName) {
         /*
          * get the camel case name for java class / interface.
          */
@@ -91,19 +75,29 @@
     /**
      * Get the textual java code for attribute definition in class.
      *
-     * @param genFileTypes type of file being generated.
-     * @param yangName YANG name of the the attribute.
-     * @param type type of the the attribute.
-     * @return the textual java code for attribute definition in class.
+     * @param javaAttributeTypePkg Package of the attribute type
+     * @param javaAttributeType java attribute type
+     * @param javaAttributeName name of the attribute
+     * @return the textual java code for attribute definition in class
      */
-    public static String getJavaAttributeInfo(GeneratedFileType genFileTypes, String yangName, YangType<?> type) {
-        yangName = JavaIdentifierSyntax.getCamelCase(yangName);
-        if (type != null) {
-            return UtilConstants.PRIVATE + UtilConstants.SPACE + type.getDataTypeName() + UtilConstants.SPACE + yangName
-                    + UtilConstants.SEMI_COLAN;
+    public static String getJavaAttributeDefination(String javaAttributeTypePkg, String javaAttributeType,
+            String javaAttributeName) {
+
+        String attributeDefination = UtilConstants.PRIVATE
+                + UtilConstants.SPACE;
+
+        if (javaAttributeTypePkg != null) {
+            attributeDefination = attributeDefination
+                    + javaAttributeTypePkg + ".";
         }
-        return UtilConstants.PRIVATE + UtilConstants.SPACE + JavaIdentifierSyntax.getCaptialCase(yangName)
-        + UtilConstants.SPACE + yangName + UtilConstants.SEMI_COLAN;
+
+        attributeDefination = attributeDefination
+                + javaAttributeType
+                + UtilConstants.SPACE
+                + javaAttributeName
+                + UtilConstants.SEMI_COLAN;
+
+        return attributeDefination;
     }
 
     /**
@@ -117,37 +111,19 @@
     }
 
     /**
-     * Based on the file type and method type(s) and the YANG name of the
-     * method, generate the method definitions(s).
-     *
-     * @param genFileTypes type of file being generated
-     * @param yangName name if the attribute whose getter / setter is required.
-     * @param methodTypes getter and / or setter type of method indicator.
-     * @param returnType type return type of the method.
-     * @return based on the file type and method type(s) the method
-     *         definitions(s).
-     */
-    public static String getJavaMethodInfo(GeneratedFileType genFileTypes, String yangName,
-            GeneratedMethodTypes methodTypes, YangType<?> returnType) {
-
-        yangName = JavaIdentifierSyntax.getCamelCase(yangName);
-        return MethodsGenerator.constructMethodInfo(genFileTypes, yangName, methodTypes, returnType);
-    }
-
-    /**
      * Based on the file type and the YANG name of the file, generate the class
      * / interface definition close.
      *
-     * @param genFileTypes type of file being generated.
-     * @param yangName YANG name.
-     * @return corresponding textual java code information.
+     * @param genFileTypes type of file being generated
+     * @param yangName YANG name
+     * @return corresponding textual java code information
      */
-    public static String getJavaClassDefClose(GeneratedFileType genFileTypes, String yangName) {
+    public static String getJavaClassDefClose(int genFileTypes, String yangName) {
 
-        if (genFileTypes.equals(GeneratedFileType.INTERFACE)) {
+        if ((genFileTypes & GeneratedFileType.INTERFACE_MASK) != 0) {
 
             return UtilConstants.CLOSE_CURLY_BRACKET;
-        } else if (genFileTypes.equals(GeneratedFileType.BUILDER_CLASS)) {
+        } else if ((genFileTypes & GeneratedFileType.BUILDER_CLASS_MASK) != 0) {
 
             return UtilConstants.CLOSE_CURLY_BRACKET;
         }
diff --git a/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGenerator.java b/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGenerator.java
index 60d8c2a..ff275ae 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGenerator.java
+++ b/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaFileGenerator.java
@@ -18,22 +18,27 @@
 
 import java.io.File;
 import java.io.IOException;
-import java.util.LinkedList;
 import java.util.List;
 
-import org.onosproject.yangutils.translator.GeneratedFileType;
 import org.onosproject.yangutils.translator.tojava.AttributeInfo;
 import org.onosproject.yangutils.utils.UtilConstants;
 import org.onosproject.yangutils.utils.io.impl.CopyrightHeader;
 import org.onosproject.yangutils.utils.io.impl.FileSystemUtil;
 import org.onosproject.yangutils.utils.io.impl.JavaDocGen;
-import org.onosproject.yangutils.utils.io.impl.TempDataStore;
 import org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType;
+import org.onosproject.yangutils.utils.io.impl.TempDataStore;
 import org.onosproject.yangutils.utils.io.impl.TempDataStore.TempDataStoreType;
-
-import static org.slf4j.LoggerFactory.getLogger;
 import org.slf4j.Logger;
 
+import static org.onosproject.yangutils.translator.GeneratedFileType.BUILDER_CLASS_MASK;
+import static org.onosproject.yangutils.translator.GeneratedFileType.BUILDER_INTERFACE_MASK;
+import static org.onosproject.yangutils.translator.GeneratedFileType.IMPL_CLASS_MASK;
+import static org.onosproject.yangutils.translator.GeneratedFileType.INTERFACE_MASK;
+import static org.slf4j.LoggerFactory.getLogger;
+
+/**
+ * Generates java file.
+ */
 public final class JavaFileGenerator {
 
     private static final Logger log = getLogger(JavaFileGenerator.class);
@@ -45,21 +50,40 @@
     }
 
     /**
+     * Returns a file object for generated file.
+     *
+     * @param fileName file name
+     * @param filePath file package path
+     * @param extension file extension
+     * @return file object
+     */
+    public static File getFileObject(String filePath, String fileName, String extension) {
+        return new File(UtilConstants.YANG_GEN_DIR + filePath + File.separator + fileName + extension);
+    }
+
+    /**
      * Returns generated interface file for current node.
+     *
      * @param file file
      * @param className class name
      * @param imports imports for the file
      * @param attrList attribute info
      * @param pkg generated file package
      * @return interface file
-     * @throws IOException when fails to write in file.
+     * @throws IOException when fails to write in file
      */
     public static File generateInterfaceFile(File file, String className, List<String> imports,
             List<AttributeInfo> attrList, String pkg) throws IOException {
 
-        initiateFile(file, className, GeneratedFileType.INTERFACE, imports, pkg);
-        List<String> methods = getMethodStrings(TempDataStoreType.GETTER_METHODS, GeneratedFileType.INTERFACE,
-                className, file, attrList);
+        initiateFile(file, className, INTERFACE_MASK, imports, pkg);
+
+        List<String> methods;
+        try {
+            methods = TempDataStore.getTempData(TempDataStoreType.GETTER_METHODS, className);
+        } catch (ClassNotFoundException | IOException e) {
+            log.info("There is no attribute info of " + className + " YANG file in the temporary files.");
+            throw new IOException("Fail to read data from temp file.");
+        }
 
         /**
          * Add getter methods to interface file.
@@ -72,19 +96,26 @@
 
     /**
      * Return generated builder interface file for current node.
+     *
      * @param file file
      * @param className class name
      * @param pkg generated file package
      * @param attrList attribute info
      * @return builder interface file
-     * @throws IOException when fails to write in file.
+     * @throws IOException when fails to write in file
      */
     public static File generateBuilderInterfaceFile(File file, String className, String pkg,
             List<AttributeInfo> attrList) throws IOException {
 
-        initiateFile(file, className, GeneratedFileType.BUILDER_INTERFACE, null, pkg);
-        List<String> methods = getMethodStrings(TempDataStoreType.BUILDER_INTERFACE_METHODS,
-                GeneratedFileType.BUILDER_INTERFACE, className, file, attrList);
+        initiateFile(file, className, BUILDER_INTERFACE_MASK, null, pkg);
+        List<String> methods;
+        try {
+            methods = TempDataStore.getTempData(TempDataStoreType.BUILDER_INTERFACE_METHODS,
+                    className + UtilConstants.BUILDER + UtilConstants.INTERFACE);
+        } catch (ClassNotFoundException | IOException e) {
+            log.info("There is no attribute info of " + className + " YANG file in the temporary files.");
+            throw new IOException("Fail to read data from temp file.");
+        }
 
         /**
          * Add build method to builder interface file.
@@ -104,34 +135,54 @@
 
     /**
      * Returns generated builder class file for current node.
+     *
      * @param file file
      * @param className class name
      * @param imports imports for the file
      * @param pkg generated file package
      * @param attrList attribute info
      * @return builder class file
-     * @throws IOException when fails to write in file.
+     * @throws IOException when fails to write in file
      */
     public static File generateBuilderClassFile(File file, String className, List<String> imports, String pkg,
             List<AttributeInfo> attrList) throws IOException {
 
-        initiateFile(file, className, GeneratedFileType.BUILDER_CLASS, imports, pkg);
-        List<String> methods = getMethodStrings(TempDataStoreType.BUILDER_METHODS, GeneratedFileType.BUILDER_CLASS,
-                className, file, attrList);
+        initiateFile(file, className, BUILDER_CLASS_MASK, imports, pkg);
+
+        /**
+         * Add attribute strings.
+         */
+        List<String> attributes;
+        try {
+            attributes = TempDataStore.getTempData(TempDataStoreType.ATTRIBUTE, className);
+        } catch (ClassNotFoundException | IOException e) {
+            log.info("There is no attribute info of " + className + " YANG file in the temporary files.");
+            throw new IOException("Fail to read data from temp file.");
+        }
+        /**
+         * Add attributes to the file.
+         */
+        for (String attribute : attributes) {
+            insert(file, UtilConstants.NEW_LINE + UtilConstants.FOUR_SPACE_INDENTATION + attribute);
+        }
+        insert(file, UtilConstants.NEW_LINE);
+
+        List<String> methods;
+        try {
+            methods = TempDataStore.getTempData(TempDataStoreType.BUILDER_METHODS, className + UtilConstants.BUILDER);
+        } catch (ClassNotFoundException | IOException e) {
+            log.info("There is no attribute info of " + className + " YANG file in the temporary files.");
+            throw new IOException("Fail to read data from temp file.");
+        }
 
         /**
          * Add default constructor and build method impl.
          */
         methods.add(UtilConstants.NEW_LINE + UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.JAVA_DOC_FIRST_LINE
-                + MethodsGenerator.getDefaultConstructorString(GeneratedFileType.BUILDER_CLASS, className));
+                + MethodsGenerator.getDefaultConstructorString(BUILDER_CLASS_MASK, className));
         methods.add(MethodsGenerator.getBuildString(className));
 
         /**
-         * Add attribute strings.
-         */
-        addAttributeSring(file, className, attrList, GeneratedFileType.BUILDER_CLASS);
-
-        /**
          * Add methods in builder class.
          */
         for (String method : methods) {
@@ -142,30 +193,48 @@
 
     /**
      * Returns generated impl class file for current node.
+     *
      * @param file file
      * @param className class name
      * @param pkg generated file package
      * @param attrList attribute's info
      * @return impl class file
-     * @throws IOException when fails to write in file.
+     * @throws IOException when fails to write in file
      */
     public static File generateImplClassFile(File file, String className, String pkg, List<AttributeInfo> attrList)
             throws IOException {
 
-        initiateFile(file, className, GeneratedFileType.IMPL, null, pkg);
-        List<String> methods = getMethodStrings(TempDataStoreType.IMPL_METHODS, GeneratedFileType.IMPL, className, file,
-                attrList);
+        initiateFile(file, className, IMPL_CLASS_MASK, null, pkg);
+
+        List<String> attributes;
+        try {
+            attributes = TempDataStore.getTempData(TempDataStoreType.ATTRIBUTE, className);
+        } catch (ClassNotFoundException | IOException e) {
+            log.info("There is no attribute info of " + className + " YANG file in the temporary files.");
+            throw new IOException("Fail to read data from temp file.");
+        }
 
         /**
-         * Add attributes.
+         * Add attributes to the file.
          */
-        addAttributeSring(file, className, attrList, GeneratedFileType.IMPL);
+        for (String attribute : attributes) {
+            insert(file, UtilConstants.NEW_LINE + UtilConstants.FOUR_SPACE_INDENTATION + attribute);
+        }
+        insert(file, UtilConstants.NEW_LINE);
+
+        List<String> methods;
+        try {
+            methods = TempDataStore.getTempData(TempDataStoreType.IMPL_METHODS, className + UtilConstants.IMPL);
+        } catch (ClassNotFoundException | IOException e) {
+            log.info("There is no attribute info of " + className + " YANG file in the temporary files.");
+            throw new IOException("Fail to read data from temp file.");
+        }
 
         /**
          * Add default constructor and constructor methods.
          */
         methods.add(UtilConstants.JAVA_DOC_FIRST_LINE
-                + MethodsGenerator.getDefaultConstructorString(GeneratedFileType.IMPL, className));
+                + MethodsGenerator.getDefaultConstructorString(IMPL_CLASS_MASK, className));
         methods.add(MethodsGenerator.getConstructorString(className));
 
         /**
@@ -180,74 +249,6 @@
     }
 
     /**
-     * Adds attribute string for generated files.
-     *
-     * @param className class name
-     * @param file generated file
-     * @param attrList attribute info
-     * @param genFileType generated file type
-     * @param IOException when fails to add attributes in files.
-     */
-    private static void addAttributeSring(File file, String className, List<AttributeInfo> attrList,
-            GeneratedFileType genFileType) throws IOException {
-        List<String> attributes = new LinkedList<>();
-        try {
-            attributes = TempDataStore.getTempData(TempDataStoreType.ATTRIBUTE, className);
-        } catch (ClassNotFoundException | IOException e) {
-            log.info("There is no attribute info of " + className + " YANG file in the serialized files.");
-        }
-
-        if (attrList != null) {
-            MethodsGenerator.setAttrInfo(attrList);
-            for (AttributeInfo attr : attrList) {
-                if (attr.isListAttr()) {
-                    attr.setAttributeType(AttributesJavaDataType.getListString(attr));
-                }
-                attributes.add(getAttributeString(attr, genFileType));
-            }
-        }
-
-        /**
-         * Add attributes to the file.
-         */
-        for (String attribute : attributes) {
-            insert(file, UtilConstants.NEW_LINE + UtilConstants.FOUR_SPACE_INDENTATION + attribute);
-        }
-        insert(file, UtilConstants.NEW_LINE);
-    }
-
-    /**
-     * Returns method strings for generated files.
-     *
-     * @param dataStoreType temp data store file type.
-     * @param genFileType generated file type
-     * @param className generated file name
-     * @param attrList attribute info
-     * @return method strings
-     */
-    private static List<String> getMethodStrings(TempDataStoreType dataStoreType, GeneratedFileType genFileType,
-            String className, File file, List<AttributeInfo> attrList) {
-
-        List<String> methods = new LinkedList<>();
-        try {
-            methods = TempDataStore.getTempData(dataStoreType, className);
-        } catch (ClassNotFoundException | IOException e) {
-            log.info("There is no attribute info of " + className + " YANG file in the serialized files.");
-        }
-
-        if (attrList != null) {
-            MethodsGenerator.setAttrInfo(attrList);
-            for (AttributeInfo attr : attrList) {
-                if (attr.isListAttr()) {
-                    attr.setAttributeType(AttributesJavaDataType.getListString(attr));
-                }
-                methods.add(MethodsGenerator.getMethodString(attr, genFileType));
-            }
-        }
-        return methods;
-    }
-
-    /**
      * Initiate generation of file based on generated file type.
      *
      * @param file generated file
@@ -257,7 +258,7 @@
      * @param pkg generated file package
      * @throws IOException when fails to generate a file
      */
-    private static void initiateFile(File file, String className, GeneratedFileType type, List<String> imports,
+    private static void initiateFile(File file, String className, int type, List<String> imports,
             String pkg) throws IOException {
         try {
             file.createNewFile();
@@ -272,7 +273,7 @@
      *
      * @param appendFile temp file
      * @param srcFile main file
-     * @throws IOException when fails to append contents.
+     * @throws IOException when fails to append contents
      */
     public static void appendFileContents(File appendFile, File srcFile) throws IOException {
         try {
@@ -285,8 +286,9 @@
     /**
      * Append methods to the generated files.
      *
-     * @param file file in which method needs to be appended.
-     * @param method method which needs to be appended.
+     * @param file file in which method needs to be appended
+     * @param method method which needs to be appended
+     * @exception IOException file operation exceptions
      */
     private static void appendMethod(File file, String method) throws IOException {
         insert(file, method);
@@ -297,9 +299,9 @@
      *
      * @param fileType generate file type
      * @param yangName file name
-     * @return end of class definition string.
+     * @return end of class definition string
      */
-    public static String closeFile(GeneratedFileType fileType, String yangName) {
+    public static String closeFile(int fileType, String yangName) {
         return JavaCodeSnippetGen.getJavaClassDefClose(fileType, yangName);
     }
 
@@ -307,58 +309,56 @@
      * Parses attribute info and fetch specific data and creates serialized
      * files of it.
      *
-     * @param attr attribute info.
+     * @param attr attribute info
      * @param genFileType generated file type
      * @param className class name
      */
-    public static void parseAttributeInfo(AttributeInfo attr, GeneratedFileType genFileType, String className) {
+    public static void parseAttributeInfo(AttributeInfo attr, int genFileType, String className) {
 
         String attrString = "";
-        String methodString = "";
+        String builderInterfaceMethodString = "";
+        String builderClassMethodString = "";
+        String implClassMethodString = "";
         String getterString = "";
+        className = JavaIdentifierSyntax.getCaptialCase(className);
 
         try {
             /*
-             * Serialize attributes.
+             * Get the attribute definition and save attributes to temporary
+             * file.
              */
-            attrString = getAttributeString(attr, genFileType);
-            attrString = attrString.replace("\"", "");
+            attrString = JavaCodeSnippetGen.getJavaAttributeDefination(attr.getImportInfo().getPkgInfo(),
+                    attr.getImportInfo().getClassInfo(),
+                    attr.getAttributeName());
             TempDataStore.setTempData(attrString, TempDataStore.TempDataStoreType.ATTRIBUTE, className);
 
-            if (genFileType.equals(GeneratedFileType.ALL)) {
-
-                methodString = MethodsGenerator.getMethodString(attr, GeneratedFileType.INTERFACE);
-                TempDataStore.setTempData(methodString, TempDataStore.TempDataStoreType.GETTER_METHODS, className);
-
-                methodString = MethodsGenerator.getMethodString(attr, GeneratedFileType.BUILDER_CLASS);
-                TempDataStore.setTempData(methodString, TempDataStore.TempDataStoreType.BUILDER_METHODS, className);
-
-                methodString = MethodsGenerator.getMethodString(attr, GeneratedFileType.BUILDER_INTERFACE);
-                TempDataStore.setTempData(methodString, TempDataStore.TempDataStoreType.BUILDER_INTERFACE_METHODS,
-                        className);
-
-                methodString = MethodsGenerator.getMethodString(attr, GeneratedFileType.IMPL);
-                TempDataStore.setTempData(methodString, TempDataStore.TempDataStoreType.IMPL_METHODS, className);
-
-            } else if (genFileType.equals(GeneratedFileType.INTERFACE)) {
-
+            if ((genFileType & INTERFACE_MASK) != 0) {
                 getterString = MethodsGenerator.getGetterString(attr);
-                TempDataStore.setTempData(methodString, TempDataStore.TempDataStoreType.GETTER_METHODS, className);
+                TempDataStore.setTempData(getterString, TempDataStore.TempDataStoreType.GETTER_METHODS, className);
+            }
+
+            if ((genFileType & BUILDER_INTERFACE_MASK) != 0) {
+                builderInterfaceMethodString = MethodsGenerator.parseBuilderInterfaceMethodString(attr, className);
+                TempDataStore.setTempData(builderInterfaceMethodString,
+                        TempDataStore.TempDataStoreType.BUILDER_INTERFACE_METHODS,
+                        className + UtilConstants.BUILDER + UtilConstants.INTERFACE);
+            }
+
+            if ((genFileType & BUILDER_CLASS_MASK) != 0) {
+                builderClassMethodString = MethodsGenerator.parseBuilderMethodString(attr, className);
+                TempDataStore.setTempData(builderClassMethodString, TempDataStore.TempDataStoreType.BUILDER_METHODS,
+                        className + UtilConstants.BUILDER);
+            }
+
+            if ((genFileType & IMPL_CLASS_MASK) != 0) {
+                implClassMethodString = MethodsGenerator.parseImplMethodString(attr);
+                TempDataStore.setTempData(implClassMethodString, TempDataStore.TempDataStoreType.IMPL_METHODS,
+                        className + UtilConstants.IMPL);
             }
         } catch (IOException e) {
-            log.info("Failed to get data for " + attr.getAttributeName() + " from serialized files.");
+            log.info("Failed to set data for " + attr.getAttributeName() + " in temp data files.");
         }
-    }
 
-    /**
-     * Returns attribute string.
-     *
-     * @param attr attribute info
-     * @param genFileType generated file type
-     * @return attribute string
-     */
-    private static String getAttributeString(AttributeInfo attr, GeneratedFileType genFileType) {
-        return JavaCodeSnippetGen.getJavaAttributeInfo(genFileType, attr.getAttributeName(), attr.getAttributeType());
     }
 
     /**
@@ -368,20 +368,21 @@
      * @param fileName generated file name
      * @param type generated file type
      * @param pkg generated file package
-     * @throws IOException when fails to append contents.
+     * @param importsList list of java imports
+     * @throws IOException when fails to append contents
      */
-    private static void appendContents(File file, String fileName, GeneratedFileType type, List<String> importsList,
+    private static void appendContents(File file, String fileName, int type, List<String> importsList,
             String pkg) throws IOException {
 
-        if (type.equals(GeneratedFileType.IMPL)) {
+        if ((type & IMPL_CLASS_MASK) != 0) {
 
             write(file, fileName, type, JavaDocType.IMPL_CLASS);
-        } else if (type.equals(GeneratedFileType.BUILDER_INTERFACE)) {
+        } else if ((type & BUILDER_INTERFACE_MASK) != 0) {
 
             write(file, fileName, type, JavaDocType.BUILDER_INTERFACE);
         } else {
 
-            if (type.equals(GeneratedFileType.INTERFACE)) {
+            if ((type & INTERFACE_MASK) != 0) {
                 insert(file, CopyrightHeader.getCopyrightHeader());
                 insert(file, "package" + UtilConstants.SPACE + pkg + UtilConstants.SEMI_COLAN + UtilConstants.NEW_LINE);
                 if (importsList != null) {
@@ -391,9 +392,8 @@
                     }
                     insert(file, UtilConstants.NEW_LINE);
                 }
-                insert(file, UtilConstants.NEW_LINE);
                 write(file, fileName, type, JavaDocType.INTERFACE);
-            } else if (type.equals(GeneratedFileType.BUILDER_CLASS)) {
+            } else if ((type & BUILDER_CLASS_MASK) != 0) {
                 insert(file, CopyrightHeader.getCopyrightHeader());
                 insert(file, "package" + UtilConstants.SPACE + pkg + UtilConstants.SEMI_COLAN + UtilConstants.NEW_LINE);
                 if (importsList != null) {
@@ -403,7 +403,6 @@
                     }
                     insert(file, UtilConstants.NEW_LINE);
                 }
-                insert(file, UtilConstants.NEW_LINE);
                 write(file, fileName, type, JavaDocType.BUILDER_CLASS);
             }
         }
@@ -416,9 +415,9 @@
      * @param fileName file name
      * @param genType generated file type
      * @param javaDocType java doc type
-     * @throws IOException when fails to write into a file.
+     * @throws IOException when fails to write into a file
      */
-    private static void write(File file, String fileName, GeneratedFileType genType, JavaDocGen.JavaDocType javaDocType)
+    private static void write(File file, String fileName, int genType, JavaDocGen.JavaDocType javaDocType)
             throws IOException {
 
         insert(file, JavaDocGen.getJavaDoc(javaDocType, fileName));
@@ -428,8 +427,8 @@
     /**
      * Insert in the generated file.
      *
-     * @param file file in which need to be inserted.
-     * @param data data which need to be inserted.
+     * @param file file in which need to be inserted
+     * @param data data which need to be inserted
      * @throws IOException when fails to insert into file
      */
     public static void insert(File file, String data) throws IOException {
@@ -443,7 +442,7 @@
     /**
      * Removes temp files.
      *
-     * @param file file to be removed.
+     * @param file file to be removed
      */
     public static void clean(File file) {
         if (file.exists()) {
diff --git a/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaIdentifierSyntax.java b/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaIdentifierSyntax.java
index 58005b1..00e953b 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaIdentifierSyntax.java
+++ b/src/main/java/org/onosproject/yangutils/translator/tojava/utils/JavaIdentifierSyntax.java
@@ -34,10 +34,10 @@
     /**
      * Get the root package string.
      *
-     * @param version YANG version.
-     * @param nameSpace name space of the module.
+     * @param version YANG version
+     * @param nameSpace name space of the module
      * @param revision revision of the module defined
-     * @return returns the root package string.
+     * @return returns the root package string
      */
     public static String getRootPackage(byte version, String nameSpace, String revision) {
 
@@ -56,7 +56,7 @@
     /**
      * Returns version.
      *
-     * @param ver YANG version.
+     * @param ver YANG version
      * @return version
      */
     private static String getYangVersion(byte ver) {
@@ -67,7 +67,7 @@
      * Get package name from name space.
      *
      * @param nameSpace name space of YANG module
-     *  @return java package name as per java rules.
+     * @return java package name as per java rules
      */
     public static String getPkgFromNameSpace(String nameSpace) {
         ArrayList<String> pkgArr = new ArrayList<String>();
@@ -125,9 +125,9 @@
     /**
      * Get the package from parent's package and string.
      *
-     * @param parentPkg parent's package.
-     * @param parentName parent's name.
-     * @return package string.
+     * @param parentPkg parent's package
+     * @param parentName parent's name
+     * @return package string
      */
     public static String getPackageFromParent(String parentPkg, String parentName) {
         return (parentPkg + UtilConstants.PERIOD + getSubPkgFromName(parentName)).toLowerCase();
@@ -136,8 +136,8 @@
     /**
      * Get package sub name from YANG identifier name.
      *
-     * @param name YANG identifier name.
-     * @return java package sub name as per java rules.
+     * @param name YANG identifier name
+     * @return java package sub name as per java rules
      */
     public static String getSubPkgFromName(String name) {
         ArrayList<String> pkgArr = new ArrayList<String>();
@@ -152,22 +152,23 @@
     /**
      * Translate the YANG identifier name to java identifier.
      *
-     * @param yangIdentifier identifier in YANG file.
+     * @param yangIdentifier identifier in YANG file
      * @return corresponding java identifier
      */
     public static String getCamelCase(String yangIdentifier) {
         String[] strArray = yangIdentifier.split(UtilConstants.HYPHEN);
         String camelCase = strArray[0];
         for (int i = 1; i < strArray.length; i++) {
-            camelCase = camelCase + (strArray[i].substring(0, 1).toUpperCase() + strArray[i].substring(1));
+            camelCase = camelCase + strArray[i].substring(0, 1).toUpperCase() + strArray[i].substring(1);
         }
         return camelCase;
     }
 
     /**
-     * Translate the YANG identifier name to java identifier with first letter in caps.
+     * Translate the YANG identifier name to java identifier with first letter
+     * in caps.
      *
-     * @param yangIdentifier identifier in YANG file.
+     * @param yangIdentifier identifier in YANG file
      * @return corresponding java identifier
      */
     public static String getCaptialCase(String yangIdentifier) {
diff --git a/src/main/java/org/onosproject/yangutils/translator/tojava/utils/MethodsGenerator.java b/src/main/java/org/onosproject/yangutils/translator/tojava/utils/MethodsGenerator.java
index 3ffc5e2..e2e6211 100644
--- a/src/main/java/org/onosproject/yangutils/translator/tojava/utils/MethodsGenerator.java
+++ b/src/main/java/org/onosproject/yangutils/translator/tojava/utils/MethodsGenerator.java
@@ -16,12 +16,7 @@
 
 package org.onosproject.yangutils.translator.tojava.utils;
 
-import java.util.List;
-
-import org.onosproject.yangutils.datamodel.YangType;
-import org.onosproject.yangutils.translator.GeneratedFileType;
 import org.onosproject.yangutils.translator.tojava.AttributeInfo;
-import org.onosproject.yangutils.translator.tojava.GeneratedMethodTypes;
 import org.onosproject.yangutils.utils.UtilConstants;
 import org.onosproject.yangutils.utils.io.impl.JavaDocGen;
 
@@ -30,45 +25,6 @@
  */
 public final class MethodsGenerator {
 
-    private static String builderClassName;
-    private static List<AttributeInfo> attrInfo;
-
-    /**
-     * Sets the builder class name for setter methods of builder class.
-     *
-     * @param name builder class name
-     */
-    public static void setBuilderClassName(String name) {
-        builderClassName = name;
-    }
-
-    /**
-     * Sets the attribute info for the impl class's constructor method.
-     *
-     * @param attr list of attribute info
-     */
-    public static void setAttrInfo(List<AttributeInfo> attr) {
-        attrInfo = attr;
-    }
-
-    /**
-     * Returns attribute info for the impl class's constructor method.
-     *
-     * @return list of attribute info
-     */
-    public static List<AttributeInfo> getAttrInfo() {
-        return attrInfo;
-    }
-
-    /**
-     * Return the class name.
-     *
-     * @return class name
-     */
-    public static String getBuilderClassName() {
-        return builderClassName;
-    }
-
     /**
      * Default constructor.
      */
@@ -76,181 +32,106 @@
     }
 
     /**
-     * Return method strings.
-     *
-     * @param attr attribute info.
-     * @param type generated file type
-     * @return method string
-     */
-    public static String getMethodString(AttributeInfo attr, GeneratedFileType type) {
-
-        if (type.equals(GeneratedFileType.BUILDER_CLASS)) {
-
-            return parseBuilderMethodString(attr);
-        } else if (type.equals(GeneratedFileType.INTERFACE)) {
-
-            return getGetterString(attr);
-        } else if (type.equals(GeneratedFileType.BUILDER_INTERFACE)) {
-
-            return parseBuilderInterfaceMethodString(attr);
-        } else if (type.equals(GeneratedFileType.IMPL)) {
-
-            return parseImplMethodString(attr);
-        }
-        return null;
-    }
-
-    /**
-     * Returns constructed method impl for specific generated file type.
-     *
-     * @param genFileTypes generated file type
-     * @param yangName class name
-     * @param methodTypes method types
-     * @param returnType return type of method
-     * @return constructed method impl
-     */
-    public static String constructMethodInfo(GeneratedFileType genFileTypes, String yangName,
-            GeneratedMethodTypes methodTypes, YangType<?> returnType) {
-
-        if (returnType == null) {
-            YangType<?> type = new YangType();
-            type.setDataTypeName(yangName);
-            returnType = type;
-        }
-
-        if (genFileTypes.equals(GeneratedFileType.INTERFACE)) {
-
-            /**
-             * If interface, only getter will be there.
-             */
-            return getGetterForInterface(yangName, returnType);
-        } else if (genFileTypes.equals(GeneratedFileType.BUILDER_INTERFACE)) {
-
-            /**
-             * If builder interface, getters and setters will be there.
-             */
-            if (methodTypes.equals(GeneratedMethodTypes.GETTER)) {
-
-                return getGetterForInterface(yangName, returnType);
-            } else if (methodTypes.equals(GeneratedMethodTypes.SETTER)) {
-
-                return getSetterForInterface(yangName, returnType);
-            } else if (methodTypes.equals(GeneratedMethodTypes.BUILD)) {
-
-                return getBuildForInterface(yangName);
-            }
-        } else if (genFileTypes.equals(GeneratedFileType.BUILDER_CLASS)) {
-
-            /**
-             * If Builder class , getters, setters ,build and default constructor impls will be there.
-             */
-            if (methodTypes.equals(GeneratedMethodTypes.GETTER)) {
-
-                return getGetterForClass(yangName, returnType);
-            } else if (methodTypes.equals(GeneratedMethodTypes.SETTER)) {
-
-                return getSetterForClass(yangName, returnType);
-            } else if (methodTypes.equals(GeneratedMethodTypes.BUILD)) {
-
-                return getBuild(yangName);
-            } else if (methodTypes.equals(GeneratedMethodTypes.DEFAULT_CONSTRUCTOR)) {
-
-                return getDefaultConstructor(yangName + UtilConstants.BUILDER);
-            }
-        } else if (genFileTypes.equals(GeneratedFileType.IMPL)) {
-
-            if (methodTypes.equals(GeneratedMethodTypes.GETTER)) {
-
-                return getGetterForClass(yangName, returnType);
-            } else if (methodTypes.equals(GeneratedMethodTypes.CONSTRUCTOR)) {
-
-                return getConstructor(yangName);
-            } else if (methodTypes.equals(GeneratedMethodTypes.DEFAULT_CONSTRUCTOR)) {
-
-                return getDefaultConstructor(yangName + UtilConstants.IMPL);
-            }
-        }
-        return null;
-    }
-
-    /**
      * Returns the methods strings for builder class.
      *
-     * @param attr attribute info.
-     * @return method string for builder class.
+     * @param attr attribute info
+     * @param className java class name
+     * @return method string for builder class
      */
-    private static String parseBuilderMethodString(AttributeInfo attr) {
+    static String parseBuilderMethodString(AttributeInfo attr, String className) {
+        String attrQuaifiedType = "";
+        if (attr.getImportInfo().getPkgInfo() != null) {
+            attrQuaifiedType = attr.getImportInfo().getPkgInfo() + ".";
+        }
+        attrQuaifiedType = attrQuaifiedType + attr.getImportInfo().getClassInfo();
 
-        String overrideString = UtilConstants.NEW_LINE + UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.OVERRIDE
-                + UtilConstants.NEW_LINE;
-        String getterString = JavaCodeSnippetGen.getJavaMethodInfo(GeneratedFileType.BUILDER_CLASS,
-                attr.getAttributeName(), GeneratedMethodTypes.GETTER, attr.getAttributeType());
-        String setterString = JavaCodeSnippetGen.getJavaMethodInfo(GeneratedFileType.BUILDER_CLASS,
-                attr.getAttributeName(), GeneratedMethodTypes.SETTER, attr.getAttributeType());
+        String overrideString = UtilConstants.NEW_LINE + UtilConstants.FOUR_SPACE_INDENTATION
+                + UtilConstants.OVERRIDE + UtilConstants.NEW_LINE;
+        String getterString = getGetterForClass(attr.getAttributeName(), attrQuaifiedType);
+        String setterString = getSetterForClass(attr.getAttributeName(), attrQuaifiedType, className);
         return overrideString + getterString + UtilConstants.NEW_LINE + overrideString + setterString;
     }
 
     /**
      * Returns the methods strings for builder class.
      *
-     * @param attr attribute info.
-     * @return method string for builder class.
+     * @param attr attribute info
+     * @return method string for builder class
      */
-    private static String parseImplMethodString(AttributeInfo attr) {
+    static String parseImplMethodString(AttributeInfo attr) {
+
+        String attrQuaifiedType = "";
+        if (attr.getImportInfo().getPkgInfo() != null) {
+            attrQuaifiedType = attr.getImportInfo().getPkgInfo() + ".";
+        }
+        attrQuaifiedType = attrQuaifiedType + attr.getImportInfo().getClassInfo();
 
         return UtilConstants.NEW_LINE + UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.OVERRIDE
-                + UtilConstants.NEW_LINE + JavaCodeSnippetGen.getJavaMethodInfo(GeneratedFileType.BUILDER_CLASS,
-                        attr.getAttributeName(), GeneratedMethodTypes.GETTER, attr.getAttributeType());
+                + UtilConstants.NEW_LINE + getGetterForClass(attr.getAttributeName(), attrQuaifiedType);
     }
 
     /**
      * Returns the methods strings for builder interface.
      *
-     * @param attr attribute info.
-     * @return method string for builder interface.
+     * @param attr attribute info
+     * @param className name of the java class being generated
+     * @return method string for builder interface
      */
-    private static String parseBuilderInterfaceMethodString(AttributeInfo attr) {
+    static String parseBuilderInterfaceMethodString(AttributeInfo attr, String className) {
 
-        return getGetterString(attr) + UtilConstants.NEW_LINE + getSetterString(attr);
+        return getGetterString(attr) + UtilConstants.NEW_LINE + getSetterString(attr, className);
     }
 
     /**
      * Returns the methods strings for builder interface.
      *
-     * @param name attribute name.
-     * @return method string for builder interface.
+     * @param name attribute name
+     * @return method string for builder interface
      */
     public static String parseBuilderInterfaceBuildMethodString(String name) {
 
-        return JavaDocGen.getJavaDoc(JavaDocGen.JavaDocType.BUILD, name) + JavaCodeSnippetGen
-                .getJavaMethodInfo(GeneratedFileType.BUILDER_INTERFACE, name, GeneratedMethodTypes.BUILD, null);
+        return JavaDocGen.getJavaDoc(JavaDocGen.JavaDocType.BUILD, name)
+                + getBuildForInterface(name);
     }
 
     /**
      * Returns getter string.
      *
-     * @param attr attribute info.
+     * @param attr attribute info
      * @return getter string
      */
     public static String getGetterString(AttributeInfo attr) {
 
+        String returnType = "";
+        if (attr.getImportInfo().getPkgInfo() != null) {
+            returnType = attr.getImportInfo().getPkgInfo() + ".";
+        }
+
+        returnType = returnType + attr.getImportInfo().getClassInfo();
+
         return JavaDocGen.getJavaDoc(JavaDocGen.JavaDocType.GETTER, attr.getAttributeName())
-                + JavaCodeSnippetGen.getJavaMethodInfo(GeneratedFileType.INTERFACE, attr.getAttributeName(),
-                        GeneratedMethodTypes.GETTER, attr.getAttributeType())
+                + getGetterForInterface(attr.getAttributeName(), returnType)
                 + UtilConstants.NEW_LINE;
     }
 
     /**
      * Returns setter string.
      *
-     * @param attr attribute info.
+     * @param attr attribute info
+     * @param className java class name
      * @return setter string
      */
-    private static String getSetterString(AttributeInfo attr) {
+    private static String getSetterString(AttributeInfo attr, String className) {
+
+        String attrType = "";
+        if (attr.getImportInfo().getPkgInfo() != null) {
+            attrType = attr.getImportInfo().getPkgInfo() + ".";
+        }
+
+        attrType = attrType + attr.getImportInfo().getClassInfo();
 
         return JavaDocGen.getJavaDoc(JavaDocGen.JavaDocType.SETTER, attr.getAttributeName())
-                + JavaCodeSnippetGen.getJavaMethodInfo(GeneratedFileType.BUILDER_INTERFACE, attr.getAttributeName(),
-                        GeneratedMethodTypes.SETTER, attr.getAttributeType());
+                + getSetterForInterface(attr.getAttributeName(), attrType, className);
     }
 
     /**
@@ -261,8 +142,8 @@
      */
     public static String getConstructorString(String name) {
 
-        return JavaDocGen.getJavaDoc(JavaDocGen.JavaDocType.CONSTRUCTOR, name) + JavaCodeSnippetGen
-                .getJavaMethodInfo(GeneratedFileType.IMPL, name, GeneratedMethodTypes.CONSTRUCTOR, null);
+        return JavaDocGen.getJavaDoc(JavaDocGen.JavaDocType.CONSTRUCTOR, name)
+                + getConstructor(name);
     }
 
     /**
@@ -272,10 +153,10 @@
      * @param name class name
      * @return default constructor string
      */
-    public static String getDefaultConstructorString(GeneratedFileType type, String name) {
+    public static String getDefaultConstructorString(int type, String name) {
 
         return JavaDocGen.getJavaDoc(JavaDocGen.JavaDocType.DEFAULT_CONSTRUCTOR, name)
-                + JavaCodeSnippetGen.getJavaMethodInfo(type, name, GeneratedMethodTypes.DEFAULT_CONSTRUCTOR, null);
+                + getDefaultConstructor(name + UtilConstants.BUILDER);
     }
 
     /**
@@ -287,83 +168,85 @@
     public static String getBuildString(String name) {
 
         return UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.OVERRIDE + UtilConstants.NEW_LINE
-                + JavaCodeSnippetGen.getJavaMethodInfo(GeneratedFileType.BUILDER_CLASS, name,
-                        GeneratedMethodTypes.BUILD, null);
+                + getBuild(name);
     }
 
     /**
      * Returns the getter method strings for class file.
      *
-     * @param yangName name of the attribute.
-     * @param returnType return type of attribute
-     * @return getter method for class.
+     * @param attrName name of the attribute
+     * @param attrType return type of attribute
+     * @return getter method for class
      */
-    private static String getGetterForClass(String yangName, YangType<?> returnType) {
+    private static String getGetterForClass(String attrName, String attrType) {
 
         return UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.PUBLIC + UtilConstants.SPACE
-                + JavaIdentifierSyntax.getCaptialCase(returnType.getDataTypeName()) + UtilConstants.SPACE
-                + UtilConstants.GET_METHOD_PREFIX + JavaIdentifierSyntax.getCaptialCase(yangName)
-                + UtilConstants.OPEN_PARENTHESIS + UtilConstants.CLOSE_PARENTHESIS + UtilConstants.SPACE
-                + UtilConstants.OPEN_CURLY_BRACKET + UtilConstants.NEW_LINE + UtilConstants.EIGHT_SPACE_INDENTATION
-                + UtilConstants.RETURN + UtilConstants.SPACE + yangName + UtilConstants.SEMI_COLAN
-                + UtilConstants.NEW_LINE + UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.CLOSE_CURLY_BRACKET;
+                + attrType + UtilConstants.SPACE + UtilConstants.GET_METHOD_PREFIX
+                + JavaIdentifierSyntax.getCaptialCase(attrName) + UtilConstants.OPEN_PARENTHESIS
+                + UtilConstants.CLOSE_PARENTHESIS + UtilConstants.SPACE + UtilConstants.OPEN_CURLY_BRACKET
+                + UtilConstants.NEW_LINE + UtilConstants.EIGHT_SPACE_INDENTATION + UtilConstants.RETURN
+                + UtilConstants.SPACE + attrName + UtilConstants.SEMI_COLAN + UtilConstants.NEW_LINE
+                + UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.CLOSE_CURLY_BRACKET;
     }
 
     /**
      * Returns the setter method strings for class file.
      *
-     * @param yangName name of the attribute.
-     * @param returnType return type of attribute
-     * @return setter method for class.
+     * @param attrName name of the attribute
+     * @param attrType return type of attribute
+     * @param className name of the class
+     * @return setter method for class
      */
-    private static String getSetterForClass(String yangName, YangType<?> returnType) {
+    private static String getSetterForClass(String attrName, String attrType, String className) {
 
-        return UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.PUBLIC + UtilConstants.SPACE + getBuilderClassName()
-        + UtilConstants.SPACE + UtilConstants.SET_METHOD_PREFIX + JavaIdentifierSyntax.getCaptialCase(yangName)
-        + UtilConstants.OPEN_PARENTHESIS + JavaIdentifierSyntax.getCaptialCase(returnType.getDataTypeName())
-        + UtilConstants.SPACE + yangName + UtilConstants.CLOSE_PARENTHESIS + UtilConstants.SPACE
-        + UtilConstants.OPEN_CURLY_BRACKET + UtilConstants.NEW_LINE + UtilConstants.EIGHT_SPACE_INDENTATION
-        + UtilConstants.THIS + UtilConstants.PERIOD + yangName + UtilConstants.SPACE + UtilConstants.EQUAL
-        + UtilConstants.SPACE + yangName + UtilConstants.SEMI_COLAN + UtilConstants.NEW_LINE
-        + UtilConstants.EIGHT_SPACE_INDENTATION + UtilConstants.RETURN + UtilConstants.SPACE
-        + UtilConstants.THIS + UtilConstants.SEMI_COLAN + UtilConstants.NEW_LINE
-        + UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.CLOSE_CURLY_BRACKET;
+        return UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.PUBLIC + UtilConstants.SPACE
+                + className + UtilConstants.BUILDER + UtilConstants.SPACE + UtilConstants.SET_METHOD_PREFIX
+                + JavaIdentifierSyntax.getCaptialCase(attrName) + UtilConstants.OPEN_PARENTHESIS
+                + attrType + UtilConstants.SPACE + attrName + UtilConstants.CLOSE_PARENTHESIS
+                + UtilConstants.SPACE + UtilConstants.OPEN_CURLY_BRACKET + UtilConstants.NEW_LINE
+                + UtilConstants.EIGHT_SPACE_INDENTATION + UtilConstants.THIS + UtilConstants.PERIOD
+                + attrName + UtilConstants.SPACE + UtilConstants.EQUAL + UtilConstants.SPACE + attrName
+                + UtilConstants.SEMI_COLAN + UtilConstants.NEW_LINE + UtilConstants.EIGHT_SPACE_INDENTATION
+                + UtilConstants.RETURN + UtilConstants.SPACE + UtilConstants.THIS + UtilConstants.SEMI_COLAN
+                + UtilConstants.NEW_LINE + UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.CLOSE_CURLY_BRACKET;
     }
 
     /**
      * Returns the getter method strings for interface file.
      *
-     * @param yangName name of the attribute.
+     * @param yangName name of the attribute
      * @param returnType return type of attribute
-     * @return getter method for interface.
+     * @return getter method for interface
      */
-    private static String getGetterForInterface(String yangName, YangType<?> returnType) {
-        returnType.setDataTypeName(returnType.getDataTypeName().replace("\"", ""));
-        return UtilConstants.FOUR_SPACE_INDENTATION + JavaIdentifierSyntax.getCaptialCase(returnType.getDataTypeName())
-        + UtilConstants.SPACE + UtilConstants.GET_METHOD_PREFIX + JavaIdentifierSyntax.getCaptialCase(yangName)
-        + UtilConstants.OPEN_PARENTHESIS + UtilConstants.CLOSE_PARENTHESIS + UtilConstants.SEMI_COLAN;
+    private static String getGetterForInterface(String yangName, String returnType) {
+        return UtilConstants.FOUR_SPACE_INDENTATION + returnType
+                + UtilConstants.SPACE + UtilConstants.GET_METHOD_PREFIX
+                + JavaIdentifierSyntax.getCaptialCase(yangName)
+                + UtilConstants.OPEN_PARENTHESIS + UtilConstants.CLOSE_PARENTHESIS
+                + UtilConstants.SEMI_COLAN;
     }
 
     /**
      * Returns the setter method strings for interface file.
      *
-     * @param yangName name of the attribute.
-     * @param returnType return type of attribute
-     * @return setter method for interface.
+     * @param attrName name of the attribute
+     * @param attrType return type of attribute
+     * @param className name of the java class being generated
+     * @return setter method for interface
      */
-    private static String getSetterForInterface(String yangName, YangType<?> returnType) {
-        return UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.BUILDER + UtilConstants.SPACE
-                + UtilConstants.SET_METHOD_PREFIX + JavaIdentifierSyntax.getCaptialCase(yangName)
-                + UtilConstants.OPEN_PARENTHESIS + JavaIdentifierSyntax.getCaptialCase(returnType.getDataTypeName())
-                + UtilConstants.SPACE + yangName + UtilConstants.CLOSE_PARENTHESIS + UtilConstants.SEMI_COLAN;
+    private static String getSetterForInterface(String attrName, String attrType, String className) {
+        return UtilConstants.FOUR_SPACE_INDENTATION + className + UtilConstants.BUILDER
+                + UtilConstants.SPACE + UtilConstants.SET_METHOD_PREFIX
+                + JavaIdentifierSyntax.getCaptialCase(attrName) + UtilConstants.OPEN_PARENTHESIS
+                + attrType + UtilConstants.SPACE + attrName + UtilConstants.CLOSE_PARENTHESIS
+                + UtilConstants.SEMI_COLAN;
     }
 
     /**
      * Returns the build method strings for interface file.
      *
-     * @param yangName name of the attribute.
-     * @param returnType return type of attribute
-     * @return build method for interface.
+     * @param yangName name of the interface
+     * @return build method for interface
      */
     private static String getBuildForInterface(String yangName) {
 
@@ -374,30 +257,33 @@
     /**
      * Returns the constructor strings for class file.
      *
-     * @param yangName name of the class.
+     * @param yangName name of the class
      * @return constructor for class
      */
     private static String getConstructor(String yangName) {
 
-        String builderAttribute = (yangName.substring(0, 1).toLowerCase() + yangName.substring(1));
+        String builderAttribute = yangName.substring(0, 1).toLowerCase() + yangName.substring(1);
         String constructor = UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.PUBLIC + UtilConstants.SPACE
                 + yangName + UtilConstants.IMPL + UtilConstants.OPEN_PARENTHESIS + yangName + UtilConstants.BUILDER
                 + UtilConstants.SPACE + builderAttribute + UtilConstants.OBJECT + UtilConstants.CLOSE_PARENTHESIS
                 + UtilConstants.SPACE + UtilConstants.OPEN_CURLY_BRACKET + UtilConstants.NEW_LINE;
 
-        if (getAttrInfo() != null) {
-            for (AttributeInfo attribute : getAttrInfo()) {
-                attribute.setAttributeName(JavaIdentifierSyntax.getCamelCase(attribute.getAttributeName()));
-                constructor = constructor + UtilConstants.TWELVE_SPACE_INDENTATION + UtilConstants.THIS
-                        + UtilConstants.PERIOD + attribute.getAttributeName() + UtilConstants.SPACE
-                        + UtilConstants.EQUAL + UtilConstants.SPACE + builderAttribute + UtilConstants.OBJECT
-                        + UtilConstants.PERIOD + UtilConstants.GET_METHOD_PREFIX
-                        + JavaIdentifierSyntax.getCaptialCase(attribute.getAttributeName())
-                        + UtilConstants.OPEN_PARENTHESIS + UtilConstants.CLOSE_PARENTHESIS + UtilConstants.SEMI_COLAN
-                        + UtilConstants.NEW_LINE;
-            }
-            getAttrInfo().clear();
-        }
+        //        TODO: need to get the partial constructor from constructor temp file.
+        //        if (getAttrInfo() != null) {
+        //            for (AttributeInfo attribute : getAttrInfo()) {
+        //                attribute.setAttributeName(JavaIdentifierSyntax.getCamelCase(attribute.getAttributeName()));
+        //                constructor = constructor + UtilConstants.TWELVE_SPACE_INDENTATION + UtilConstants.THIS
+        //                        + UtilConstants.PERIOD + attribute.getAttributeName() + UtilConstants.SPACE
+        //                        + UtilConstants.EQUAL + UtilConstants.SPACE + builderAttribute + UtilConstants.OBJECT
+        //                        + UtilConstants.PERIOD + UtilConstants.GET_METHOD_PREFIX
+        //                        + JavaIdentifierSyntax.getCaptialCase(attribute.getAttributeName())
+        //                        + UtilConstants.OPEN_PARENTHESIS
+        //        + UtilConstants.CLOSE_PARENTHESIS + UtilConstants.SEMI_COLAN
+        //                        + UtilConstants.NEW_LINE;
+        //            }
+        //            getAttrInfo().clear();
+        //        }
+
         return constructor + UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.CLOSE_CURLY_BRACKET;
     }
 
@@ -405,7 +291,7 @@
      * Returns the build method strings for class file.
      *
      * @param yangName class name
-     * @return build method string for class.
+     * @return build method string for class
      */
     private static String getBuild(String yangName) {
 
@@ -422,7 +308,7 @@
     /**
      * Returns the Default constructor strings for class file.
      *
-     * @param yangName name of the class.
+     * @param name name of the class
      * @return Default constructor for class
      */
     private static String getDefaultConstructor(String name) {
diff --git a/src/main/java/org/onosproject/yangutils/utils/UtilConstants.java b/src/main/java/org/onosproject/yangutils/utils/UtilConstants.java
index 637d2f4..f596bf8 100644
--- a/src/main/java/org/onosproject/yangutils/utils/UtilConstants.java
+++ b/src/main/java/org/onosproject/yangutils/utils/UtilConstants.java
@@ -34,7 +34,7 @@
     public static final String BUILDER_CLASS_JAVA_DOC = " * Provides the builder implementation of ";
     public static final String INTERFACE_JAVA_DOC = " * Abstraction of an entity which provides functionalities of ";
     public static final String BUILDER_INTERFACE_JAVA_DOC = " * Builder for ";
-    public static final String PACKAGE_INFO_JAVADOC = " * Generated java code for the YANG file ";
+    public static final String PACKAGE_INFO_JAVADOC = " * Generated java code corresponding to YANG ";
     public static final String JAVA_DOC_FIRST_LINE = "/**\n";
     public static final String JAVA_DOC_END_LINE = " */\n";
     public static final String JAVA_DOC_PARAM = " * @param ";
@@ -93,7 +93,7 @@
     /**
      * For directories.
      */
-    public static final String YANG_GEN_DIR = "src/main/yangmodal/";
+    public static final String YANG_GEN_DIR = "src/main/yangmodel/";
     public static final String DEFAULT_BASE_PKG = "org.onosproject.yang.gen";
     public static final String REVISION_PREFIX = "rev";
     public static final String VERSION_PREFIX = "v";
@@ -108,17 +108,91 @@
     /**
      * For data types.
      */
-    public static final String INT = "int";
+    /**
+     * Void java type.
+     */
     public static final String VOID = "void";
-    public static final String SHORT = "short";
-    public static final String LONG = "long";
-    public static final String BOOLEAN = "boolean";
+
+    /**
+     * String built in java type.
+     */
     public static final String STRING = "String";
-    public static final String FLOAT = "float";
+    /**
+     * java.lang.* packages.
+     */
+    public static final String JAVA_LANG = "java.lang";
+
+    /**
+     * boolean built in java type.
+     */
+    public static final String BOOLEAN = "boolean";
+
+    /**
+     * byte java built in type.
+     */
     public static final String BYTE = "byte";
+
+    /**
+     * short java built in type.
+     */
+    public static final String SHORT = "short";
+
+    /**
+     * int java built in type.
+     */
+    public static final String INT = "int";
+
+    /**
+     * long java built in type.
+     */
+    public static final String LONG = "long";
+
+    /**
+     * float java built in type.
+     */
+    public static final String FLOAT = "float";
+
+    /**
+     * double java built in type.
+     */
     public static final String DOUBLE = "double";
 
     /**
+     * boolean built in java wrapper type.
+     */
+    public static final String BOOLEAN_WRAPPER = "Boolean";
+
+    /**
+     * byte java built in wrapper type.
+     */
+    public static final String BYTE_WRAPPER = "Byte";
+
+    /**
+     * short java built in wrapper type.
+     */
+    public static final String SHORT_WRAPPER = "Short";
+
+    /**
+     * Integer java built in wrapper type.
+     */
+    public static final String INTEGER_WRAPPER = "Integer";
+
+    /**
+     * long java built in wrapper type.
+     */
+    public static final String LONG_WRAPPER = "Long";
+
+    /**
+     * float java built in wrapper type.
+     */
+    public static final String FLOAT_WRAPPER = "Float";
+
+    /**
+     * double java built in wrapper type.
+     */
+    public static final String DOUBLE_WRAPPER = "Double";
+
+    /**
      * For idenifiers.
      */
     public static final String CLASS = "class";
diff --git a/src/main/java/org/onosproject/yangutils/utils/YangConstructType.java b/src/main/java/org/onosproject/yangutils/utils/YangConstructType.java
index 626674d..89fb449 100644
--- a/src/main/java/org/onosproject/yangutils/utils/YangConstructType.java
+++ b/src/main/java/org/onosproject/yangutils/utils/YangConstructType.java
@@ -242,8 +242,8 @@
     /**
      * Returns the YANG construct keyword corresponding to enum values.
      *
-     * @param yangConstructType enum value for parsable data type
-     * @return YANG construct keyword
+     * @param yangConstructType enum value for parsable data type.
+     * @return YANG construct keyword.
      */
     public static String getYangConstructType(YangConstructType yangConstructType) {
 
diff --git a/src/main/java/org/onosproject/yangutils/utils/io/impl/CopyrightHeader.java b/src/main/java/org/onosproject/yangutils/utils/io/impl/CopyrightHeader.java
index 3ba2fc6..27f1036 100644
--- a/src/main/java/org/onosproject/yangutils/utils/io/impl/CopyrightHeader.java
+++ b/src/main/java/org/onosproject/yangutils/utils/io/impl/CopyrightHeader.java
@@ -24,9 +24,10 @@
 import java.io.InputStream;
 import java.io.OutputStream;
 
-import static org.slf4j.LoggerFactory.getLogger;
 import org.slf4j.Logger;
 
+import static org.slf4j.LoggerFactory.getLogger;
+
 /**
  * Provides the license header for the generated files.
  */
@@ -48,7 +49,7 @@
      * Returns copyright file header.
      *
      * @return copyright file header
-     * @throws IOException when fails to parse copyright header.
+     * @throws IOException when fails to parse copyright header
      */
     public static String getCopyrightHeader() throws IOException {
         return copyrightHeader;
@@ -66,7 +67,7 @@
     /**
      * parse Copyright to the temporary file.
      *
-     * @throws IOException when fails to get the copyright header.
+     * @throws IOException when fails to get the copyright header
      */
     public static void parseCopyrightHeader() throws IOException {
 
diff --git a/src/main/java/org/onosproject/yangutils/utils/io/impl/FileSystemUtil.java b/src/main/java/org/onosproject/yangutils/utils/io/impl/FileSystemUtil.java
index 8a537f5..7181a62 100644
--- a/src/main/java/org/onosproject/yangutils/utils/io/impl/FileSystemUtil.java
+++ b/src/main/java/org/onosproject/yangutils/utils/io/impl/FileSystemUtil.java
@@ -24,7 +24,6 @@
 import java.io.PrintWriter;
 
 import org.onosproject.yangutils.translator.CachedFileHandle;
-import org.onosproject.yangutils.translator.GeneratedFileType;
 import org.onosproject.yangutils.translator.tojava.CachedJavaFileHandle;
 import org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax;
 import org.onosproject.yangutils.utils.UtilConstants;
@@ -42,8 +41,8 @@
     /**
      * Check if the package directory structure created.
      *
-     * @param pkg Package to check if it is created.
-     * @return existence status of package.
+     * @param pkg Package to check if it is created
+     * @return existence status of package
      */
     public static boolean doesPackageExist(String pkg) {
         File pkgDir = new File(pkg.replace(UtilConstants.PERIOD, UtilConstants.SLASH));
@@ -76,13 +75,16 @@
     /**
      * Create a java source file in the specified package.
      *
-     * @param pkg java package under which the interface file needs to be created.
-     * @param yangName YANG name of the node for which java file needs to be created.
-     * @param types types of files to be created.
-     * @throws IOException when fails to create interface file.
-     * @return the cached java file handle, which can be used to further add methods.
+     * @param pkg java package under which the interface file needs to be
+     *            created
+     * @param yangName YANG name of the node for which java file needs to be
+     *            created
+     * @param types types of files to be created
+     * @throws IOException when fails to create interface file
+     * @return the cached java file handle, which can be used to further add
+     *         methods
      */
-    public static CachedFileHandle createSourceFiles(String pkg, String yangName, GeneratedFileType types)
+    public static CachedFileHandle createSourceFiles(String pkg, String yangName, int types)
             throws IOException {
         yangName = JavaIdentifierSyntax.getCamelCase(yangName);
         CachedFileHandle handler = new CachedJavaFileHandle(pkg, yangName, types);
@@ -95,10 +97,10 @@
      * file.
      *
      * @param toAppend destination file in which the contents of source file is
-     *            appended.
+     *            appended
      * @param srcFile source file from which data is read and added to to append
-     *            file.
-     * @throws IOException any IO errors.
+     *            file
+     * @throws IOException any IO errors
      */
     public static void appendFileContents(File toAppend, File srcFile) throws IOException {
 
@@ -109,8 +111,8 @@
     /**
      * Reads file and convert it to string.
      *
-     * @param toAppend file to be converted.
-     * @return string of file.
+     * @param toAppend file to be converted
+     * @return string of file
      * @throws IOException when fails to convert to string
      */
     private static String readAppendFile(String toAppend) throws IOException {
@@ -134,8 +136,8 @@
      * Insert content to the generated file.
      *
      * @param inputFile input file
-     * @param contentTobeAdded content to be appended to the file.
-     * @throws IOException when fails to append content to the file.
+     * @param contentTobeAdded content to be appended to the file
+     * @throws IOException when fails to append content to the file
      */
     public static void insertStringInFile(File inputFile, String contentTobeAdded) throws IOException {
         FileWriter fileWriter = new FileWriter(inputFile, true);
diff --git a/src/main/java/org/onosproject/yangutils/utils/io/impl/JavaDocGen.java b/src/main/java/org/onosproject/yangutils/utils/io/impl/JavaDocGen.java
index 4be5037..c2f170c 100644
--- a/src/main/java/org/onosproject/yangutils/utils/io/impl/JavaDocGen.java
+++ b/src/main/java/org/onosproject/yangutils/utils/io/impl/JavaDocGen.java
@@ -91,7 +91,7 @@
      *
      * @param type java doc type
      * @param name name of the YangNode
-     * @return javadocs.
+     * @return javadocs
      */
     public static String getJavaDoc(JavaDocType type, String name) {
         name = JavaIdentifierSyntax.getCamelCase(name);
@@ -127,12 +127,12 @@
      * @return javaDocs
      */
     private static String generateForGetters(String attribute) {
-        return (UtilConstants.NEW_LINE + UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.JAVA_DOC_FIRST_LINE
+        return UtilConstants.NEW_LINE + UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.JAVA_DOC_FIRST_LINE
                 + UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.JAVA_DOC_GETTERS + attribute
                 + UtilConstants.PERIOD + UtilConstants.NEW_LINE + UtilConstants.FOUR_SPACE_INDENTATION
                 + UtilConstants.NEW_LINE_ESTRIC + UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.JAVA_DOC_RETURN
                 + attribute + UtilConstants.NEW_LINE + UtilConstants.FOUR_SPACE_INDENTATION
-                + UtilConstants.JAVA_DOC_END_LINE);
+                + UtilConstants.JAVA_DOC_END_LINE;
     }
 
     /**
@@ -142,58 +142,58 @@
      * @return javaDocs
      */
     private static String generateForSetters(String attribute) {
-        return (UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.JAVA_DOC_FIRST_LINE
+        return UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.JAVA_DOC_FIRST_LINE
                 + UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.JAVA_DOC_SETTERS + attribute
                 + UtilConstants.PERIOD + UtilConstants.NEW_LINE + UtilConstants.FOUR_SPACE_INDENTATION
                 + UtilConstants.NEW_LINE_ESTRIC + UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.JAVA_DOC_PARAM
                 + attribute + UtilConstants.SPACE + attribute + UtilConstants.NEW_LINE
                 + UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.JAVA_DOC_RETURN + UtilConstants.BUILDER_OBJECT
                 + attribute + UtilConstants.NEW_LINE + UtilConstants.FOUR_SPACE_INDENTATION
-                + UtilConstants.JAVA_DOC_END_LINE);
+                + UtilConstants.JAVA_DOC_END_LINE;
     }
 
     /**
      * Generate javaDocs for the impl class.
      *
      * @param className class name
-     * @return javaDocs.
+     * @return javaDocs
      */
     private static String generateForImplClass(String className) {
-        return (UtilConstants.JAVA_DOC_FIRST_LINE + UtilConstants.IMPL_CLASS_JAVA_DOC + className + UtilConstants.PERIOD
-                + UtilConstants.NEW_LINE + UtilConstants.JAVA_DOC_END_LINE);
+        return UtilConstants.JAVA_DOC_FIRST_LINE + UtilConstants.IMPL_CLASS_JAVA_DOC + className + UtilConstants.PERIOD
+                + UtilConstants.NEW_LINE + UtilConstants.JAVA_DOC_END_LINE;
     }
 
     /**
      * Generate javaDocs for the builder class.
      *
      * @param className class name
-     * @return javaDocs.
+     * @return javaDocs
      */
     private static String generateForBuilderClass(String className) {
-        return (UtilConstants.JAVA_DOC_FIRST_LINE + UtilConstants.BUILDER_CLASS_JAVA_DOC + className
-                + UtilConstants.PERIOD + UtilConstants.NEW_LINE + UtilConstants.JAVA_DOC_END_LINE);
+        return UtilConstants.JAVA_DOC_FIRST_LINE + UtilConstants.BUILDER_CLASS_JAVA_DOC + className
+                + UtilConstants.PERIOD + UtilConstants.NEW_LINE + UtilConstants.JAVA_DOC_END_LINE;
     }
 
     /**
      * Generate javaDoc for the interface.
      *
      * @param interfaceName interface name
-     * @return javaDocs.
+     * @return javaDocs
      */
     private static String generateForInterface(String interfaceName) {
-        return (UtilConstants.JAVA_DOC_FIRST_LINE + UtilConstants.INTERFACE_JAVA_DOC + interfaceName
-                + UtilConstants.PERIOD + UtilConstants.NEW_LINE + UtilConstants.JAVA_DOC_END_LINE);
+        return UtilConstants.JAVA_DOC_FIRST_LINE + UtilConstants.INTERFACE_JAVA_DOC + interfaceName
+                + UtilConstants.PERIOD + UtilConstants.NEW_LINE + UtilConstants.JAVA_DOC_END_LINE;
     }
 
     /**
      * Generate javaDoc for the builder interface.
      *
      * @param builderforName builder for name
-     * @return javaDocs.
+     * @return javaDocs
      */
     private static String generateForBuilderInterface(String builderforName) {
-        return (UtilConstants.JAVA_DOC_FIRST_LINE + UtilConstants.BUILDER_INTERFACE_JAVA_DOC + builderforName
-                + UtilConstants.PERIOD + UtilConstants.NEW_LINE + UtilConstants.JAVA_DOC_END_LINE);
+        return UtilConstants.JAVA_DOC_FIRST_LINE + UtilConstants.BUILDER_INTERFACE_JAVA_DOC + builderforName
+                + UtilConstants.PERIOD + UtilConstants.NEW_LINE + UtilConstants.JAVA_DOC_END_LINE;
     }
 
     /**
@@ -203,8 +203,8 @@
      * @return javaDocs
      */
     private static String generateForPackage(String packageName) {
-        return (UtilConstants.JAVA_DOC_FIRST_LINE + UtilConstants.PACKAGE_INFO_JAVADOC + packageName
-                + UtilConstants.PERIOD + UtilConstants.NEW_LINE + UtilConstants.JAVA_DOC_END_LINE);
+        return UtilConstants.JAVA_DOC_FIRST_LINE + UtilConstants.PACKAGE_INFO_JAVADOC + packageName
+                + UtilConstants.PERIOD + UtilConstants.NEW_LINE + UtilConstants.JAVA_DOC_END_LINE;
     }
 
     /**
@@ -213,38 +213,38 @@
      * @return javaDocs
      */
     private static String generateForDefaultConstructors() {
-        return (UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.JAVA_DOC_DEFAULT_CONSTRUCTOR
-                + UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.JAVA_DOC_END_LINE);
+        return UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.JAVA_DOC_DEFAULT_CONSTRUCTOR
+                + UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.JAVA_DOC_END_LINE;
     }
 
     /**
      * Generate javaDocs for constructor with parameters.
      *
-     * @param params list of parameters
      * @param className class name
      * @return javaDocs
      */
     private static String generateForConstructors(String className) {
-        return (UtilConstants.JAVA_DOC_FIRST_LINE + UtilConstants.FOUR_SPACE_INDENTATION
+        return UtilConstants.JAVA_DOC_FIRST_LINE + UtilConstants.FOUR_SPACE_INDENTATION
                 + UtilConstants.JAVA_DOC_CONSTRUCTOR + className + UtilConstants.IMPL + UtilConstants.PERIOD
                 + UtilConstants.NEW_LINE + UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.NEW_LINE_ESTRIC
                 + UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.JAVA_DOC_PARAM
-                + (className.substring(0, 1).toLowerCase() + className.substring(1)) + UtilConstants.OBJECT
+                + className.substring(0, 1).toLowerCase() + className.substring(1) + UtilConstants.OBJECT
                 + UtilConstants.SPACE + UtilConstants.BUILDER_OBJECT + UtilConstants.SPACE + className
-                + UtilConstants.NEW_LINE + UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.JAVA_DOC_END_LINE);
+                + UtilConstants.NEW_LINE + UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.JAVA_DOC_END_LINE;
     }
 
     /**
      * Generate javaDocs for build.
      *
+     * @param buildName builder name
      * @return javaDocs
      */
     private static String generateForBuild(String buildName) {
-        return (UtilConstants.NEW_LINE + UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.JAVA_DOC_FIRST_LINE
+        return UtilConstants.NEW_LINE + UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.JAVA_DOC_FIRST_LINE
                 + UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.JAVA_DOC_BUILD + buildName + UtilConstants.PERIOD
                 + UtilConstants.NEW_LINE + UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.NEW_LINE_ESTRIC
                 + UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.JAVA_DOC_RETURN
                 + UtilConstants.JAVA_DOC_BUILD_RETURN + buildName + UtilConstants.PERIOD + UtilConstants.NEW_LINE
-                + UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.JAVA_DOC_END_LINE);
+                + UtilConstants.FOUR_SPACE_INDENTATION + UtilConstants.JAVA_DOC_END_LINE;
     }
 }
diff --git a/src/main/java/org/onosproject/yangutils/utils/io/impl/TempDataStore.java b/src/main/java/org/onosproject/yangutils/utils/io/impl/TempDataStore.java
index 63cba97..b3e9ff5 100644
--- a/src/main/java/org/onosproject/yangutils/utils/io/impl/TempDataStore.java
+++ b/src/main/java/org/onosproject/yangutils/utils/io/impl/TempDataStore.java
@@ -33,7 +33,8 @@
 import java.util.List;
 
 /**
- * Provides storage for Temp data while traversing data model tree for code generation.
+ * Provides storage for Temp data while traversing data model tree for code
+ * generation.
  */
 public final class TempDataStore {
 
@@ -130,7 +131,7 @@
      * @param data data to be stored
      * @param type type of Temp data store
      * @param className class name
-     * @throws IOException when fails to create a Temp data file.
+     * @throws IOException when fails to create a Temp data file
      */
     public static void setTempData(String data, TempDataStoreType type, String className) throws IOException {
 
@@ -170,11 +171,11 @@
      * Get the Temp data.
      *
      * @param type type of Temp data store
-     * @param className name of the class.
-     * @return list of attribute info.
-     * @throws IOException when fails to read from the file.
-     * @throws ClassNotFoundException when class is missing.
-     * @throws FileNotFoundException when file is missing.
+     * @param className name of the class
+     * @return list of attribute info
+     * @throws IOException when fails to read from the file
+     * @throws ClassNotFoundException when class is missing
+     * @throws FileNotFoundException when file is missing
      */
     public static List<String> getTempData(TempDataStoreType type, String className)
             throws IOException, FileNotFoundException, ClassNotFoundException {
diff --git a/src/main/java/org/onosproject/yangutils/utils/io/impl/YangFileScanner.java b/src/main/java/org/onosproject/yangutils/utils/io/impl/YangFileScanner.java
index bb94b35..98e0444 100644
--- a/src/main/java/org/onosproject/yangutils/utils/io/impl/YangFileScanner.java
+++ b/src/main/java/org/onosproject/yangutils/utils/io/impl/YangFileScanner.java
@@ -37,10 +37,10 @@
      * Returns the list of java files.
      *
      * @param root specified directory
-     * @return list of java files.
-     * @throws NullPointerException when no files are there.
+     * @return list of java files
+     * @throws NullPointerException when no files are there
      * @throws IOException when files get deleted while performing the
-     *             operations.
+     *             operations
      */
     public static List<String> getJavaFiles(String root) throws NullPointerException, IOException {
         return getFiles(root, ".java");
@@ -50,10 +50,10 @@
      * Returns the list of YANG files.
      *
      * @param root specified directory
-     * @return list of YANG files.
-     * @throws NullPointerException when no files are there.
+     * @return list of YANG files
+     * @throws NullPointerException when no files are there
      * @throws IOException when files get deleted while performing the
-     *             operations.
+     *             operations
      */
     public static List<String> getYangFiles(String root) throws NullPointerException, IOException {
         return getFiles(root, ".yang");
@@ -63,12 +63,13 @@
      * Returns the list of required files.
      *
      * @param root specified directory
-     * @param extension file extension.
-     * @return list of required files.
+     * @param extension file extension
+     * @return list of required files
      * @throws IOException when files get deleted while performing the
-     *             operations.
+     *             operations
+     * @throws NullPointerException null pointer access
      */
-    public static List<String> getFiles(String root, String extension) throws  NullPointerException, IOException {
+    public static List<String> getFiles(String root, String extension) throws NullPointerException, IOException {
         List<String> store = new LinkedList<>();
         Stack<String> stack = new Stack<>();
         stack.push(root);
diff --git a/src/main/java/org/onosproject/yangutils/utils/io/impl/YangIoUtils.java b/src/main/java/org/onosproject/yangutils/utils/io/impl/YangIoUtils.java
index 3357000..a0aba1f 100644
--- a/src/main/java/org/onosproject/yangutils/utils/io/impl/YangIoUtils.java
+++ b/src/main/java/org/onosproject/yangutils/utils/io/impl/YangIoUtils.java
@@ -22,15 +22,14 @@
 import java.io.IOException;
 import java.util.List;
 
-import org.sonatype.plexus.build.incremental.BuildContext;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.model.Resource;
-
-import org.onosproject.yangutils.utils.UtilConstants;
 import org.apache.commons.io.FileUtils;
+import org.apache.maven.model.Resource;
+import org.apache.maven.project.MavenProject;
+import org.onosproject.yangutils.utils.UtilConstants;
+import org.slf4j.Logger;
+import org.sonatype.plexus.build.incremental.BuildContext;
 
 import static org.slf4j.LoggerFactory.getLogger;
-import org.slf4j.Logger;
 
 /**
  * Provides common utility functionalities for code generation.
@@ -64,7 +63,7 @@
      * @param path directory path
      * @param classInfo class info for the package
      * @param pack package of the directory
-     * @throws IOException when fails to create package info file.
+     * @throws IOException when fails to create package info file
      */
     public static void addPackageInfo(File path, String classInfo, String pack) throws IOException {
 
@@ -92,7 +91,7 @@
     /**
      * Cleans the generated directory if already exist in source folder.
      *
-     * @param baseDir generated directory in previous build.
+     * @param baseDir generated directory in previous build
      */
     public static void clean(String baseDir) {
         File generatedDirectory = new File(baseDir + File.separator + UtilConstants.YANG_GEN_DIR);
