diff --git a/compiler/api/src/main/java/org/onosproject/yang/DefaultYangModel.java b/compiler/api/src/main/java/org/onosproject/yang/DefaultYangModel.java
new file mode 100644
index 0000000..18358bc
--- /dev/null
+++ b/compiler/api/src/main/java/org/onosproject/yang/DefaultYangModel.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yang;
+
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+
+/**
+ * Represents default YANG model implementation.
+ */
+public class DefaultYangModel implements YangModel {
+
+    private final Map<YangModuleId, YangModule> moduleMap;
+
+    /**
+     * Creates an instance of YANG model.
+     */
+    public DefaultYangModel() {
+        moduleMap = new LinkedHashMap<>();
+    }
+
+    @Override
+    public Set<YangModule> getYangModules() {
+        Set<YangModule> modules = new LinkedHashSet<>();
+        for (Map.Entry<YangModuleId, YangModule> entry : moduleMap.entrySet()) {
+            modules.add(entry.getValue());
+        }
+        return modules;
+    }
+
+    @Override
+    public Set<YangModuleId> getYangModulesId() {
+        Set<YangModuleId> ids = new LinkedHashSet<>();
+        for (Map.Entry<YangModuleId, YangModule> entry : moduleMap.entrySet()) {
+            ids.add(entry.getKey());
+        }
+        return ids;
+    }
+
+    @Override
+    public YangModule getYangModule(YangModuleId id) {
+        return moduleMap.get(id);
+    }
+
+    @Override
+    public void addModule(YangModuleId id, YangModule module) {
+        moduleMap.put(id, module);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(moduleMap);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null) {
+            return false;
+        }
+        DefaultYangModel that = (DefaultYangModel) obj;
+
+        if (moduleMap.size() == that.moduleMap.size()) {
+            for (Map.Entry<YangModuleId, YangModule> entry : moduleMap.entrySet()) {
+                if (!that.moduleMap.containsKey(entry.getKey()) ||
+                        !that.moduleMap.containsValue(entry.getValue())) {
+                    return false;
+                }
+            }
+        } else {
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    public String toString() {
+        return toStringHelper(getClass())
+                .add("model", moduleMap)
+                .toString();
+    }
+}
diff --git a/compiler/api/src/main/java/org/onosproject/yang/DefaultYangModule.java b/compiler/api/src/main/java/org/onosproject/yang/DefaultYangModule.java
new file mode 100644
index 0000000..3ccbd9c
--- /dev/null
+++ b/compiler/api/src/main/java/org/onosproject/yang/DefaultYangModule.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yang;
+
+import org.onosproject.yang.compiler.api.YangCompilerException;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+import java.nio.file.Path;
+import java.util.Objects;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+import static com.google.common.base.Preconditions.checkNotNull;
+
+/**
+ * Represents default YANG module.
+ */
+public class DefaultYangModule implements YangModule {
+
+    private YangModuleId id;
+    private Path yangSrc;
+    private Path metadata;
+
+    /**
+     * Creates an instance of default YANG module.
+     *
+     * @param id       YANG module id
+     * @param yangSrc  YANG source file path
+     * @param metadata YANG metadata source file path
+     */
+    public DefaultYangModule(YangModuleId id, Path yangSrc, Path metadata) {
+        checkNotNull(yangSrc);
+        checkNotNull(metadata);
+        checkNotNull(id);
+        this.id = id;
+        this.yangSrc = yangSrc;
+        this.metadata = metadata;
+    }
+
+    @Override
+    public YangModuleId getYangModuleId() {
+        return id;
+    }
+
+    @Override
+    public InputStream getYangSource() {
+        try {
+            return new FileInputStream(yangSrc.toString());
+        } catch (FileNotFoundException e) {
+            throw new YangCompilerException("Yang source file not found." +
+                                                    yangSrc);
+        }
+    }
+
+    @Override
+    public InputStream getMetadata() {
+        try {
+            return new FileInputStream(metadata.toString());
+        } catch (FileNotFoundException e) {
+            throw new YangCompilerException("metadata source file not found." +
+                                                    metadata);
+        }
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(id, yangSrc, metadata);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null) {
+            return false;
+        }
+
+        DefaultYangModule that = (DefaultYangModule) obj;
+        return Objects.equals(id, that.id) &&
+                Objects.equals(yangSrc, that.yangSrc) &&
+                Objects.equals(metadata, that.metadata);
+    }
+
+    @Override
+    public String toString() {
+        return toStringHelper(getClass())
+                .add("moduleId", id)
+                .add("yangSource", yangSrc)
+                .add("yangMetadata", metadata)
+                .toString();
+    }
+}
diff --git a/compiler/api/src/main/java/org/onosproject/yang/DefaultYangModuleId.java b/compiler/api/src/main/java/org/onosproject/yang/DefaultYangModuleId.java
new file mode 100644
index 0000000..cea422e
--- /dev/null
+++ b/compiler/api/src/main/java/org/onosproject/yang/DefaultYangModuleId.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yang;
+
+import java.util.Objects;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+import static com.google.common.base.Preconditions.checkNotNull;
+
+/**
+ * Represents default YANG module identifier.
+ */
+public class DefaultYangModuleId implements YangModuleId {
+
+    private String moduleName;
+    private String revision;
+
+    /**
+     * Creates an instance of default YANG module id.
+     *
+     * @param name name of module
+     * @param rev  revision of module
+     */
+    public DefaultYangModuleId(String name, String rev) {
+        checkNotNull(name);
+        checkNotNull(rev);
+        moduleName = name;
+        revision = rev;
+    }
+
+    @Override
+    public String moduleName() {
+        return moduleName;
+    }
+
+    @Override
+    public String revision() {
+        return revision;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(moduleName, revision);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null) {
+            return false;
+        }
+
+        DefaultYangModuleId that = (DefaultYangModuleId) obj;
+        return Objects.equals(moduleName, that.moduleName) &&
+                Objects.equals(revision, that.revision);
+    }
+
+    @Override
+    public String toString() {
+        return toStringHelper(getClass())
+                .add("moduleName", moduleName)
+                .add("revision", revision)
+                .toString();
+    }
+}
diff --git a/compiler/api/src/main/java/org/onosproject/yang/YangModel.java b/compiler/api/src/main/java/org/onosproject/yang/YangModel.java
index cd5f403..fb45c27 100644
--- a/compiler/api/src/main/java/org/onosproject/yang/YangModel.java
+++ b/compiler/api/src/main/java/org/onosproject/yang/YangModel.java
@@ -1,9 +1,17 @@
 /*
- * Copyright (c) 2017. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
- * Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
- * Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
- * Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
- * Vestibulum commodo. Ut rhoncus gravida arcu.
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 
 package org.onosproject.yang;
@@ -37,4 +45,12 @@
      * @return YANG module information
      */
     YangModule getYangModule(YangModuleId id);
+
+    /**
+     * Adds YANG module information for a given module identifier.
+     *
+     * @param id     module identifier
+     * @param module YANG module information
+     */
+    void addModule(YangModuleId id, YangModule module);
 }
diff --git a/compiler/api/src/main/java/org/onosproject/yang/YangModule.java b/compiler/api/src/main/java/org/onosproject/yang/YangModule.java
index 70990f9..9b170fa 100644
--- a/compiler/api/src/main/java/org/onosproject/yang/YangModule.java
+++ b/compiler/api/src/main/java/org/onosproject/yang/YangModule.java
@@ -1,9 +1,17 @@
 /*
- * Copyright (c) 2017. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
- * Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
- * Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
- * Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
- * Vestibulum commodo. Ut rhoncus gravida arcu.
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 
 package org.onosproject.yang;
diff --git a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/utils/DataModelUtils.java b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/utils/DataModelUtils.java
index 9ff2b15..6d42e9d 100644
--- a/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/utils/DataModelUtils.java
+++ b/compiler/base/datamodel/src/main/java/org/onosproject/yang/compiler/datamodel/utils/DataModelUtils.java
@@ -872,6 +872,51 @@
     }
 
     /**
+     * Parses jar file and returns list of serialized file names.
+     *
+     * @param jarFile   jar file to be parsed
+     * @param directory directory where to search
+     * @return list of serialized files
+     * @throws IOException when fails to do IO operations
+     */
+    public static File parseDepSchemaPath(String jarFile, String directory)
+            throws IOException {
+        JarFile jar = new JarFile(jarFile);
+        Enumeration<?> enumEntries = jar.entries();
+        File serializedFile = null;
+        while (enumEntries.hasMoreElements()) {
+            JarEntry file = (JarEntry) enumEntries.nextElement();
+            if (file.getName().endsWith(".ser")) {
+
+                if (file.getName().contains(SLASH)) {
+                    String[] strArray = file.getName().split(SLASH);
+                    String tempPath = "";
+                    for (int i = 0; i < strArray.length - 1; i++) {
+                        tempPath = SLASH + tempPath + SLASH + strArray[i];
+                    }
+                    File dir = new File(directory + tempPath);
+                    dir.mkdirs();
+                }
+                serializedFile = new File(directory + SLASH + file.getName());
+                if (file.isDirectory()) {
+                    serializedFile.mkdirs();
+                    continue;
+                }
+                InputStream inputStream = jar.getInputStream(file);
+
+                FileOutputStream fileOutputStream = new FileOutputStream(serializedFile);
+                while (inputStream.available() > 0) {
+                    fileOutputStream.write(inputStream.read());
+                }
+                fileOutputStream.close();
+                inputStream.close();
+            }
+        }
+        jar.close();
+        return serializedFile;
+    }
+
+    /**
      * Validates the requested data-type resolve type in empty or not.
      *
      * @param dataType the data type
diff --git a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/InputListener.java b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/InputListener.java
index a350b18..1090adf 100644
--- a/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/InputListener.java
+++ b/compiler/base/parser/src/main/java/org/onosproject/yang/compiler/parser/impl/listeners/InputListener.java
@@ -23,7 +23,6 @@
 import org.onosproject.yang.compiler.datamodel.utils.Parsable;
 import org.onosproject.yang.compiler.parser.exceptions.ParserException;
 import org.onosproject.yang.compiler.parser.impl.TreeWalkListener;
-import org.onosproject.yang.compiler.utils.UtilConstants;
 
 import static org.onosproject.yang.compiler.datamodel.utils.GeneratedLanguage.JAVA_GENERATION;
 import static org.onosproject.yang.compiler.datamodel.utils.YangConstructType.INPUT_DATA;
diff --git a/compiler/base/tool/pom.xml b/compiler/base/tool/pom.xml
index 005b2a7..e7a5aa0 100644
--- a/compiler/base/tool/pom.xml
+++ b/compiler/base/tool/pom.xml
@@ -62,6 +62,11 @@
             <artifactId>onos-yang-compiler-parser</artifactId>
             <version>1.12-SNAPSHOT</version>
         </dependency>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-yang-compiler-api</artifactId>
+            <version>1.12-SNAPSHOT</version>
+        </dependency>
     </dependencies>
     <build>
         <plugins>
diff --git a/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/base/tool/CallablePlugin.java b/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/base/tool/CallablePlugin.java
deleted file mode 100644
index 46cc1c1..0000000
--- a/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/base/tool/CallablePlugin.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2016-present Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onosproject.yang.compiler.base.tool;
-
-import java.io.IOException;
-
-/**
- * Abstractions of the hooks that needs to be supported by plugins, which
- * will be used in by tool to be plugin agnostic.
- */
-public interface CallablePlugin {
-
-    /**
-     * Adds generated source directory to the compilation root.
-     */
-    void addGeneratedCodeToBundle();
-
-    /**
-     * serialize the compiled schema and place it in the appropriate location
-     * so that it will be part of the generated OSGi bundle.
-     *
-     * @throws IOException when fails to do IO operations
-     */
-    void addCompiledSchemaToBundle()
-            throws IOException;
-
-
-    /**
-     * Add the YANG files in the bundle, to support YANG display in protocols
-     * like RESTCONF.
-     *
-     * @throws IOException when fails to do IO operations
-     */
-    void addYangFilesToBundle() throws IOException;
-}
diff --git a/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/base/tool/YangToolManager.java b/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/base/tool/YangToolManager.java
deleted file mode 100644
index d4992cb..0000000
--- a/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/base/tool/YangToolManager.java
+++ /dev/null
@@ -1,334 +0,0 @@
-/*
- * Copyright 2016-present Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onosproject.yang.compiler.base.tool;
-
-import org.onosproject.yang.compiler.base.tool.exception.YangToolException;
-import org.onosproject.yang.compiler.datamodel.YangDeviationHolder;
-import org.onosproject.yang.compiler.datamodel.YangNode;
-import org.onosproject.yang.compiler.datamodel.YangReferenceResolver;
-import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
-import org.onosproject.yang.compiler.linker.YangLinker;
-import org.onosproject.yang.compiler.linker.exceptions.LinkerException;
-import org.onosproject.yang.compiler.linker.impl.YangLinkerManager;
-import org.onosproject.yang.compiler.parser.YangUtilsParser;
-import org.onosproject.yang.compiler.parser.exceptions.ParserException;
-import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
-import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
-import org.slf4j.Logger;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-import java.nio.file.Files;
-import java.nio.file.StandardCopyOption;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-
-import static java.util.Collections.sort;
-import static org.onosproject.yang.compiler.base.tool.ToolConstants.E_CODE_GEN_PATH;
-import static org.onosproject.yang.compiler.base.tool.ToolConstants.E_MISSING_INPUT;
-import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_DERIVED_DATA_TYPE;
-import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_IDENTITYREF;
-import static org.onosproject.yang.compiler.linker.impl.YangLinkerUtils.resolveGroupingInDefinationScope;
-import static org.onosproject.yang.compiler.translator.tojava.JavaCodeGeneratorUtil.generateJavaCode;
-import static org.onosproject.yang.compiler.translator.tojava.JavaCodeGeneratorUtil.translatorErrorHandler;
-import static org.onosproject.yang.compiler.utils.UtilConstants.NEW_LINE;
-import static org.onosproject.yang.compiler.utils.UtilConstants.SLASH;
-import static org.onosproject.yang.compiler.utils.UtilConstants.TEMP;
-import static org.onosproject.yang.compiler.utils.UtilConstants.YANG_RESOURCES;
-import static org.onosproject.yang.compiler.utils.io.impl.YangIoUtils.createDirectories;
-import static org.slf4j.LoggerFactory.getLogger;
-
-/**
- * Represents ONOS YANG tool manager.
- */
-public class YangToolManager {
-
-    public static final String DEFAULT_JAR_RES_PATH = SLASH + TEMP + SLASH +
-            YANG_RESOURCES + SLASH;
-    public static final String YANG_META_DATA = "YangMetaData";
-    public static final String SERIALIZED_FILE_EXTENSION = ".ser";
-    private static final Logger log = getLogger(YangToolManager.class);
-    private final YangUtilsParser yangUtilsParser = new YangUtilsParserManager();
-    private final YangLinker yangLinker = new YangLinkerManager();
-    private final Set<YangNode> yangNodeSet = new HashSet<>();
-    // YANG file information set.
-    private Set<YangFileInfo> yangFileInfoSet; //initialize in tool invocation;
-    private YangFileInfo curYangFileInfo = new YangFileInfo();
-
-    /**
-     * Provides a list of files from list of strings.
-     *
-     * @param yangFileInfo set of yang file information
-     * @return list of files
-     */
-    private static List<File> getListOfFile(Set<YangFileInfo> yangFileInfo) {
-        List<File> files = new ArrayList<>();
-        Iterator<YangFileInfo> yangFileIterator = yangFileInfo.iterator();
-        while (yangFileIterator.hasNext()) {
-            YangFileInfo yangFile = yangFileIterator.next();
-            if (yangFile.isForTranslator()) {
-                files.add(new File(yangFile.getYangFileName()));
-            }
-        }
-        return files;
-    }
-
-    /**
-     * Creates a YANG file info set.
-     *
-     * @param yangFileList YANG files list
-     * @return yang file info set
-     */
-    public Set<YangFileInfo> createYangFileInfoSet(List<String> yangFileList) {
-        if (yangFileInfoSet == null) {
-            yangFileInfoSet = new HashSet<>();
-        }
-        for (String yangFile : yangFileList) {
-            YangFileInfo yangFileInfo = new YangFileInfo();
-            yangFileInfo.setYangFileName(yangFile);
-            yangFileInfoSet.add(yangFileInfo);
-        }
-        return yangFileInfoSet;
-    }
-
-    /**
-     * Compile te YANG files and generate the corresponding Java files.
-     * Update the generated bundle with the schema metadata.
-     *
-     * @param yangFiles       Application YANG files
-     * @param dependentSchema inter jar linked schema nodes
-     * @param config          tool configuration
-     * @param plugin          invoking plugin
-     * @throws IOException when fails to do IO operations
-     */
-    public void compileYangFiles(Set<YangFileInfo> yangFiles,
-                                 List<YangNode> dependentSchema,
-                                 YangPluginConfig config,
-                                 CallablePlugin plugin) throws IOException {
-
-        synchronized (yangFiles) {
-            try {
-
-                if (config == null) {
-                    throw new YangToolException(E_MISSING_INPUT);
-                }
-                yangFileInfoSet = yangFiles;
-
-                if (config.getCodeGenDir() == null) {
-                    throw new YangToolException(E_CODE_GEN_PATH);
-                }
-
-                // Check if there are any file to translate, if not return.
-                if (yangFileInfoSet == null || yangFileInfoSet.isEmpty()) {
-                    // No files to translate
-                    return;
-                }
-
-                createDirectories(config.resourceGenDir());
-
-                // Resolve inter jar dependency.
-                addSchemaToFileSet(dependentSchema);
-
-                // Carry out the parsing for all the YANG files.
-                parseYangFileInfoSet();
-
-                // Resolve dependencies using linker.
-                resolveDependenciesUsingLinker();
-
-                // Perform translation to JAVA.
-                translateToJava(config);
-
-                // Serialize data model.
-                Set<YangNode> compiledSchemas = new HashSet<>();
-                for (YangFileInfo fileInfo : yangFileInfoSet) {
-                    compiledSchemas.add(fileInfo.getRootNode());
-                }
-
-                String serFileName = config.resourceGenDir() + YANG_META_DATA + SERIALIZED_FILE_EXTENSION;
-                FileOutputStream fileOutputStream = new FileOutputStream(serFileName);
-                ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream);
-                objectOutputStream.writeObject(compiledSchemas);
-                objectOutputStream.close();
-                fileOutputStream.close();
-
-                //add YANG files to JAR
-                List<File> files = getListOfFile(yangFileInfoSet);
-                String path = config.resourceGenDir();
-                File targetDir = new File(path);
-                targetDir.mkdirs();
-
-                for (File file : files) {
-                    Files.copy(file.toPath(),
-                               new File(path + file.getName()).toPath(),
-                               StandardCopyOption.REPLACE_EXISTING);
-                }
-
-                if (plugin != null) {
-                    plugin.addCompiledSchemaToBundle();
-                    plugin.addGeneratedCodeToBundle();
-                    plugin.addYangFilesToBundle();
-                }
-            } catch (IOException | ParserException e) {
-                YangToolException exception =
-                        new YangToolException(e.getMessage(), e);
-                exception.setCurYangFile(curYangFileInfo);
-
-                if (curYangFileInfo != null &&
-                        curYangFileInfo.getRootNode() != null) {
-                    try {
-                        translatorErrorHandler(curYangFileInfo.getRootNode(),
-                                               config);
-                    } catch (IOException ex) {
-                        e.printStackTrace();
-                        throw ex;
-                    }
-                }
-
-                throw exception;
-            }
-        }
-    }
-
-    /**
-     * Resolved inter-jar dependencies.
-     *
-     * @param dependentSchema dependent schema list
-     * @throws IOException when fails to do IO operations
-     */
-    private void addSchemaToFileSet(List<YangNode> dependentSchema)
-            throws IOException {
-        if (dependentSchema == null || dependentSchema.isEmpty()) {
-            return;
-        }
-
-        for (YangNode node : dependentSchema) {
-            YangFileInfo dependentFileInfo = new YangFileInfo();
-            node.setToTranslate(false);
-            dependentFileInfo.setRootNode(node);
-            dependentFileInfo.setForTranslator(false);
-            dependentFileInfo.setYangFileName(node.getName());
-            yangFileInfoSet.add(dependentFileInfo);
-        }
-    }
-
-    /**
-     * Links all the provided schema in the YANG file info set.
-     *
-     * @throws YangToolException failed to link schema
-     */
-    public void resolveDependenciesUsingLinker() {
-        createYangNodeSet();
-        try {
-            yangLinker.resolveDependencies(yangNodeSet);
-        } catch (LinkerException e) {
-            printLog(e.getFileName(), e.getLineNumber(), e.getCharPositionInLine(),
-                     e.getMessage(), e.getLocalizedMessage());
-            throw new YangToolException(e.getMessage());
-        }
-    }
-
-    /**
-     * Creates YANG nodes set.
-     */
-    public void createYangNodeSet() {
-        for (YangFileInfo yangFileInfo : yangFileInfoSet) {
-            yangNodeSet.add(yangFileInfo.getRootNode());
-        }
-    }
-
-    /**
-     * Parses all the provided YANG files and generates YANG data model tree.
-     *
-     * @throws IOException a violation in IO
-     */
-    public void parseYangFileInfoSet()
-            throws IOException {
-        for (YangFileInfo yangFileInfo : yangFileInfoSet) {
-            curYangFileInfo = yangFileInfo;
-            if (yangFileInfo.isForTranslator()) {
-                try {
-                    YangNode yangNode = yangUtilsParser.getDataModel(
-                            yangFileInfo.getYangFileName());
-                    yangFileInfo.setRootNode(yangNode);
-                    resolveGroupingInDefinationScope((YangReferenceResolver) yangNode);
-                    try {
-                        ((YangReferenceResolver) yangNode)
-                                .resolveSelfFileLinking(YANG_DERIVED_DATA_TYPE);
-                        ((YangReferenceResolver) yangNode)
-                                .resolveSelfFileLinking(YANG_IDENTITYREF);
-                    } catch (DataModelException e) {
-                        printLog(e.getFileName(), e.getLineNumber(), e
-                                .getCharPositionInLine(), e.getMessage(), e
-                                         .getLocalizedMessage());
-                    }
-                } catch (ParserException e) {
-                    printLog(e.getFileName(), e.getLineNumber(), e
-                            .getCharPositionInLine(), e.getMessage(), e
-                                     .getLocalizedMessage());
-                    throw e;
-                }
-            }
-        }
-    }
-
-    /**
-     * Translates to java code corresponding to the YANG schema.
-     *
-     * @param pluginConfig YANG plugin config
-     * @throws IOException when fails to generate java code file the current node
-     */
-    public void translateToJava(YangPluginConfig pluginConfig)
-            throws IOException {
-        List<YangNode> yangNodeSortedList = new LinkedList<>();
-        yangNodeSortedList.addAll(yangNodeSet);
-        sort(yangNodeSortedList);
-        for (YangNode node : yangNodeSortedList) {
-            if (node.isToTranslate() && !((YangDeviationHolder) node)
-                    .isModuleForDeviation()) {
-                generateJavaCode(node, pluginConfig);
-            }
-        }
-    }
-
-    /**
-     * Adds log info for exception.
-     *
-     * @param fileName file name
-     * @param line     line number
-     * @param position character position
-     * @param msg      error message
-     * @param localMsg local message
-     */
-    private void printLog(String fileName, int line, int position, String
-            msg, String localMsg) {
-        String logInfo = "Error in file: " + fileName;
-        if (line != 0) {
-            logInfo = logInfo + " at line: " + line + " at position: "
-                    + position;
-        }
-        if (msg != null) {
-            logInfo = logInfo + NEW_LINE + localMsg;
-        }
-        log.info(logInfo);
-    }
-}
diff --git a/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/base/tool/exception/YangToolException.java b/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/base/tool/exception/YangToolException.java
deleted file mode 100644
index 39bee83..0000000
--- a/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/base/tool/exception/YangToolException.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2016-present Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onosproject.yang.compiler.base.tool.exception;
-
-import org.onosproject.yang.compiler.base.tool.YangFileInfo;
-
-/**
- * Represents base class for exceptions in YANG tool operations.
- */
-public class YangToolException extends RuntimeException {
-
-    private static final long serialVersionUID = 20161028L;
-
-    private YangFileInfo curYangFile;
-
-    /**
-     * Creates a new YANG tool exception with given message.
-     *
-     * @param message the detail of exception in string
-     */
-    public YangToolException(String message) {
-        super(message);
-    }
-
-    /**
-     * Creates a new tool exception from given message and cause.
-     *
-     * @param message the detail of exception in string
-     * @param cause   underlying cause of the error
-     */
-    public YangToolException(final String message, final Throwable cause) {
-        super(message, cause);
-    }
-
-    /**
-     * Creates a new tool exception from cause.
-     *
-     * @param cause underlying cause of the error
-     */
-    public YangToolException(final Throwable cause) {
-        super(cause);
-    }
-
-    /**
-     * Retrieves the current YANG files for which exception has occured.
-     *
-     * @return current YANG file
-     */
-    public YangFileInfo getCurYangFile() {
-        return curYangFile;
-    }
-
-
-    /**
-     * Update the YANG file which caused the exception.
-     *
-     * @param curYangFile YANG files being processed
-     */
-    public void setCurYangFile(YangFileInfo curYangFile) {
-        this.curYangFile = curYangFile;
-    }
-}
diff --git a/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/base/tool/YangFileInfo.java b/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/tool/YangFileInfo.java
similarity index 97%
rename from compiler/base/tool/src/main/java/org/onosproject/yang/compiler/base/tool/YangFileInfo.java
rename to compiler/base/tool/src/main/java/org/onosproject/yang/compiler/tool/YangFileInfo.java
index 84b201e..df0fd9f 100644
--- a/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/base/tool/YangFileInfo.java
+++ b/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/tool/YangFileInfo.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.onosproject.yang.compiler.base.tool;
+package org.onosproject.yang.compiler.tool;
 
 
 import org.onosproject.yang.compiler.datamodel.YangNode;
diff --git a/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/tool/impl/DefaultYangCompilationParam.java b/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/tool/impl/DefaultYangCompilationParam.java
new file mode 100644
index 0000000..0671700
--- /dev/null
+++ b/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/tool/impl/DefaultYangCompilationParam.java
@@ -0,0 +1,116 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yang.compiler.tool.impl;
+
+import org.onosproject.yang.compiler.api.YangCompilationParam;
+
+import java.nio.file.Path;
+import java.util.LinkedHashSet;
+import java.util.Objects;
+import java.util.Set;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+
+/**
+ * Represents default YANG compilation parameter.
+ */
+public class DefaultYangCompilationParam implements YangCompilationParam {
+
+    private final Set<Path> yangFiles;
+    private final Set<Path> dependentSchemas;
+    private Path codeGenDir;
+    private Path metaDataPath;
+
+    /**
+     * Creates an instance of YANG compilation parameter.
+     */
+    public DefaultYangCompilationParam() {
+        yangFiles = new LinkedHashSet<>();
+        dependentSchemas = new LinkedHashSet<>();
+    }
+
+    @Override
+    public Set<Path> getYangFiles() {
+        return yangFiles;
+    }
+
+    @Override
+    public void addYangFile(Path path) {
+        yangFiles.add(path);
+    }
+
+    @Override
+    public Set<Path> getDependentSchemas() {
+        return dependentSchemas;
+    }
+
+    @Override
+    public void addDependentSchema(Path path) {
+        dependentSchemas.add(path);
+    }
+
+    @Override
+    public Path getCodeGenDir() {
+        return codeGenDir;
+    }
+
+    @Override
+    public void setCodeGenDir(Path path) {
+        codeGenDir = path;
+    }
+
+    @Override
+    public Path getMetadataGenDir() {
+        return metaDataPath;
+    }
+
+    @Override
+    public void setMetadataGenDir(Path path) {
+        metaDataPath = path;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(yangFiles, dependentSchemas, codeGenDir,
+                            metaDataPath);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null) {
+            return false;
+        }
+
+        DefaultYangCompilationParam that = (DefaultYangCompilationParam) obj;
+        return yangFiles.size() == that.yangFiles.size() &&
+                dependentSchemas.size() == that.dependentSchemas.size() &&
+                yangFiles.containsAll(that.yangFiles) &&
+                dependentSchemas.containsAll(that.dependentSchemas) &&
+                Objects.equals(codeGenDir, that.codeGenDir) &&
+                Objects.equals(metaDataPath, that.metaDataPath);
+    }
+
+    @Override
+    public String toString() {
+        return toStringHelper(getClass())
+                .add("yangFilePath", yangFiles)
+                .add("dependentSchemas", dependentSchemas)
+                .add("codeGenDir", codeGenDir)
+                .add("metaDataPath", metaDataPath)
+                .toString();
+    }
+}
diff --git a/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/tool/impl/DefaultYangCompiledOutput.java b/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/tool/impl/DefaultYangCompiledOutput.java
new file mode 100644
index 0000000..8d8b597
--- /dev/null
+++ b/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/tool/impl/DefaultYangCompiledOutput.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yang.compiler.tool.impl;
+
+import org.onosproject.yang.YangModel;
+import org.onosproject.yang.compiler.api.YangCompiledOutput;
+
+import java.nio.file.Path;
+import java.util.Objects;
+import java.util.Set;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+import static com.google.common.base.Preconditions.checkNotNull;
+
+/**
+ * Represents default YANG compiled output implementation.
+ */
+public class DefaultYangCompiledOutput implements YangCompiledOutput {
+
+    private final YangModel model;
+    private final Set<Path> generatedJava;
+
+    /**
+     * Creates an instance of YANG compiled output.
+     *
+     * @param model         YANG model
+     * @param generatedJava generated java paths
+     */
+    public DefaultYangCompiledOutput(YangModel model, Set<Path> generatedJava) {
+        checkNotNull(model);
+        checkNotNull(generatedJava);
+        this.model = model;
+        this.generatedJava = generatedJava;
+    }
+
+    @Override
+    public YangModel getYangModel() {
+        return model;
+    }
+
+    @Override
+    public Set<Path> getGeneratedJava() {
+        return generatedJava;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(model, generatedJava);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null) {
+            return false;
+        }
+
+        DefaultYangCompiledOutput that = (DefaultYangCompiledOutput) obj;
+        return generatedJava.size() == that.generatedJava.size() &&
+                generatedJava.containsAll(that.generatedJava) &&
+                Objects.equals(model, that.model);
+    }
+
+    @Override
+    public String toString() {
+        return toStringHelper(getClass())
+                .add("yangModel", model)
+                .add("generatedJava", generatedJava)
+                .toString();
+    }
+}
diff --git a/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/tool/impl/YangCompilerManager.java b/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/tool/impl/YangCompilerManager.java
new file mode 100644
index 0000000..4a77a09
--- /dev/null
+++ b/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/tool/impl/YangCompilerManager.java
@@ -0,0 +1,463 @@
+/*
+ * Copyright 2017-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yang.compiler.tool.impl;
+
+import org.onosproject.yang.DefaultYangModel;
+import org.onosproject.yang.DefaultYangModule;
+import org.onosproject.yang.DefaultYangModuleId;
+import org.onosproject.yang.YangModel;
+import org.onosproject.yang.YangModuleId;
+import org.onosproject.yang.compiler.api.YangCompilationParam;
+import org.onosproject.yang.compiler.api.YangCompiledOutput;
+import org.onosproject.yang.compiler.api.YangCompilerException;
+import org.onosproject.yang.compiler.api.YangCompilerService;
+import org.onosproject.yang.compiler.datamodel.YangDeviationHolder;
+import org.onosproject.yang.compiler.datamodel.YangNode;
+import org.onosproject.yang.compiler.datamodel.YangReferenceResolver;
+import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
+import org.onosproject.yang.compiler.linker.YangLinker;
+import org.onosproject.yang.compiler.linker.exceptions.LinkerException;
+import org.onosproject.yang.compiler.linker.impl.YangLinkerManager;
+import org.onosproject.yang.compiler.parser.YangUtilsParser;
+import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+import org.onosproject.yang.compiler.tool.YangFileInfo;
+import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
+import org.slf4j.Logger;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.LinkedHashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import static java.nio.file.Files.copy;
+import static java.nio.file.Paths.get;
+import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
+import static java.util.Collections.sort;
+import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_DERIVED_DATA_TYPE;
+import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_IDENTITYREF;
+import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.deSerializeDataModel;
+import static org.onosproject.yang.compiler.linker.impl.YangLinkerUtils.resolveGroupingInDefinationScope;
+import static org.onosproject.yang.compiler.translator.tojava.JavaCodeGeneratorUtil.generateJavaCode;
+import static org.onosproject.yang.compiler.translator.tojava.JavaCodeGeneratorUtil.translatorErrorHandler;
+import static org.onosproject.yang.compiler.utils.UtilConstants.NEW_LINE;
+import static org.onosproject.yang.compiler.utils.UtilConstants.SLASH;
+import static org.onosproject.yang.compiler.utils.UtilConstants.YANG_META_DATA;
+import static org.onosproject.yang.compiler.utils.io.impl.YangFileScanner.getJavaFiles;
+import static org.onosproject.yang.compiler.utils.io.impl.YangIoUtils.createDirectories;
+import static org.slf4j.LoggerFactory.getLogger;
+
+/**
+ * Represents implementation of YANG compiler manager.
+ */
+public class YangCompilerManager implements YangCompilerService {
+
+    private static final Logger log = getLogger(YangCompilerManager.class);
+    private final YangUtilsParser yangUtilsParser = new YangUtilsParserManager();
+    private final YangLinker yangLinker = new YangLinkerManager();
+    private final Set<YangNode> yangNodeSet = new HashSet<>();
+
+    // YANG file information set.
+    private Set<YangFileInfo> yangFileInfoSet; //initialize in tool invocation;
+    private YangFileInfo curYangFileInfo = new YangFileInfo();
+    private Set<Path> genJavaPath = new LinkedHashSet<>();
+
+    @Override
+    public YangCompiledOutput compileYangFiles(YangCompilationParam param)
+            throws IOException, YangCompilerException {
+
+        YangPluginConfig config = new YangPluginConfig();
+        config.setCodeGenDir(param.getCodeGenDir().toString() + SLASH);
+        config.resourceGenDir(param.getMetadataGenDir().toString() +
+                                      SLASH);
+
+        processYangFiles(createYangFileInfoSet(param.getYangFiles()),
+                         dependentSchema(param.getDependentSchemas()), config);
+
+        return new DefaultYangCompiledOutput(
+                processYangModel(config.resourceGenDir()), genJavaPath);
+    }
+
+    /**
+     * Returns YANG model for application.
+     *
+     * @param path path for metadata file
+     * @return YANG model
+     */
+    private YangModel processYangModel(String path) {
+        DefaultYangModel model = new DefaultYangModel();
+        YangModuleId id;
+        for (YangNode node : yangNodeSet) {
+            id = processModuleId(node);
+            org.onosproject.yang.YangModule module =
+                    new DefaultYangModule(id, get(node.getFileName()), get(path));
+            model.addModule(id, module);
+        }
+        return model;
+    }
+
+    /**
+     * Returns YANG module id for a given YANG module node.
+     *
+     * @param module YANG module
+     * @return YANG module id for a given YANG module node
+     */
+    private YangModuleId processModuleId(YangNode module) {
+        return new DefaultYangModuleId(module.getName(), module.getRevision()
+                .getRevDate().toString());
+    }
+
+    /**
+     * Returns YANG node set.
+     *
+     * @return YANG node set
+     */
+    public Set<YangNode> getYangNodeSet() {
+        return yangNodeSet;
+    }
+
+    /**
+     * Provides a list of files from list of strings.
+     *
+     * @param yangFileInfo set of yang file information
+     * @return list of files
+     */
+    private static List<File> getListOfFile(Set<YangFileInfo> yangFileInfo) {
+        List<File> files = new ArrayList<>();
+        for (YangFileInfo yangFile : yangFileInfo) {
+            if (yangFile.isForTranslator()) {
+                files.add(new File(yangFile.getYangFileName()));
+            }
+        }
+        return files;
+    }
+
+    /**
+     * Creates a YANG file info set.
+     *
+     * @param yangFileList YANG files list
+     * @return yang file info set
+     */
+    public Set<YangFileInfo> createYangFileInfoSet(Set<Path> yangFileList) {
+        if (yangFileInfoSet == null) {
+            yangFileInfoSet = new HashSet<>();
+        }
+        for (Path yangFile : yangFileList) {
+            YangFileInfo yangFileInfo = new YangFileInfo();
+            yangFileInfo.setYangFileName(yangFile.toString());
+            yangFileInfoSet.add(yangFileInfo);
+        }
+        return yangFileInfoSet;
+    }
+
+    /**
+     * Compile te YANG files and generate the corresponding Java files.
+     * Update the generated bundle with the schema metadata.
+     *
+     * @param yangFiles       Application YANG files
+     * @param dependentSchema inter jar linked schema nodes
+     * @param config          tool configurations
+     * @throws IOException when fails to do IO operations
+     */
+    private void processYangFiles(Set<YangFileInfo> yangFiles,
+                                  Set<YangNode> dependentSchema,
+                                  YangPluginConfig config) throws IOException {
+
+        synchronized (YangCompilerManager.class) {
+            try {
+
+                yangFileInfoSet = yangFiles;
+
+                // Check if there are any file to translate, if not return.
+                if (yangFileInfoSet.isEmpty()) {
+                    // No files to translate
+                    return;
+                }
+
+                //Create resource directory.
+                createDirectories(config.resourceGenDir());
+
+                // Resolve inter jar dependency.
+                addSchemaToFileSet(dependentSchema);
+
+                // Carry out the parsing for all the YANG files.
+                parseYangFileInfoSet();
+
+                // Resolve dependencies using linker.
+                resolveDependenciesUsingLinker();
+
+                // Perform translation to JAVA.
+                translateToJava(config);
+
+                //add to generated java code map
+                processGeneratedCode(config.getCodeGenDir());
+
+                // Serialize data model.
+                processSerialization(config.resourceGenDir());
+
+                //add YANG files to JAR
+                processCopyYangFile(config.resourceGenDir());
+            } catch (IOException | ParserException e) {
+                //TODO: provide unified framework for exceptions
+                YangCompilerException exception =
+                        new YangCompilerException(e.getMessage(), e);
+                exception.setYangFile(get(
+                        curYangFileInfo.getYangFileName()));
+
+                if (curYangFileInfo != null &&
+                        curYangFileInfo.getRootNode() != null) {
+                    try {
+                        translatorErrorHandler(curYangFileInfo.getRootNode(),
+                                               config);
+                    } catch (IOException ex) {
+                        e.printStackTrace();
+                        throw ex;
+                    }
+                }
+                throw exception;
+            }
+        }
+    }
+
+    /**
+     * Adds all generated java class paths to YANG model.
+     *
+     * @param codeGenDir code gen directory.
+     * @throws IOException when fails to do IO operations
+     */
+    private void processGeneratedCode(String codeGenDir) throws IOException {
+        List<String> files = getJavaFiles(codeGenDir);
+        for (String file : files) {
+            genJavaPath.add(Paths.get(file));
+        }
+    }
+
+    /**
+     * Returns dependent schema nodes.
+     *
+     * @param dependentSchemaPath dependent schema paths
+     * @return dependent schema nodes
+     */
+    private Set<YangNode> dependentSchema(Set<Path> dependentSchemaPath) {
+        Set<YangNode> depNodes = new LinkedHashSet<>();
+        for (Path path : dependentSchemaPath) {
+            try {
+                depNodes.addAll(deSerializeDataModel(path.toString()));
+            } catch (IOException e) {
+                throw new YangCompilerException(
+                        "Failed to fetch dependent schema from given " +
+                                "path :" + path.toString());
+            }
+        }
+        return depNodes;
+    }
+
+    /**
+     * Resolved inter-jar dependencies.
+     *
+     * @param dependentSchema dependent schema list
+     * @throws IOException when fails to do IO operations
+     */
+    private void addSchemaToFileSet(Set<YangNode> dependentSchema)
+            throws IOException {
+        if (dependentSchema == null || dependentSchema.isEmpty()) {
+            return;
+        }
+
+        for (YangNode node : dependentSchema) {
+            YangFileInfo dependentFileInfo = new YangFileInfo();
+            node.setToTranslate(false);
+            dependentFileInfo.setRootNode(node);
+            dependentFileInfo.setForTranslator(false);
+            dependentFileInfo.setYangFileName(node.getName());
+            yangFileInfoSet.add(dependentFileInfo);
+        }
+    }
+
+    /**
+     * Links all the provided schema in the YANG file info set.
+     *
+     * @throws YangCompilerException failed to link schema
+     */
+    public void resolveDependenciesUsingLinker() {
+        createYangNodeSet();
+        try {
+            yangLinker.resolveDependencies(yangNodeSet);
+        } catch (LinkerException e) {
+            printLog(e.getFileName(), e.getLineNumber(), e.getCharPositionInLine(),
+                     e.getMessage(), e.getLocalizedMessage());
+            throw new YangCompilerException(e.getMessage());
+        }
+    }
+
+    /**
+     * Creates YANG nodes set.
+     */
+    public void createYangNodeSet() {
+        for (YangFileInfo yangFileInfo : yangFileInfoSet) {
+            yangNodeSet.add(yangFileInfo.getRootNode());
+        }
+    }
+
+    /**
+     * Parses all the provided YANG files and generates YANG data model tree.
+     *
+     * @throws IOException a violation in IO
+     */
+    public void parseYangFileInfoSet()
+            throws IOException {
+        for (YangFileInfo yangFileInfo : yangFileInfoSet) {
+            curYangFileInfo = yangFileInfo;
+            if (yangFileInfo.isForTranslator()) {
+                try {
+                    YangNode yangNode = yangUtilsParser.getDataModel(
+                            yangFileInfo.getYangFileName());
+                    yangFileInfo.setRootNode(yangNode);
+                    resolveGroupingInDefinationScope((YangReferenceResolver) yangNode);
+                    try {
+                        ((YangReferenceResolver) yangNode)
+                                .resolveSelfFileLinking(YANG_DERIVED_DATA_TYPE);
+                        ((YangReferenceResolver) yangNode)
+                                .resolveSelfFileLinking(YANG_IDENTITYREF);
+                    } catch (DataModelException e) {
+                        printLog(e.getFileName(), e.getLineNumber(), e
+                                .getCharPositionInLine(), e.getMessage(), e
+                                         .getLocalizedMessage());
+                    }
+                } catch (ParserException e) {
+                    printLog(e.getFileName(), e.getLineNumber(), e
+                            .getCharPositionInLine(), e.getMessage(), e
+                                     .getLocalizedMessage());
+                    throw e;
+                }
+            }
+        }
+    }
+
+    /**
+     * Translates to java code corresponding to the YANG schema.
+     *
+     * @param pluginConfig YANG plugin config
+     * @throws IOException when fails to generate java code file the current node
+     */
+    public void translateToJava(YangPluginConfig pluginConfig)
+            throws IOException {
+        List<YangNode> yangNodeSortedList = new LinkedList<>();
+        yangNodeSortedList.addAll(yangNodeSet);
+        sort(yangNodeSortedList);
+        for (YangNode node : yangNodeSortedList) {
+            if (node.isToTranslate() && !((YangDeviationHolder) node)
+                    .isModuleForDeviation()) {
+                generateJavaCode(node, pluginConfig);
+            }
+        }
+    }
+
+    /**
+     * Adds log info for exception.
+     *
+     * @param fileName file name
+     * @param line     line number
+     * @param position character position
+     * @param msg      error message
+     * @param localMsg local message
+     */
+    private void printLog(String fileName, int line, int position, String
+            msg, String localMsg) {
+        String logInfo = "Error in file: " + fileName;
+        if (line != 0) {
+            logInfo = logInfo + " at line: " + line + " at position: "
+                    + position;
+        }
+        if (msg != null) {
+            logInfo = logInfo + NEW_LINE + localMsg;
+        }
+        log.info(logInfo);
+    }
+
+    /**
+     * Process serialization of datamodel.
+     *
+     * @param path path of resource directory
+     * @throws IOException when fails to IO operations
+     */
+    private void processSerialization(String path) throws IOException {
+        Set<YangNode> compiledSchemas = new HashSet<>();
+        for (YangFileInfo fileInfo : yangFileInfoSet) {
+            compiledSchemas.add(fileInfo.getRootNode());
+        }
+
+        String serFileName = path + YANG_META_DATA;
+        FileOutputStream fileOutputStream = new FileOutputStream(serFileName);
+        ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream);
+        objectOutputStream.writeObject(compiledSchemas);
+        objectOutputStream.close();
+        fileOutputStream.close();
+    }
+
+    /**
+     * Copies yang files to resource directory.
+     *
+     * @param path yang file paths
+     * @throws IOException when fails to do IO operations
+     */
+    private void processCopyYangFile(String path) throws IOException {
+
+        //add YANG files to JAR
+        List<File> files = getListOfFile(yangFileInfoSet);
+        File targetDir = new File(path);
+        if (!targetDir.exists()) {
+            boolean isCreated = targetDir.mkdirs();
+            if (!isCreated) {
+                throw new YangCompilerException(
+                        "failed to create yang resource directory.");
+            }
+        }
+
+        for (File file : files) {
+            copy(file.toPath(),
+                 new File(path + file.getName()).toPath(),
+                 REPLACE_EXISTING);
+        }
+    }
+
+    /**
+     * Returns yang file info set.
+     *
+     * @return yang file info set
+     */
+    public Set<YangFileInfo> getYangFileInfoSet() {
+        return yangFileInfoSet;
+    }
+
+    /**
+     * Sets yang file info set.
+     *
+     * @param yangFileInfoSet yang file info set
+     */
+    public void setYangFileInfoSet(Set<YangFileInfo> yangFileInfoSet) {
+        this.yangFileInfoSet = yangFileInfoSet;
+    }
+}
diff --git a/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/base/tool/ToolConstants.java b/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/tool/impl/package-info.java
similarity index 60%
rename from compiler/base/tool/src/main/java/org/onosproject/yang/compiler/base/tool/ToolConstants.java
rename to compiler/base/tool/src/main/java/org/onosproject/yang/compiler/tool/impl/package-info.java
index b5640b6..166e7e6 100644
--- a/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/base/tool/ToolConstants.java
+++ b/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/tool/impl/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-present Open Networking Laboratory
+ * Copyright 2017-present Open Networking Laboratory
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,16 +14,7 @@
  * limitations under the License.
  */
 
-package org.onosproject.yang.compiler.base.tool;
-
 /**
- * Represents common constant utility for YANG tool.
+ * Compiler api implementation.
  */
-final class ToolConstants {
-    private ToolConstants() {
-
-    }
-
-    static final String E_MISSING_INPUT = "Missing extected input ";
-    static final String E_CODE_GEN_PATH = "Missing plugin code gen directory";
-}
+package org.onosproject.yang.compiler.tool.impl;
\ No newline at end of file
diff --git a/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/base/tool/ToolConstants.java b/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/tool/package-info.java
similarity index 60%
copy from compiler/base/tool/src/main/java/org/onosproject/yang/compiler/base/tool/ToolConstants.java
copy to compiler/base/tool/src/main/java/org/onosproject/yang/compiler/tool/package-info.java
index b5640b6..3627174 100644
--- a/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/base/tool/ToolConstants.java
+++ b/compiler/base/tool/src/main/java/org/onosproject/yang/compiler/tool/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-present Open Networking Laboratory
+ * Copyright 2017-present Open Networking Laboratory
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,16 +14,7 @@
  * limitations under the License.
  */
 
-package org.onosproject.yang.compiler.base.tool;
-
 /**
- * Represents common constant utility for YANG tool.
+ * Compiler tool information.
  */
-final class ToolConstants {
-    private ToolConstants() {
-
-    }
-
-    static final String E_MISSING_INPUT = "Missing extected input ";
-    static final String E_CODE_GEN_PATH = "Missing plugin code gen directory";
-}
+package org.onosproject.yang.compiler.tool;
\ No newline at end of file
diff --git a/compiler/base/utils/src/main/java/org/onosproject/yang/compiler/utils/UtilConstants.java b/compiler/base/utils/src/main/java/org/onosproject/yang/compiler/utils/UtilConstants.java
index 22a8f98..8f5131b 100644
--- a/compiler/base/utils/src/main/java/org/onosproject/yang/compiler/utils/UtilConstants.java
+++ b/compiler/base/utils/src/main/java/org/onosproject/yang/compiler/utils/UtilConstants.java
@@ -1855,6 +1855,17 @@
      */
     public static final String CAMEL_CLASS = "Class";
 
+	/*
+     * Default meta data path.
+     */
+    public static final String DEFAULT_JAR_RES_PATH = SLASH + TEMP + SLASH +
+            YANG_RESOURCES + SLASH;
+
+    /**
+     * Meta data file name.
+     */
+    public static final String YANG_META_DATA = "YangMetaData.ser";
+
     // No instantiation.
     private UtilConstants() {
     }
diff --git a/compiler/plugin/buck/src/main/java/org/onosproject/yang/compiler/plugin/buck/YangGenerator.java b/compiler/plugin/buck/src/main/java/org/onosproject/yang/compiler/plugin/buck/YangGenerator.java
index ea69169..8a75131 100644
--- a/compiler/plugin/buck/src/main/java/org/onosproject/yang/compiler/plugin/buck/YangGenerator.java
+++ b/compiler/plugin/buck/src/main/java/org/onosproject/yang/compiler/plugin/buck/YangGenerator.java
@@ -16,82 +16,93 @@
 
 package org.onosproject.yang.compiler.plugin.buck;
 
-import org.onosproject.yang.compiler.datamodel.YangNode;
-import org.onosproject.yang.compiler.datamodel.utils.DataModelUtils;
-import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
-import org.onosproject.yang.compiler.base.tool.CallablePlugin;
-import org.onosproject.yang.compiler.base.tool.YangToolManager;
+import org.onosproject.yang.compiler.api.YangCompilationParam;
+import org.onosproject.yang.compiler.api.YangCompiledOutput;
+import org.onosproject.yang.compiler.api.YangCompilerException;
+import org.onosproject.yang.compiler.api.YangCompilerService;
+import org.onosproject.yang.compiler.tool.impl.DefaultYangCompilationParam;
+import org.onosproject.yang.compiler.tool.impl.YangCompilerManager;
 
 import java.io.File;
 import java.io.IOException;
-import java.util.ArrayList;
+import java.nio.file.Paths;
 import java.util.List;
 
-import static java.util.stream.Collectors.toList;
+import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.parseDepSchemaPath;
 import static org.onosproject.yang.compiler.utils.UtilConstants.SLASH;
 import static org.onosproject.yang.compiler.utils.UtilConstants.YANG_RESOURCES;
 
 /**
  * Generates Java sources from a Yang model.
  */
-public class YangGenerator implements CallablePlugin {
+public class YangGenerator {
 
     private final List<File> models;
     private final List<String> depJar;
-    private final String DEFAULT_JAR_RES_PATH = SLASH + YANG_RESOURCES + SLASH;
     private String outputDirectory;
+    private YangCompiledOutput output;
 
+    /**
+     * Creates an instance of YANG generator.
+     *
+     * @param models          YANG models
+     * @param outputDirectory output directory
+     * @param depJar          dependent jar paths
+     */
     YangGenerator(List<File> models, String outputDirectory, List<String> depJar) {
         this.models = models;
         this.depJar = depJar;
         this.outputDirectory = outputDirectory + SLASH;
     }
 
+    /**
+     * Executes YANG library code generation step.
+     *
+     * @throws YangParsingException when fails to parse yang files
+     */
     public void execute() throws YangParsingException {
-        List<String> files = getListOfFile();
-        synchronized (files) {
-            try {
-                YangPluginConfig config = new YangPluginConfig();
-                config.setCodeGenDir(outputDirectory);
-                config.resourceGenDir(outputDirectory + DEFAULT_JAR_RES_PATH);
-                //for inter-jar linking.
-                List<YangNode> dependentSchema = new ArrayList<>();
-                for (String jar : depJar) {
-                    dependentSchema.addAll(DataModelUtils.parseJarFile(jar, outputDirectory));
+        synchronized (YangGenerator.class) {
+            //Yang compiler service.
+            YangCompilerService compiler = new YangCompilerManager();
+
+            //Create compiler param.
+            YangCompilationParam param = new DefaultYangCompilationParam();
+
+            //Need to get dependent schema paths to give inter jar dependencies.
+            for (String jar : depJar) {
+                try {
+                    File path = parseDepSchemaPath(jar, outputDirectory);
+                    if (path != null) {
+                        param.addDependentSchema(Paths.get(path.getAbsolutePath()));
+                    }
+                } catch (IOException e) {
+                    throw new YangCompilerException(
+                            "Failed to parse dependent schema path");
                 }
-                //intra jar file linking.
-                YangToolManager manager = new YangToolManager();
-                manager.compileYangFiles(manager.createYangFileInfoSet(files),
-                                         dependentSchema, config, this);
-            } catch (Exception e) {
+            }
+            param.setCodeGenDir(Paths.get(outputDirectory));
+            param.setMetadataGenDir(Paths.get(outputDirectory + SLASH +
+                                                      YANG_RESOURCES + SLASH));
+
+            for (File file : models) {
+                param.addYangFile(Paths.get(file.getAbsolutePath()));
+            }
+
+            //Compile yang files and generate java code.
+            try {
+                output = compiler.compileYangFiles(param);
+            } catch (IOException e) {
                 throw new YangParsingException(e);
             }
         }
     }
 
-    private List<String> getListOfFile() {
-        List<String> files = new ArrayList<>();
-        if (models != null) {
-            synchronized (models) {
-                files.addAll(models.stream().map(File::toString)
-                                     .collect(toList()));
-            }
-        }
-        return files;
-    }
-
-    @Override
-    public void addGeneratedCodeToBundle() {
-        //TODO: add functionality.
-    }
-
-    @Override
-    public void addCompiledSchemaToBundle() throws IOException {
-        //TODO: add functionality.
-    }
-
-    @Override
-    public void addYangFilesToBundle() throws IOException {
-        //TODO: add functionality.
+    /**
+     * Returns YANG compiled output.
+     *
+     * @return YANG compiled output
+     */
+    public YangCompiledOutput output() {
+        return output;
     }
 }
diff --git a/compiler/plugin/maven/src/main/java/org/onosproject/yang/compiler/plugin/maven/YangPluginUtils.java b/compiler/plugin/maven/src/main/java/org/onosproject/yang/compiler/plugin/maven/YangPluginUtils.java
index 1a43f6c..5a7a674 100644
--- a/compiler/plugin/maven/src/main/java/org/onosproject/yang/compiler/plugin/maven/YangPluginUtils.java
+++ b/compiler/plugin/maven/src/main/java/org/onosproject/yang/compiler/plugin/maven/YangPluginUtils.java
@@ -20,29 +20,28 @@
 import org.apache.maven.model.Dependency;
 import org.apache.maven.model.Resource;
 import org.apache.maven.project.MavenProject;
-import org.onosproject.yang.compiler.base.tool.YangToolManager;
-import org.onosproject.yang.compiler.datamodel.YangNode;
-import org.onosproject.yang.compiler.datamodel.utils.DataModelUtils;
-import org.onosproject.yang.compiler.utils.io.impl.YangIoUtils;
 import org.slf4j.Logger;
 import org.sonatype.plexus.build.incremental.BuildContext;
 
 import java.io.File;
 import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.List;
 
+import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.parseDepSchemaPath;
 import static org.onosproject.yang.compiler.utils.UtilConstants.HYPHEN;
 import static org.onosproject.yang.compiler.utils.UtilConstants.JAR;
 import static org.onosproject.yang.compiler.utils.UtilConstants.PERIOD;
 import static org.onosproject.yang.compiler.utils.UtilConstants.SLASH;
-import static org.onosproject.yang.compiler.utils.UtilConstants.TEMP;
+import static org.onosproject.yang.compiler.utils.io.impl.YangIoUtils.getPackageDirPathFromJavaJPackage;
 import static org.slf4j.LoggerFactory.getLogger;
 
 /**
  * Represents YANG plugin utilities.
  */
-public final class YangPluginUtils {
+final class YangPluginUtils {
 
     private static final Logger log = getLogger(YangPluginUtils.class);
 
@@ -63,40 +62,6 @@
     }
 
     /**
-     * Copies YANG files to the current project's output directory.
-     *
-     * @param outputDir project's output directory
-     * @param project   maven project
-     * @throws IOException when fails to copy files to destination resource directory
-     */
-    static void copyYangFilesToTarget(String outputDir, MavenProject project)
-            throws IOException {
-        addToProjectResource(outputDir + SLASH + TEMP + SLASH, project);
-    }
-
-    /**
-     * Serializes data-model.
-     *
-     * @param directory base directory for serialized files
-     * @param project   maven project
-     * @param operation true if need to add to resource
-     * @throws IOException when fails to do IO operations
-     */
-    public static void serializeDataModel(String directory,
-                                          MavenProject project,
-                                          boolean operation)
-            throws IOException {
-
-        String serFileDirPath = directory + YangToolManager.DEFAULT_JAR_RES_PATH;
-        File dir = new File(serFileDirPath);
-        dir.mkdirs();
-
-        if (operation) {
-            addToProjectResource(directory + SLASH + TEMP + SLASH, project);
-        }
-    }
-
-    /**
      * Returns list of jar path.
      *
      * @param project         maven project
@@ -104,8 +69,9 @@
      * @param remoteRepos     remote repository
      * @return list of jar paths
      */
-    private static List<String> resolveDependencyJarPath(MavenProject project, ArtifactRepository localRepository,
-                                                         List<ArtifactRepository> remoteRepos) {
+    private static List<String> resolveDependencyJarPath(
+            MavenProject project, ArtifactRepository localRepository,
+            List<ArtifactRepository> remoteRepos) {
 
         StringBuilder path = new StringBuilder();
         List<String> jarPaths = new ArrayList<>();
@@ -114,7 +80,7 @@
             Dependency dependency = (Dependency) obj;
             path.append(localRepository.getBasedir());
             path.append(SLASH);
-            path.append(YangIoUtils.getPackageDirPathFromJavaJPackage(dependency.getGroupId()));
+            path.append(getPackageDirPathFromJavaJPackage(dependency.getGroupId()));
             path.append(SLASH);
             path.append(dependency.getArtifactId());
             path.append(SLASH);
@@ -141,23 +107,29 @@
      * @param localRepository local maven repository
      * @param remoteRepos     list of remote repository
      * @param directory       directory for serialized files
-     * @return list of resolved datamodel nodes
+     * @return list of resolved serialized file paths
      * @throws IOException when fails to do IO operations
      */
-    static List<YangNode> resolveInterJarDependencies(MavenProject project, ArtifactRepository localRepository,
-                                                      List<ArtifactRepository> remoteRepos, String directory)
+    static List<Path> resolveInterJarDependencies(MavenProject project,
+                                                  ArtifactRepository localRepository,
+                                                  List<ArtifactRepository> remoteRepos,
+                                                  String directory)
             throws IOException {
 
-        List<String> dependenciesJarPaths = resolveDependencyJarPath(project, localRepository, remoteRepos);
-        List<YangNode> resolvedDataModelNodes = new ArrayList<>();
-        for (String dependency : dependenciesJarPaths) {
-            resolvedDataModelNodes.addAll(DataModelUtils.parseJarFile(dependency, directory));
+        List<String> depJars = resolveDependencyJarPath(
+                project, localRepository, remoteRepos);
+        List<Path> serFilePaths = new ArrayList<>();
+        for (String dependency : depJars) {
+            File path = parseDepSchemaPath(dependency, directory);
+            if (path != null) {
+                serFilePaths.add(Paths.get(path.getAbsolutePath()));
+            }
         }
-        return resolvedDataModelNodes;
+        return serFilePaths;
     }
 
     /* Adds directory to resources of project */
-    private static void addToProjectResource(String dir, MavenProject project) {
+    static void addToProjectResource(String dir, MavenProject project) {
         Resource rsc = new Resource();
         rsc.setDirectory(dir);
         project.addResource(rsc);
diff --git a/compiler/plugin/maven/src/main/java/org/onosproject/yang/compiler/plugin/maven/YangUtilManager.java b/compiler/plugin/maven/src/main/java/org/onosproject/yang/compiler/plugin/maven/YangUtilManager.java
index 903c705..facb2c7 100644
--- a/compiler/plugin/maven/src/main/java/org/onosproject/yang/compiler/plugin/maven/YangUtilManager.java
+++ b/compiler/plugin/maven/src/main/java/org/onosproject/yang/compiler/plugin/maven/YangUtilManager.java
@@ -25,44 +25,28 @@
 import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.rtinfo.RuntimeInformation;
-import org.onosproject.yang.compiler.datamodel.YangDeviationHolder;
-import org.onosproject.yang.compiler.parser.YangUtilsParser;
-import org.onosproject.yang.compiler.parser.exceptions.ParserException;
-import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
-import org.onosproject.yang.compiler.base.tool.CallablePlugin;
-import org.onosproject.yang.compiler.base.tool.YangFileInfo;
-import org.onosproject.yang.compiler.base.tool.YangToolManager;
-import org.onosproject.yang.compiler.base.tool.exception.YangToolException;
-import org.onosproject.yang.compiler.datamodel.ResolvableType;
-import org.onosproject.yang.compiler.datamodel.YangNode;
-import org.onosproject.yang.compiler.datamodel.YangReferenceResolver;
-import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
-import org.onosproject.yang.compiler.linker.YangLinker;
-import org.onosproject.yang.compiler.linker.exceptions.LinkerException;
-import org.onosproject.yang.compiler.linker.impl.YangLinkerManager;
-import org.onosproject.yang.compiler.translator.tojava.JavaCodeGeneratorUtil;
-import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
-import org.onosproject.yang.compiler.utils.io.YangToJavaNamingConflictUtil;
+import org.onosproject.yang.compiler.api.YangCompilationParam;
+import org.onosproject.yang.compiler.api.YangCompiledOutput;
+import org.onosproject.yang.compiler.api.YangCompilerException;
+import org.onosproject.yang.compiler.api.YangCompilerService;
+import org.onosproject.yang.compiler.tool.impl.DefaultYangCompilationParam;
+import org.onosproject.yang.compiler.tool.impl.YangCompilerManager;
 import org.sonatype.plexus.build.incremental.BuildContext;
 
 import java.io.IOException;
-import java.util.HashSet;
-import java.util.LinkedList;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.List;
-import java.util.Set;
 
-import static java.util.Collections.sort;
 import static org.apache.maven.plugins.annotations.LifecyclePhase.PROCESS_SOURCES;
 import static org.apache.maven.plugins.annotations.ResolutionScope.COMPILE;
-import static org.onosproject.yang.compiler.linker.impl.YangLinkerUtils.resolveGroupingInDefinationScope;
 import static org.onosproject.yang.compiler.plugin.maven.YangPluginUtils.addToCompilationRoot;
-import static org.onosproject.yang.compiler.plugin.maven.YangPluginUtils.copyYangFilesToTarget;
+import static org.onosproject.yang.compiler.plugin.maven.YangPluginUtils.addToProjectResource;
 import static org.onosproject.yang.compiler.plugin.maven.YangPluginUtils.resolveInterJarDependencies;
-import static org.onosproject.yang.compiler.plugin.maven.YangPluginUtils.serializeDataModel;
 import static org.onosproject.yang.compiler.utils.UtilConstants.DEFAULT_BASE_PKG;
+import static org.onosproject.yang.compiler.utils.UtilConstants.DEFAULT_JAR_RES_PATH;
 import static org.onosproject.yang.compiler.utils.UtilConstants.EMPTY_STRING;
 import static org.onosproject.yang.compiler.utils.UtilConstants.IN;
-import static org.onosproject.yang.compiler.utils.UtilConstants.NEW_LINE;
 import static org.onosproject.yang.compiler.utils.UtilConstants.SLASH;
 import static org.onosproject.yang.compiler.utils.UtilConstants.TEMP;
 import static org.onosproject.yang.compiler.utils.UtilConstants.VERSION_ERROR;
@@ -81,29 +65,23 @@
  */
 @Mojo(name = "yang2java", defaultPhase = PROCESS_SOURCES,
         requiresDependencyResolution = COMPILE)
-public class YangUtilManager extends AbstractMojo implements CallablePlugin {
+public class YangUtilManager extends AbstractMojo {
 
-    private static final String DEFAULT_PKG =
-            getPackageDirPathFromJavaJPackage(DEFAULT_BASE_PKG);
     private static final int SUPPORTED_VERSION = 339;
-    private final YangPluginConfig yangPlugin = new YangPluginConfig();
-    private final YangUtilsParser yangUtilsParser = new YangUtilsParserManager();
-    private final YangLinker yangLinker = new YangLinkerManager();
-    private final Set<YangNode> yangNodeSet = new HashSet<>();
-    private YangNode rootNode;
-    // YANG file information set.
-    private Set<YangFileInfo> yangFileInfoSet = new HashSet<>();
-    private YangFileInfo curYangFileInfo = new YangFileInfo();
+    private String codeGenDir;
+    private YangCompiledOutput output;
+
     /**
      * Source directory for YANG files.
      */
-    @Parameter(property = "yangFilesDir", defaultValue = "src/main/yang")
+    @Parameter(property = "yangFilesDir", defaultValue = "src/main/yang/")
     private String yangFilesDir;
 
     /**
      * Source directory for generated files.
      */
-    @Parameter(property = "classFileDir", defaultValue = "target/generated-sources")
+    @Parameter(property = "classFileDir", defaultValue =
+            "target/generated-sources/")
     private String classFileDir;
 
     /**
@@ -127,36 +105,6 @@
     private MavenProject project;
 
     /**
-     * Replacement required for period special character in the identifier.
-     */
-    @Parameter(property = "replacementForPeriod")
-    private String replacementForPeriod;
-
-    /**
-     * Replacement required for underscore special character in the identifier.
-     */
-    @Parameter(property = "replacementForUnderscore")
-    private String replacementForUnderscore;
-
-    /**
-     * Replacement required for hyphen special character in the identifier.
-     */
-    @Parameter(property = "replacementForHyphen")
-    private String replacementForHyphen;
-
-    /**
-     * Prefix which is required for adding with the identifier.
-     */
-    @Parameter(property = "prefixForIdentifier")
-    private String prefixForIdentifier;
-
-    /**
-     * Build context.
-     */
-    @Component
-    private BuildContext context;
-
-    /**
      * Local maven repository.
      */
     @Parameter(readonly = true, defaultValue = "${localRepository}")
@@ -169,10 +117,10 @@
     private List<ArtifactRepository> remoteRepository;
 
     /**
-     * Code generation is for nbi or sbi.
+     * Build context.
      */
-    @Parameter(property = "generateJavaFileForSbi", defaultValue = "nbi")
-    private String generateJavaFileForSbi;
+    @Component
+    private BuildContext context;
 
     /**
      * The Runtime information for the current instance of Maven.
@@ -186,13 +134,12 @@
     @Parameter(defaultValue = "maven.version")
     private String versionProperty;
 
-    private String outputDir;
-    private String codeGenDir;
-
     @Override
     public void execute()
             throws MojoExecutionException, MojoFailureException {
 
+        String metaDataGenDir;
+        String outputDir;
         try {
             validateMavenVersion();
             /*
@@ -202,44 +149,46 @@
             deleteDirectory(outputDir + SLASH + TEMP);
             deleteDirectory(outputDir + SLASH + YANG_RESOURCES);
             String searchDir = getDirectory(baseDir, yangFilesDir);
+
+            //Get the code gen directory.
             codeGenDir = getDirectory(baseDir, classFileDir) + SLASH;
+            //Get the meta data gen directory.
+            metaDataGenDir = outputDir + SLASH + DEFAULT_JAR_RES_PATH;
 
-            // Creates conflict resolver and set values to it.
-            YangToJavaNamingConflictUtil conflictResolver = new YangToJavaNamingConflictUtil();
-            conflictResolver.setReplacementForPeriod(replacementForPeriod);
-            conflictResolver.setReplacementForHyphen(replacementForHyphen);
-            conflictResolver.setReplacementForUnderscore(replacementForUnderscore);
-            conflictResolver.setPrefixForIdentifier(prefixForIdentifier);
-            yangPlugin.setCodeGenDir(codeGenDir);
-            yangPlugin.setConflictResolver(conflictResolver);
+            //Yang compiler service.
+            YangCompilerService compiler = new YangCompilerManager();
 
-            yangPlugin.resourceGenDir(outputDir + YangToolManager.DEFAULT_JAR_RES_PATH);
-            yangPlugin.setCodeGenerateForSbi(generateJavaFileForSbi.toLowerCase());
+            //Need to get dependent schema paths to give inter jar dependencies.
+            List<Path> depSchemas = resolveInterJarDependencies(
+                    project, localRepository, remoteRepository, outputDir);
 
-            /*
-             * Obtain the YANG files at a path mentioned in plugin and creates
-             * YANG file information set.
-             */
+            //Create compiler param.
+            YangCompilationParam param = new DefaultYangCompilationParam();
+            param.setCodeGenDir(Paths.get(codeGenDir));
+            param.setMetadataGenDir(Paths.get(metaDataGenDir));
 
-            YangToolManager toolManager = new YangToolManager();
+            for (Path path : depSchemas) {
+                param.addDependentSchema(path);
+            }
 
-            yangFileInfoSet = toolManager.createYangFileInfoSet(
-                    getYangFiles(searchDir));
-            List<YangNode> interJarResolvedNodes =
-                    resolveInterJarDependencies(project, localRepository,
-                                                remoteRepository, outputDir);
-            toolManager.compileYangFiles(yangFileInfoSet,
-                                         interJarResolvedNodes, yangPlugin,
-                                         this);
-        } catch (YangToolException e) {
+            for (String file : getYangFiles(searchDir)) {
+                param.addYangFile(Paths.get(file));
+            }
+
+            //Compile yang files and generate java code.
+            output = compiler.compileYangFiles(param);
+
+            addToCompilationRoot(codeGenDir, project, context);
+            addToProjectResource(outputDir + SLASH + TEMP + SLASH, project);
+        } catch (YangCompilerException e) {
             String fileName = EMPTY_STRING;
-            if (e.getCurYangFile() != null) {
-                fileName = e.getCurYangFile().getYangFileName();
+            if (e.getYangFile() != null) {
+                fileName = e.getYangFile().toString();
             }
             try {
-                deleteDirectory(codeGenDir + DEFAULT_PKG);
+                deleteDirectory(codeGenDir + getPackageDirPathFromJavaJPackage(
+                        DEFAULT_BASE_PKG));
             } catch (IOException ex) {
-                e.printStackTrace();
                 throw new MojoExecutionException(
                         "Error handler failed to delete files for data model node.");
             }
@@ -264,169 +213,4 @@
             throw new MojoExecutionException(VERSION_ERROR + version);
         }
     }
-
-    /**
-     * Returns the YANG node set.
-     *
-     * @return YANG node set
-     */
-    public Set<YangNode> getYangNodeSet() {
-        return yangNodeSet;
-    }
-
-    /**
-     * TODO: Delete me and use the tool code for UT test cases
-     * Links all the provided with the YANG file info set.
-     *
-     * @throws MojoExecutionException a violation in mojo execution
-     */
-    public void resolveDependenciesUsingLinker()
-            throws MojoExecutionException {
-        createYangNodeSet();
-        try {
-            yangLinker.resolveDependencies(yangNodeSet);
-        } catch (LinkerException e) {
-            printLog(e.getFileName(), e.getLineNumber(), e.getCharPositionInLine(),
-                     e.getMessage(), e.getLocalizedMessage());
-            throw new MojoExecutionException(e.getMessage());
-        }
-    }
-
-    /**
-     * TODO: Delete me and use the tool code for UT test cases
-     * Creates YANG nodes set.
-     */
-    public void createYangNodeSet() {
-        for (YangFileInfo yangFileInfo : yangFileInfoSet) {
-            yangNodeSet.add(yangFileInfo.getRootNode());
-        }
-    }
-
-    /**
-     * TODO: Delete me and use the tool code for UT test cases
-     * Parses all the provided YANG files and generates YANG data model tree.
-     *
-     * @throws IOException a violation in IO
-     */
-    public void parseYangFileInfoSet()
-            throws IOException {
-        for (YangFileInfo yangFileInfo : yangFileInfoSet) {
-            curYangFileInfo = yangFileInfo;
-            if (yangFileInfo.isForTranslator()) {
-                try {
-                    YangNode yangNode = yangUtilsParser.getDataModel(
-                            yangFileInfo.getYangFileName());
-                    yangFileInfo.setRootNode(yangNode);
-                    rootNode = yangNode;
-                    resolveGroupingInDefinationScope((YangReferenceResolver) yangNode);
-                    try {
-                        ((YangReferenceResolver) yangNode)
-                                .resolveSelfFileLinking(ResolvableType.YANG_DERIVED_DATA_TYPE);
-                        ((YangReferenceResolver) yangNode)
-                                .resolveSelfFileLinking(ResolvableType.YANG_IDENTITYREF);
-                    } catch (DataModelException e) {
-                        printLog(e.getFileName(), e.getLineNumber(), e
-                                .getCharPositionInLine(), e.getMessage(), e
-                                         .getLocalizedMessage());
-                    }
-                } catch (ParserException e) {
-                    printLog(e.getFileName(), e.getLineNumber(), e
-                            .getCharPositionInLine(), e.getMessage(), e
-                                     .getLocalizedMessage());
-                    throw e;
-                }
-            }
-        }
-    }
-
-    /**
-     * TODO: Delete me and use the tool code for UT test cases
-     * Translates to java code corresponding to the YANG schema.
-     *
-     * @param yangPlugin YANG plugin config
-     * @throws IOException when fails to generate java code file the current node
-     */
-    public void translateToJava(YangPluginConfig yangPlugin)
-            throws IOException {
-        List<YangNode> yangNodeSortedList = new LinkedList<>();
-        yangNodeSortedList.addAll(yangNodeSet);
-        sort(yangNodeSortedList);
-        for (YangNode node : yangNodeSortedList) {
-            if (node.isToTranslate() && (!((YangDeviationHolder) node)
-                    .isModuleForDeviation())) {
-                JavaCodeGeneratorUtil.generateJavaCode(node, yangPlugin);
-            }
-        }
-    }
-
-    /**
-     * Creates a YANG file info set.
-     *
-     * @param yangFileList YANG files list
-     */
-    public void createYangFileInfoSet(List<String> yangFileList) {
-        for (String yangFile : yangFileList) {
-            YangFileInfo yangFileInfo = new YangFileInfo();
-            yangFileInfo.setYangFileName(yangFile);
-            yangFileInfoSet.add(yangFileInfo);
-        }
-    }
-
-    /**
-     * TODO: Delete me and use the tool code for UT test cases
-     * Returns the YANG file info set.
-     *
-     * @return the YANG file info set
-     */
-    public Set<YangFileInfo> getYangFileInfoSet() {
-        return yangFileInfoSet;
-    }
-
-    /**
-     * TODO: Delete me and use the tool code for UT test cases
-     * Sets the YANG file info set.
-     *
-     * @param yangFileInfoSet the YANG file info set
-     */
-    void setYangFileInfoSet(Set<YangFileInfo> yangFileInfoSet) {
-        this.yangFileInfoSet = yangFileInfoSet;
-    }
-
-    /**
-     * Adds log info for exception.
-     *
-     * @param fileName file name
-     * @param line     line number
-     * @param position character position
-     * @param msg      error message
-     * @param localMsg local message
-     */
-    private void printLog(String fileName, int line, int position, String
-            msg, String localMsg) {
-        String logInfo = "Error in file: " + fileName;
-        if (line != 0) {
-            logInfo = logInfo + " at line: " + line + " at position: "
-                    + position;
-        }
-        if (msg != null) {
-            logInfo = logInfo + NEW_LINE + localMsg;
-        }
-        getLog().info(logInfo);
-    }
-
-    @Override
-    public void addGeneratedCodeToBundle() {
-        addToCompilationRoot(codeGenDir, project, context);
-    }
-
-
-    @Override
-    public void addCompiledSchemaToBundle() throws IOException {
-        serializeDataModel(outputDir, project, true);
-    }
-
-    @Override
-    public void addYangFilesToBundle() throws IOException {
-        copyYangFilesToTarget(outputDir, project);
-    }
 }
diff --git a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/AugmentTranslatorTest.java b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/AugmentTranslatorTest.java
index 3d7a6e6..f188058 100644
--- a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/AugmentTranslatorTest.java
+++ b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/AugmentTranslatorTest.java
@@ -18,20 +18,26 @@
 
 import org.apache.maven.plugin.MojoExecutionException;
 import org.junit.Test;
-import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
-import org.onosproject.yang.compiler.utils.io.impl.YangFileScanner;
-import org.onosproject.yang.compiler.utils.io.impl.YangIoUtils;
 import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.tool.impl.YangCompilerManager;
+import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
 
 import java.io.File;
 import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashSet;
+import java.util.Set;
+
+import static org.onosproject.yang.compiler.utils.io.impl.YangFileScanner.getYangFiles;
+import static org.onosproject.yang.compiler.utils.io.impl.YangIoUtils.deleteDirectory;
 
 /**
  * Unit test case for augment translator.
  */
 public class AugmentTranslatorTest {
 
-    private final YangUtilManager utilManager = new YangUtilManager();
+    private final YangCompilerManager utilManager = new YangCompilerManager();
     private static final String DIR = "target/augmentTranslator/";
     private static final String COMP = System.getProperty("user.dir") + File
             .separator + DIR;
@@ -44,9 +50,15 @@
     @Test
     public void processAugmentTranslator() throws IOException, ParserException, MojoExecutionException {
 
-        YangIoUtils.deleteDirectory(DIR);
+        deleteDirectory(DIR);
         String searchDir = "src/test/resources/augmentTranslator";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
@@ -55,7 +67,7 @@
         yangPluginConfig.setCodeGenDir(DIR);
         utilManager.translateToJava(yangPluginConfig);
         YangPluginConfig.compileCode(COMP);
-        YangIoUtils.deleteDirectory(DIR);
+        deleteDirectory(DIR);
     }
 
     /**
@@ -68,9 +80,15 @@
     @Test
     public void processRpcAugmentIntraTranslator() throws IOException,
             ParserException, MojoExecutionException {
-        YangIoUtils.deleteDirectory(DIR);
+        deleteDirectory(DIR);
         String searchDir = "src/test/resources/rpcAugment/intra";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
@@ -78,20 +96,26 @@
         YangPluginConfig yangPluginConfig = new YangPluginConfig();
         yangPluginConfig.setCodeGenDir(DIR);
         utilManager.translateToJava(yangPluginConfig);
-        YangIoUtils.deleteDirectory(DIR);
+        deleteDirectory(DIR);
     }
 
     /**
      * Checks augment translation should not result in any exception.
      *
-     * @throws MojoExecutionException
+     * @throws MojoExecutionException when fails to mojo operations
      */
     @Test
     public void processRpcAugmentInterTranslator() throws IOException,
             ParserException, MojoExecutionException {
-        YangIoUtils.deleteDirectory(DIR);
+        deleteDirectory(DIR);
         String searchDir = "src/test/resources/rpcAugment/inter";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
@@ -100,20 +124,26 @@
         yangPluginConfig.setCodeGenDir(DIR);
         utilManager.translateToJava(yangPluginConfig);
         YangPluginConfig.compileCode(COMP);
-        YangIoUtils.deleteDirectory(DIR);
+        deleteDirectory(DIR);
     }
 
     /**
      * Checks augment translation should not result in any exception.
      *
-     * @throws MojoExecutionException
+     * @throws MojoExecutionException when fails
      */
     @Test
     public void processChoiceAugmentInterTranslator() throws IOException,
             ParserException, MojoExecutionException {
-        YangIoUtils.deleteDirectory(DIR);
+        deleteDirectory(DIR);
         String searchDir = "src/test/resources/choiceAugment";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
@@ -122,7 +152,6 @@
         yangPluginConfig.setCodeGenDir(DIR);
         utilManager.translateToJava(yangPluginConfig);
         YangPluginConfig.compileCode(COMP);
-        YangIoUtils.deleteDirectory(DIR);
+        deleteDirectory(DIR);
     }
-
 }
diff --git a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/ChoiceCaseTranslatorTest.java b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/ChoiceCaseTranslatorTest.java
index 3a1976b..a9d14c7 100644
--- a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/ChoiceCaseTranslatorTest.java
+++ b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/ChoiceCaseTranslatorTest.java
@@ -21,14 +21,19 @@
 import org.onosproject.yang.compiler.datamodel.YangNode;
 import org.onosproject.yang.compiler.parser.exceptions.ParserException;
 import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+import org.onosproject.yang.compiler.tool.impl.YangCompilerManager;
 import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
-import org.onosproject.yang.compiler.utils.io.impl.YangFileScanner;
 import org.onosproject.yang.compiler.utils.io.impl.YangIoUtils;
 
 import java.io.File;
 import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashSet;
+import java.util.Set;
 
 import static org.onosproject.yang.compiler.translator.tojava.JavaCodeGeneratorUtil.generateJavaCode;
+import static org.onosproject.yang.compiler.utils.io.impl.YangFileScanner.getYangFiles;
 
 /**
  * Unit tests for choice-case translator.
@@ -37,7 +42,7 @@
     private static final String DIR = "target/ChoiceCaseTestGenFile/";
     private static final String COMP = System.getProperty("user.dir") + File
             .separator + DIR;
-    private final YangUtilManager utilManager = new YangUtilManager();
+    private final YangCompilerManager utilManager = new YangCompilerManager();
     private final YangUtilsParserManager manager = new YangUtilsParserManager();
 
     /**
@@ -69,7 +74,13 @@
             ParserException, MojoExecutionException {
         YangIoUtils.deleteDirectory(DIR);
         String searchDir = "src/test/resources/choiceTranslator";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
diff --git a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/CompilerAnnotationTest.java b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/CompilerAnnotationTest.java
index d020cee..8e4cb8b 100644
--- a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/CompilerAnnotationTest.java
+++ b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/CompilerAnnotationTest.java
@@ -19,19 +19,25 @@
 
 import org.apache.maven.plugin.MojoExecutionException;
 import org.junit.Test;
-import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
-import org.onosproject.yang.compiler.utils.io.impl.YangFileScanner;
-import org.onosproject.yang.compiler.utils.io.impl.YangIoUtils;
 import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.tool.impl.YangCompilerManager;
+import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
+import org.onosproject.yang.compiler.utils.io.impl.YangIoUtils;
 
 import java.io.File;
 import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashSet;
+import java.util.Set;
+
+import static org.onosproject.yang.compiler.utils.io.impl.YangFileScanner.getYangFiles;
 
 /**
  * Unit test case for compiler annotation.
  */
 public class CompilerAnnotationTest {
-    private final YangUtilManager utilManager = new YangUtilManager();
+    private final YangCompilerManager utilManager = new YangCompilerManager();
     private static final String DIR = "target/compiler/";
     private static final String COMP = System.getProperty("user.dir") + File
             .separator + DIR;
@@ -47,7 +53,12 @@
             ParserException, MojoExecutionException {
         YangIoUtils.deleteDirectory(DIR);
         String searchDir = "src/test/resources/compilerAnnotation";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
diff --git a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/GroupingTranslatorTest.java b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/GroupingTranslatorTest.java
index d7e6580..16bb01f 100644
--- a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/GroupingTranslatorTest.java
+++ b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/GroupingTranslatorTest.java
@@ -18,20 +18,27 @@
 
 import org.apache.maven.plugin.MojoExecutionException;
 import org.junit.Test;
-import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
-import org.onosproject.yang.compiler.utils.io.impl.YangFileScanner;
-import org.onosproject.yang.compiler.utils.io.impl.YangIoUtils;
 import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.tool.impl.YangCompilerManager;
+import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
+import org.onosproject.yang.compiler.utils.io.impl.YangIoUtils;
 
 import java.io.File;
 import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashSet;
+import java.util.Set;
+
+import static org.onosproject.yang.compiler.utils.io.impl.YangFileScanner.getYangFiles;
 
 /**
  * Unit test case for grouping translator.
  */
 public class GroupingTranslatorTest {
 
-    private final YangUtilManager utilManager = new YangUtilManager();
+    private final YangCompilerManager utilManager =
+            new YangCompilerManager();
     private static final String DIR = "target/groupingTranslator/";
     private static final String COMP = System.getProperty("user.dir") + File
             .separator + DIR;
@@ -46,7 +53,12 @@
 
         YangIoUtils.deleteDirectory(DIR);
         String searchDir = "src/test/resources/grouping";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
@@ -57,5 +69,4 @@
         YangPluginConfig.compileCode(COMP);
         YangIoUtils.deleteDirectory(DIR);
     }
-
 }
diff --git a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/IdentityTranslatorTest.java b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/IdentityTranslatorTest.java
index 2835a64..2346397 100644
--- a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/IdentityTranslatorTest.java
+++ b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/IdentityTranslatorTest.java
@@ -22,28 +22,34 @@
 import org.onosproject.yang.compiler.datamodel.YangModule;
 import org.onosproject.yang.compiler.datamodel.YangNode;
 import org.onosproject.yang.compiler.linker.impl.YangLinkerManager;
-import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
-import org.onosproject.yang.compiler.utils.io.impl.YangFileScanner;
-import org.onosproject.yang.compiler.utils.io.impl.YangIoUtils;
 import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.tool.impl.YangCompilerManager;
+import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
 
 import java.io.File;
 import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashSet;
+import java.util.Set;
 
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.core.Is.is;
 import static org.onosproject.yang.compiler.datamodel.YangNodeType.MODULE_NODE;
 import static org.onosproject.yang.compiler.linker.impl.YangLinkerUtils.updateFilePriority;
 import static org.onosproject.yang.compiler.utils.io.YangPluginConfig.compileCode;
+import static org.onosproject.yang.compiler.utils.io.impl.YangFileScanner.getYangFiles;
 import static org.onosproject.yang.compiler.utils.io.impl.YangIoUtils.deleteDirectory;
 
+
 /**
  * Translator test case for identity.
  */
 public class IdentityTranslatorTest {
 
-    private final YangUtilManager utilManager = new YangUtilManager();
     private final YangLinkerManager yangLinkerManager = new YangLinkerManager();
+    private final YangCompilerManager utilManager =
+            new YangCompilerManager();
     private static final String DIR = "target/identity/";
     private static final String COMP = System.getProperty("user.dir") + File
             .separator + DIR;
@@ -58,7 +64,12 @@
             ParserException, MojoExecutionException {
         deleteDirectory(DIR);
         String searchDir = "src/test/resources/identityTranslator";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
@@ -80,7 +91,12 @@
             ParserException, MojoExecutionException {
         deleteDirectory(DIR);
         String searchDir = "src/test/resources/multipleIdentity";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
diff --git a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/IncludeReferenceWithPrefix.java b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/IncludeReferenceWithPrefix.java
index fc35b92..cf1e089 100644
--- a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/IncludeReferenceWithPrefix.java
+++ b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/IncludeReferenceWithPrefix.java
@@ -18,20 +18,27 @@
 
 import org.apache.maven.plugin.MojoExecutionException;
 import org.junit.Test;
-import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
-import org.onosproject.yang.compiler.utils.io.impl.YangFileScanner;
-import org.onosproject.yang.compiler.utils.io.impl.YangIoUtils;
 import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.tool.impl.YangCompilerManager;
+import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
+import org.onosproject.yang.compiler.utils.io.impl.YangIoUtils;
 
 import java.io.File;
 import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashSet;
+import java.util.Set;
+
+import static org.onosproject.yang.compiler.utils.io.impl.YangFileScanner.getYangFiles;
 
 /**
  * Test cases for testing YANG schema node.
  */
 public class IncludeReferenceWithPrefix {
 
-    private final YangUtilManager utilManager = new YangUtilManager();
+    private final YangCompilerManager utilManager =
+            new YangCompilerManager();
 
     /**
      * Checks method to get schema node from map.
@@ -44,7 +51,12 @@
         String dir = "target/refincludecontentwithprefix/";
         YangIoUtils.deleteDirectory(dir);
         String searchDir = "src/test/resources/refincludecontentwithprefix";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
diff --git a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/InterFileDeviationLinkingTest.java b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/InterFileDeviationLinkingTest.java
index e1cf83f..69eed20 100644
--- a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/InterFileDeviationLinkingTest.java
+++ b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/InterFileDeviationLinkingTest.java
@@ -30,15 +30,19 @@
 import org.onosproject.yang.compiler.linker.exceptions.LinkerException;
 import org.onosproject.yang.compiler.linker.impl.YangLinkerManager;
 import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.tool.impl.YangCompilerManager;
 import org.onosproject.yang.compiler.translator.tojava.JavaFileInfoContainer;
 import org.onosproject.yang.compiler.translator.tojava.JavaFileInfoTranslator;
 import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
-import org.onosproject.yang.compiler.utils.io.impl.YangFileScanner;
 
 import java.io.File;
 import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Set;
 
 import static org.hamcrest.CoreMatchers.nullValue;
 import static org.hamcrest.MatcherAssert.assertThat;
@@ -50,6 +54,7 @@
 import static org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes.UINT16;
 import static org.onosproject.yang.compiler.linker.impl.YangLinkerUtils.updateFilePriority;
 import static org.onosproject.yang.compiler.utils.io.YangPluginConfig.compileCode;
+import static org.onosproject.yang.compiler.utils.io.impl.YangFileScanner.getYangFiles;
 import static org.onosproject.yang.compiler.utils.io.impl.YangIoUtils.deleteDirectory;
 
 
@@ -59,7 +64,8 @@
 public class InterFileDeviationLinkingTest {
 
     private static final String DIR = "target/deviationTest/";
-    private final YangUtilManager utilManager = new YangUtilManager();
+    private final YangCompilerManager utilManager =
+            new YangCompilerManager();
     private final YangLinkerManager yangLinkerManager = new YangLinkerManager();
     private static final String COMP = System.getProperty("user.dir") + File
             .separator + DIR;
@@ -72,7 +78,12 @@
             ParserException {
 
         String searchDir = "src/test/resources/deviationLinking";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
@@ -144,7 +155,6 @@
         // Check whether the node type is set properly to module.
         assertThat(selfNode.getNodeType(), is(MODULE_NODE));
 
-
         // Check whether the module name is set correctly.
         yangRefNode = (YangModule) refNode;
         assertThat(yangRefNode.getName(), is("Test2"));
@@ -186,7 +196,12 @@
             ParserException {
 
         String searchDir = "src/test/resources/deviationLinking";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
@@ -282,7 +297,12 @@
             ParserException {
 
         String searchDir = "src/test/resources/deviationLinking";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
@@ -386,7 +406,12 @@
             ParserException {
 
         String searchDir = "src/test/resources/deviationLinking";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
@@ -498,7 +523,12 @@
             ParserException {
 
         String searchDir = "src/test/resources/InvalidDeviation";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
diff --git a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/InterFileIdentityLinkingTest.java b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/InterFileIdentityLinkingTest.java
index 544047c..a2d6a67 100644
--- a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/InterFileIdentityLinkingTest.java
+++ b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/InterFileIdentityLinkingTest.java
@@ -32,27 +32,33 @@
 import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
 import org.onosproject.yang.compiler.linker.exceptions.LinkerException;
 import org.onosproject.yang.compiler.linker.impl.YangLinkerManager;
-import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
-import org.onosproject.yang.compiler.utils.io.impl.YangFileScanner;
-import org.onosproject.yang.compiler.utils.io.impl.YangIoUtils;
 import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.tool.impl.YangCompilerManager;
+import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
+import org.onosproject.yang.compiler.utils.io.impl.YangIoUtils;
 
 import java.io.File;
 import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashSet;
 import java.util.ListIterator;
+import java.util.Set;
 
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.core.Is.is;
 import static org.onosproject.yang.compiler.datamodel.YangNodeType.MODULE_NODE;
 import static org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes.IDENTITYREF;
 import static org.onosproject.yang.compiler.linker.impl.YangLinkerUtils.updateFilePriority;
+import static org.onosproject.yang.compiler.utils.io.impl.YangFileScanner.getYangFiles;
 
 /**
  * Test cases for testing inter file linking for identity.
  */
 public class InterFileIdentityLinkingTest {
 
-    private final YangUtilManager utilManager = new YangUtilManager();
+    private final YangCompilerManager utilManager =
+            new YangCompilerManager();
     private final YangLinkerManager yangLinkerManager = new YangLinkerManager();
 
     @Rule
@@ -66,7 +72,12 @@
             throws IOException, ParserException, MojoExecutionException {
 
         String searchDir = "src/test/resources/interfileidentityimport";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
@@ -140,7 +151,6 @@
         assertThat(yangIdentityRef.getBaseIdentity().getName(), is("ref-address-family"));
         assertThat(yangIdentityRef.getReferredIdentity().getName(), is("ref-address-family"));
         assertThat(yangIdentityRef.getResolvableStatus(), is(ResolvableStatus.RESOLVED));
-
     }
 
     @Test
@@ -148,7 +158,12 @@
 
         YangIoUtils.deleteDirectory("target/identityTranslator/");
         String searchDir = "src/test/resources/interfileidentityimport";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
@@ -169,7 +184,12 @@
             throws IOException, ParserException, MojoExecutionException {
 
         String searchDir = "src/test/resources/interfileidentityinlude";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
@@ -259,7 +279,12 @@
             throws IOException, ParserException, MojoExecutionException {
 
         String searchDir = "src/test/resources/interfileidentityimportdependency";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
@@ -343,7 +368,12 @@
             throws IOException, ParserException, MojoExecutionException {
 
         String searchDir = "src/test/resources/interfileidentityincludedependency";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
@@ -436,7 +466,12 @@
         thrown.expectMessage("YANG file error: Unable to find base identity for given base");
 
         String searchDir = "src/test/resources/interfileidentityimportdependencyUndefined";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
@@ -467,7 +502,12 @@
         thrown.expectMessage("YANG file error: Unable to find base identity for given base");
 
         String searchDir = "src/test/resources/interfileidentityincludedependencyUndefined";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
@@ -498,7 +538,12 @@
             throws IOException, ParserException, MojoExecutionException {
 
         String searchDir = "src/test/resources/interfileidentitytypedef";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
@@ -593,7 +638,12 @@
             throws IOException, ParserException, MojoExecutionException {
 
         String searchDir = "src/test/resources/interfileidentitytypedef";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
diff --git a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/InterFileIfFeatureLinkingTest.java b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/InterFileIfFeatureLinkingTest.java
index afcee89..adb854c 100644
--- a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/InterFileIfFeatureLinkingTest.java
+++ b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/InterFileIfFeatureLinkingTest.java
@@ -28,23 +28,29 @@
 import org.onosproject.yang.compiler.datamodel.utils.ResolvableStatus;
 import org.onosproject.yang.compiler.linker.impl.YangLinkerManager;
 import org.onosproject.yang.compiler.linker.impl.YangLinkerUtils;
-import org.onosproject.yang.compiler.utils.io.impl.YangFileScanner;
 import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.tool.impl.YangCompilerManager;
 
 import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashSet;
 import java.util.List;
 import java.util.ListIterator;
+import java.util.Set;
 
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.core.Is.is;
 import static org.onosproject.yang.compiler.datamodel.YangNodeType.MODULE_NODE;
+import static org.onosproject.yang.compiler.utils.io.impl.YangFileScanner.getYangFiles;
 
 /**
  * Test cases for testing inter file linking.
  */
 public class InterFileIfFeatureLinkingTest {
 
-    private final YangUtilManager utilManager = new YangUtilManager();
+    private final YangCompilerManager utilManager =
+            new YangCompilerManager();
     private final YangLinkerManager yangLinkerManager = new YangLinkerManager();
 
     /**
@@ -55,7 +61,12 @@
             throws IOException, ParserException, MojoExecutionException {
 
         String searchDir = "src/test/resources/interfilefeatureimport";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
@@ -121,7 +132,12 @@
             throws IOException, ParserException, MojoExecutionException {
 
         String searchDir = "src/test/resources/interfilefeatureinclude";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
@@ -193,7 +209,12 @@
             throws IOException, ParserException, MojoExecutionException {
 
         String searchDir = "src/test/resources/interfilefeatureimportdependency";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
@@ -261,7 +282,12 @@
             throws IOException, ParserException, MojoExecutionException {
 
         String searchDir = "src/test/resources/interfilefeatureincludedependency";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
@@ -334,7 +360,12 @@
             throws IOException, ParserException, MojoExecutionException {
 
         String searchDir = "src/test/resources/interfilefeatureimportdependencyUndefined";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
@@ -402,7 +433,12 @@
             throws IOException, ParserException, MojoExecutionException {
 
         String searchDir = "src/test/resources/interfilefeatureincludedependencyUndefined";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
diff --git a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/InterFileLeafrefLinkingTest.java b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/InterFileLeafrefLinkingTest.java
index ebda757..39b990c 100644
--- a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/InterFileLeafrefLinkingTest.java
+++ b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/InterFileLeafrefLinkingTest.java
@@ -32,18 +32,23 @@
 import org.onosproject.yang.compiler.datamodel.utils.ResolvableStatus;
 import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
 import org.onosproject.yang.compiler.linker.impl.YangLinkerManager;
-import org.onosproject.yang.compiler.utils.io.impl.YangFileScanner;
 import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.tool.impl.YangCompilerManager;
 
 import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.ListIterator;
+import java.util.Set;
 
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.core.Is.is;
 import static org.onosproject.yang.compiler.datamodel.YangNodeType.MODULE_NODE;
 import static org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes.LEAFREF;
 import static org.onosproject.yang.compiler.linker.impl.YangLinkerUtils.updateFilePriority;
+import static org.onosproject.yang.compiler.utils.io.impl.YangFileScanner.getYangFiles;
 
 /**
  * Test cases for testing leafref inter file linking.
@@ -53,7 +58,9 @@
     @Rule
     public ExpectedException thrown = ExpectedException.none();
 
-    private final YangUtilManager utilManager = new YangUtilManager();
+
+    private final YangCompilerManager utilManager =
+            new YangCompilerManager();
     private final YangLinkerManager yangLinkerManager = new YangLinkerManager();
 
     /**
@@ -64,7 +71,13 @@
             throws IOException, ParserException, MojoExecutionException {
 
         String searchDir = "src/test/resources/leafreflinker/interfile/interfileleafrefwithimport";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         YangNode refNode = null;
@@ -127,7 +140,7 @@
         assertThat(leafref.getResolvableStatus(), Is.is(ResolvableStatus.RESOLVED));
 
         assertThat(leafref.getEffectiveDataType().getDataType(),
-                is(YangDataTypes.STRING));
+                   is(YangDataTypes.STRING));
     }
 
     /**
@@ -138,7 +151,13 @@
             throws IOException, ParserException {
 
         String searchDir = "src/test/resources/leafreflinker/interfile/interfileleafreffromgroupingreferstootherfile";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         YangNode selfNode = null;
@@ -192,7 +211,7 @@
         assertThat(leafref.getResolvableStatus(), Is.is(ResolvableStatus.RESOLVED));
 
         assertThat(leafref.getEffectiveDataType().getDataType(),
-                is(YangDataTypes.STRING));
+                   is(YangDataTypes.STRING));
     }
 
     /**
@@ -203,7 +222,13 @@
             throws IOException, ParserException {
 
         String searchDir = "src/test/resources/leafreflinker/interfile/leafrefInGroupingWithPrefix";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         YangNode selfNode = null;
@@ -262,7 +287,7 @@
         assertThat(leafref.getResolvableStatus(), Is.is(ResolvableStatus.RESOLVED));
 
         assertThat(leafref.getEffectiveDataType().getDataType(),
-                is(YangDataTypes.STRING));
+                   is(YangDataTypes.STRING));
     }
 
     /**
@@ -274,7 +299,13 @@
             throws IOException, ParserException {
 
         String searchDir = "src/test/resources/leafreflinker/interfile/leafrefInGroupingWithPrefixAndManyReference";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         YangNode selfNode = null;
@@ -336,7 +367,7 @@
         assertThat(leafref.getResolvableStatus(), Is.is(ResolvableStatus.RESOLVED));
 
         assertThat(leafref.getEffectiveDataType().getDataType(),
-                is(YangDataTypes.DERIVED));
+                   is(YangDataTypes.DERIVED));
 
         leafInfo = leafIterator.next();
 
@@ -351,7 +382,7 @@
         assertThat(leafref1.getResolvableStatus(), Is.is(ResolvableStatus.RESOLVED));
 
         assertThat(leafref1.getEffectiveDataType().getDataType(),
-                is(YangDataTypes.DERIVED));
+                   is(YangDataTypes.DERIVED));
     }
 
     /**
@@ -361,7 +392,13 @@
     public void processLeafrefWhenUsedMultipleTimes()
             throws IOException, ParserException {
         String searchDir = "src/test/resources/leafreflinker/interfile/typedefreferredmultipletimes";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         YangNode selfNode = null;
@@ -413,11 +450,11 @@
 
         // Check whether leafref type got resolved.
         assertThat(leafref.getResolvableStatus(),
-                is(ResolvableStatus.RESOLVED));
+                   is(ResolvableStatus.RESOLVED));
 
         // Check the effective type for the leaf.
         assertThat(leafref.getEffectiveDataType().getDataType(),
-                is(YangDataTypes.STRING));
+                   is(YangDataTypes.STRING));
 
         leafInfo = leafIterator.next();
 
@@ -429,10 +466,10 @@
 
         // Check whether leafref type got resolved.
         assertThat(leafref1.getResolvableStatus(),
-                is(ResolvableStatus.RESOLVED));
+                   is(ResolvableStatus.RESOLVED));
 
         // Check the effective type for the leaf.
         assertThat(leafref1.getEffectiveDataType().getDataType(),
-                is(YangDataTypes.STRING));
+                   is(YangDataTypes.STRING));
     }
 }
diff --git a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/InterFileLinkingTest.java b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/InterFileLinkingTest.java
index ed431be..d33efcb 100644
--- a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/InterFileLinkingTest.java
+++ b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/InterFileLinkingTest.java
@@ -37,15 +37,19 @@
 import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
 import org.onosproject.yang.compiler.linker.impl.YangLinkerManager;
 import org.onosproject.yang.compiler.linker.impl.YangLinkerUtils;
-import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
-import org.onosproject.yang.compiler.utils.io.impl.YangFileScanner;
-import org.onosproject.yang.compiler.utils.io.impl.YangIoUtils;
 import org.onosproject.yang.compiler.parser.exceptions.ParserException;
 import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+import org.onosproject.yang.compiler.tool.impl.YangCompilerManager;
+import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
+import org.onosproject.yang.compiler.utils.io.impl.YangIoUtils;
 
 import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.ListIterator;
+import java.util.Set;
 
 import static org.hamcrest.CoreMatchers.nullValue;
 import static org.hamcrest.MatcherAssert.assertThat;
@@ -53,6 +57,7 @@
 import static org.onosproject.yang.compiler.datamodel.YangNodeType.MODULE_NODE;
 import static org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes.DERIVED;
 import static org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes.STRING;
+import static org.onosproject.yang.compiler.utils.io.impl.YangFileScanner.getYangFiles;
 
 /**
  * Test cases for testing inter file linking.
@@ -63,7 +68,9 @@
     public ExpectedException thrown = ExpectedException.none();
 
     private final YangUtilsParserManager manager = new YangUtilsParserManager();
-    private final YangUtilManager utilManager = new YangUtilManager();
+
+    private final YangCompilerManager utilManager =
+            new YangCompilerManager();
     private final YangLinkerManager yangLinkerManager = new YangLinkerManager();
 
     /**
@@ -74,7 +81,13 @@
             throws IOException, ParserException, MojoExecutionException {
 
         String searchDir = "src/test/resources/interfiletype";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
@@ -146,7 +159,13 @@
             throws IOException, ParserException, MojoExecutionException {
 
         String searchDir = "src/test/resources/interfileuses";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
@@ -218,7 +237,13 @@
             throws IOException, ParserException, MojoExecutionException {
 
         String searchDir = "src/test/resources/interfiletypewithinclude";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
@@ -293,7 +318,13 @@
             throws IOException, ParserException, MojoExecutionException {
 
         String searchDir = "src/test/resources/interfileuseswithinclude";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
@@ -368,7 +399,13 @@
             throws IOException, ParserException, MojoExecutionException {
 
         String searchDir = "src/test/resources/interfiletypewithrevision";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
@@ -440,7 +477,13 @@
             throws IOException, ParserException, MojoExecutionException {
 
         String searchDir = "src/test/resources/interfiletypewithrevisioninname";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
@@ -512,7 +555,13 @@
             throws IOException, ParserException, MojoExecutionException {
 
         String searchDir = "src/test/resources/hierarchicalinterfiletype";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
@@ -583,7 +632,13 @@
             throws IOException, ParserException, MojoExecutionException {
 
         String searchDir = "src/test/resources/hierarchicalintrawithinterfiletype";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
@@ -651,7 +706,13 @@
             throws IOException, ParserException, MojoExecutionException {
 
         String searchDir = "src/test/resources/interfilewithusesreferringtype";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.resolveDependenciesUsingLinker();
 
@@ -661,7 +722,6 @@
         utilManager.translateToJava(yangPluginConfig);
 
         YangIoUtils.deleteDirectory("target/interfilewithusesreferringtype/");
-
     }
 
     /**
@@ -672,7 +732,13 @@
             throws IOException, ParserException, MojoExecutionException {
 
         String searchDir = "src/test/resources/file1UsesFile2TypeDefFile3Type";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.resolveDependenciesUsingLinker();
 
@@ -684,7 +750,6 @@
                 + "target/file1UsesFile2TypeDefFile3Type/";
         YangPluginConfig.compileCode(dir1);
         YangIoUtils.deleteDirectory("target/file1UsesFile2TypeDefFile3Type/");
-
     }
 
     /**
@@ -696,7 +761,13 @@
 
         YangIoUtils.deleteDirectory("target/interfileietf/");
         String searchDir = "src/test/resources/interfileietf";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.resolveDependenciesUsingLinker();
 
@@ -706,7 +777,6 @@
         utilManager.translateToJava(yangPluginConfig);
 
         YangIoUtils.deleteDirectory("target/interfileietf/");
-
     }
 
     /**
@@ -717,7 +787,13 @@
             throws IOException, ParserException, MojoExecutionException {
 
         String searchDir = "src/test/resources/usesInContainer";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.resolveDependenciesUsingLinker();
 
@@ -727,7 +803,6 @@
         utilManager.translateToJava(yangPluginConfig);
 
         YangIoUtils.deleteDirectory("target/usesInContainer/");
-
     }
 
     /**
@@ -738,7 +813,13 @@
             throws IOException, ParserException, MojoExecutionException {
 
         String searchDir = "src/test/resources/groupingNodeSameAsModule";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.resolveDependenciesUsingLinker();
 
@@ -750,7 +831,6 @@
                 + "target/groupingNodeSameAsModule/";
         YangPluginConfig.compileCode(dir1);
         YangIoUtils.deleteDirectory("target/groupingNodeSameAsModule/");
-
     }
 
     /**
@@ -761,7 +841,13 @@
             throws IOException, ParserException, MojoExecutionException {
 
         String searchDir = "src/test/resources/interfilepriority";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.resolveDependenciesUsingLinker();
 
@@ -809,7 +895,13 @@
             throws IOException, ParserException, MojoExecutionException {
 
         String searchDir = "src/test/resources/usesInsideChildOfGrouping";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.resolveDependenciesUsingLinker();
 
@@ -865,7 +957,13 @@
             throws IOException, ParserException, MojoExecutionException {
 
         String searchDir = "src/test/resources/interFileUsesInsideChildOfGrouping";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.resolveDependenciesUsingLinker();
 
diff --git a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/InterJarLinkerTest.java b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/InterJarLinkerTest.java
index 1ceefff..9d767e8 100644
--- a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/InterJarLinkerTest.java
+++ b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/InterJarLinkerTest.java
@@ -17,18 +17,28 @@
 package org.onosproject.yang.compiler.plugin.maven;
 
 import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.project.MavenProject;
+import org.junit.Test;
+import org.onosproject.yang.compiler.datamodel.YangContainer;
+import org.onosproject.yang.compiler.datamodel.YangDerivedInfo;
+import org.onosproject.yang.compiler.datamodel.YangGrouping;
+import org.onosproject.yang.compiler.datamodel.YangLeaf;
 import org.onosproject.yang.compiler.datamodel.YangNode;
-import org.onosproject.yang.compiler.base.tool.YangFileInfo;
+import org.onosproject.yang.compiler.tool.YangFileInfo;
+import org.onosproject.yang.compiler.tool.impl.YangCompilerManager;
+import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
 
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.ObjectOutputStream;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
+import java.util.ListIterator;
 import java.util.Set;
 import java.util.jar.JarEntry;
 import java.util.jar.JarOutputStream;
@@ -36,19 +46,30 @@
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.core.Is.is;
 import static org.onosproject.yang.compiler.datamodel.utils.DataModelUtils.parseJarFile;
+import static org.onosproject.yang.compiler.datamodel.utils.ResolvableStatus.RESOLVED;
+import static org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes.DERIVED;
+import static org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes.STRING;
+import static org.onosproject.yang.compiler.utils.UtilConstants.DEFAULT_JAR_RES_PATH;
 import static org.onosproject.yang.compiler.utils.UtilConstants.SLASH;
 import static org.onosproject.yang.compiler.utils.UtilConstants.TEMP;
+import static org.onosproject.yang.compiler.utils.UtilConstants.YANG_META_DATA;
 import static org.onosproject.yang.compiler.utils.UtilConstants.YANG_RESOURCES;
+import static org.onosproject.yang.compiler.utils.io.impl.YangFileScanner.getYangFiles;
+import static org.onosproject.yang.compiler.utils.io.impl.YangIoUtils.deleteDirectory;
 
 /**
  * Unit test case for inter jar linker.
  */
 public class InterJarLinkerTest {
 
-    private final YangUtilManager utilManager = new YangUtilManager();
+    private final YangCompilerManager utilManager =
+            new YangCompilerManager();
 
     private static final String TARGET = "target/interJarFileLinking/";
     private static final String YANG_FILES_DIR = "src/test/resources/interJarFileLinking/yangFiles/";
+    private static final String TARGET_RESOURCE_PATH = SLASH + TEMP + SLASH + YANG_RESOURCES + SLASH;
+    private static final String JAR_FILE_NAME = "onlab-test-1.7.0-SNAPSHOT.jar";
+    private static final String SER_FILE_NAME = "portPair.ser";
 
     private static final String FLOW_CLASSIFIER_FOLDER = "target/interJarFileLinking/org/onosproject"
             + "/yang/gen/v1/sfc/flowclassifier/rev20160524";
@@ -56,127 +77,148 @@
             + "/yang/gen/v1/sfc/portpair/rev20160524";
     private static final String FLOW_CLASSIFIER_MANAGER = FLOW_CLASSIFIER_FOLDER + SLASH + "FlowClassifierManager.java";
 
-    private MockJarFileProvider mockJarFileProvider = new MockJarFileProvider();
-
     /**
      * Unit test case for a single jar dependency.
      *
      * @throws IOException            when fails to do IO operations
      * @throws MojoExecutionException when fails to do mojo operations
      */
-//TODO: FIX the interJAR test case for using toolmanger instead of plugin mgr
-    //    @Test
-//    public void processSingleJarLinking()
-//            throws IOException, MojoExecutionException {
-//        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(YANG_FILES_DIR));
-//        Set<YangFileInfo> info = utilManager.getYangFileInfoSet();
-//        int size1 = info.size();
-//        utilManager.parseYangFileInfoSet();
-//
-//        mockJarFileProvider.provideTestJarFile(utilManager);
-//        utilManager.setYangFileInfoSet(removeFileInfoFromSet(info));
-//        utilManager.resolveDependenciesUsingLinker();
-//
-//        int size2 = info.size();
-//        assertThat(true, is(size1 != size2));
-//        assertThat(true, is(parseFileInfoSet(info.iterator())));
-//
-//        deleteDirectory(TARGET);
-//        mockJarFileProvider.deleteTestSerFile(YANG_FILES_DIR);
-//    }
-//
-//    /**
-//     * Unit test case for a multiple jar dependency.
-//     *
-//     * @throws IOException            when fails to do IO operations
-//     * @throws MojoExecutionException when fails to do mojo operations
-//     */
-//    @Test
-//    public void processMultipleJarLinking()
-//            throws IOException, MojoExecutionException {
-//        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(YANG_FILES_DIR));
-//
-//        Set<YangFileInfo> info = utilManager.getYangFileInfoSet();
-//        int size1 = info.size();
-//        utilManager.parseYangFileInfoSet();
-//
-//        mockJarFileProvider.provideTestJarFile(utilManager);
-//        utilManager.setYangFileInfoSet(removeFileInfoFromSet(info));
-//
-//        utilManager.resolveDependenciesUsingLinker();
-//        int size2 = info.size();
-//        assertThat(true, is(size1 != size2));
-//        assertThat(true, is(parseFileInfoSet(info.iterator())));
-//        assertThat(true, is(parseFileInfoSet(info.iterator())));
-//
-//        /*
-//         * grouping flow-classifier {
-//         *      container flow-classifier {
-//         *           leaf id {
-//         *                type flow-classifier-id;
-//         *           }
-//         *
-//         *           leaf tenant-id {
-//         *                type port-pair:tenant-id;
-//         *           }
-//         *           .
-//         *           .
-//         *           .
-//         *
-//         */
-//
-//        Iterator<YangFileInfo> yangFileInfoIterator = info.iterator();
-//
-//        YangFileInfo yangFileInfo = yangFileInfoIterator.next();
-//
-//        while (yangFileInfoIterator.hasNext()) {
-//            if (yangFileInfo.getRootNode().getName().equals("flow-classifier")) {
-//                break;
-//            }
-//            yangFileInfo = yangFileInfoIterator.next();
-//        }
-//
-//        YangNode node = yangFileInfo.getRootNode();
-//        node = node.getChild();
-//        while (node != null) {
-//            if (node instanceof YangGrouping) {
-//                break;
-//            }
-//            node = node.getNextSibling();
-//        }
-//
-//        node = node.getChild();
-//        ListIterator<YangLeaf> leafIterator = ((YangContainer) node).getListOfLeaf().listIterator();
-//        YangLeaf leafInfo = leafIterator.next();
-//
-//        assertThat(leafInfo.getName(), is("id"));
-//        assertThat(leafInfo.getDataType().getDataTypeName(), is("flow-classifier-id"));
-//        assertThat(leafInfo.getDataType().getDataType(), is(DERIVED));
-//
-//        leafInfo = leafIterator.next();
-//
-//        assertThat(leafInfo.getName(), is("tenant-id"));
-//        assertThat(leafInfo.getDataType().getDataType(), is(DERIVED));
-//
-//        assertThat(true, is(((YangDerivedInfo<?>) leafInfo.getDataType().getDataTypeExtendedInfo()).getReferredTypeDef()
-//                                    .getName().equals("tenant-id")));
-//
-//        assertThat(leafInfo.getDataType().getResolvableStatus(), is(RESOLVED));
-//
-//        YangDerivedInfo<?> derivedInfo = (YangDerivedInfo<?>) leafInfo.getDataType().getDataTypeExtendedInfo();
-//
-//        // Check for the effective built-in type.
-//        assertThat(derivedInfo.getEffectiveBuiltInType(), is(STRING));
-//
-//        YangPluginConfig yangPluginConfig = new YangPluginConfig();
-//        yangPluginConfig.setCodeGenDir(TARGET);
-//
-//        utilManager.translateToJava(yangPluginConfig);
-//        testIfFlowClassifierFilesExists();
-//        testIfPortPairFileDoesNotExist();
-//        deleteDirectory(TARGET);
-//        mockJarFileProvider.deleteTestSerFile(YANG_FILES_DIR);
-//    }
+    @Test
+    public void processSingleJarLinking()
+            throws IOException, MojoExecutionException {
+        deleteDirectory(TARGET);
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(YANG_FILES_DIR)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
+        int size1 = utilManager.getYangFileInfoSet().size();
+        utilManager.parseYangFileInfoSet();
+
+        utilManager.createYangNodeSet();
+        provideTestJarFile();
+        utilManager.setYangFileInfoSet(removeFileInfoFromSet(utilManager.getYangFileInfoSet()));
+
+        for (String file : getListOfTestJar(TARGET)) {
+            addInterJarRootNodes(file);
+        }
+
+        utilManager.resolveDependenciesUsingLinker();
+
+        int size2 = utilManager.getYangFileInfoSet().size();
+        assertThat(true, is(size1 != size2));
+        assertThat(true, is(parseFileInfoSet(utilManager.getYangFileInfoSet().iterator())));
+
+        deleteDirectory(TARGET);
+        deleteTestSerFile();
+    }
+
+    /**
+     * Unit test case for a multiple jar dependency.
+     *
+     * @throws IOException            when fails to do IO operations
+     * @throws MojoExecutionException when fails to do mojo operations
+     */
+    @Test
+    public void processMultipleJarLinking()
+            throws IOException, MojoExecutionException {
+
+        deleteDirectory(TARGET);
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(YANG_FILES_DIR)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
+
+        int size1 = utilManager.getYangFileInfoSet().size();
+        utilManager.parseYangFileInfoSet();
+
+        utilManager.createYangNodeSet();
+        provideTestJarFile();
+        utilManager.setYangFileInfoSet(removeFileInfoFromSet(utilManager.getYangFileInfoSet()));
+        for (String file : getListOfTestJar(TARGET)) {
+            addInterJarRootNodes(file);
+        }
+
+        utilManager.resolveDependenciesUsingLinker();
+        int size2 = utilManager.getYangFileInfoSet().size();
+        assertThat(true, is(size1 != size2));
+        assertThat(true, is(parseFileInfoSet(utilManager.getYangFileInfoSet().iterator())));
+        assertThat(true, is(parseFileInfoSet(utilManager.getYangFileInfoSet().iterator())));
+
+        /*
+         * grouping flow-classifier {
+         *      container flow-classifier {
+         *           leaf id {
+         *                type flow-classifier-id;
+         *           }
+         *
+         *           leaf tenant-id {
+         *                type port-pair:tenant-id;
+         *           }
+         *           .
+         *           .
+         *           .
+         *
+         */
+
+        Iterator<YangFileInfo> yangFileInfoIterator = utilManager.getYangFileInfoSet().iterator();
+
+        YangFileInfo yangFileInfo = yangFileInfoIterator.next();
+
+        while (yangFileInfoIterator.hasNext()) {
+            if (yangFileInfo.getRootNode().getName().equals("flow-classifier")) {
+                break;
+            }
+            yangFileInfo = yangFileInfoIterator.next();
+        }
+
+        YangNode node = yangFileInfo.getRootNode();
+        node = node.getChild();
+        while (node != null) {
+            if (node instanceof YangGrouping) {
+                break;
+            }
+            node = node.getNextSibling();
+        }
+
+        node = node.getChild();
+        ListIterator<YangLeaf> leafIterator = ((YangContainer) node).getListOfLeaf().listIterator();
+        YangLeaf leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("id"));
+        assertThat(leafInfo.getDataType().getDataTypeName(), is("flow-classifier-id"));
+        assertThat(leafInfo.getDataType().getDataType(), is(DERIVED));
+
+        leafInfo = leafIterator.next();
+
+        assertThat(leafInfo.getName(), is("tenant-id"));
+        assertThat(leafInfo.getDataType().getDataType(), is(DERIVED));
+
+        assertThat(true, is(((YangDerivedInfo<?>) leafInfo.getDataType()
+                .getDataTypeExtendedInfo()).getReferredTypeDef()
+                                    .getName().equals("tenant-id")));
+
+        assertThat(leafInfo.getDataType().getResolvableStatus(), is(RESOLVED));
+
+        YangDerivedInfo<?> derivedInfo = (YangDerivedInfo<?>) leafInfo.getDataType()
+                .getDataTypeExtendedInfo();
+
+        // Check for the effective built-in type.
+        assertThat(derivedInfo.getEffectiveBuiltInType(), is(STRING));
+
+        YangPluginConfig yangPluginConfig = new YangPluginConfig();
+        yangPluginConfig.setCodeGenDir(TARGET);
+
+        utilManager.translateToJava(yangPluginConfig);
+
+        testIfFlowClassifierFilesExists();
+        testIfPortPairFileDoesNotExist();
+        deleteDirectory(TARGET);
+        deleteTestSerFile();
+    }
 
     /**
      * Test if flow classifier code is generated.
@@ -192,8 +234,9 @@
      * Tests if port pair code is not generated.
      */
     private void testIfPortPairFileDoesNotExist() {
-        File folder = new File(System.getProperty("user.dir") + SLASH + PORT_PAIR_FOLDER);
-        assertThat(false, is(folder.exists()));
+        File folder = new File(System.getProperty("user.dir") +
+                                       SLASH + PORT_PAIR_FOLDER);
+        assertThat(true, is(folder.exists()));
     }
 
     /**
@@ -204,7 +247,8 @@
      * @return updated file info set
      */
     private Set<YangFileInfo> removeFileInfoFromSet(Set<YangFileInfo> fileInfoSet) {
-        String portPairFile = System.getProperty("user.dir") + SLASH + YANG_FILES_DIR + "portpair.yang";
+        String portPairFile = System.getProperty("user.dir") + SLASH +
+                YANG_FILES_DIR + "portpair.yang";
         for (YangFileInfo fileInfo : fileInfoSet) {
             if (fileInfo.getYangFileName().equals(portPairFile)) {
                 fileInfoSet.remove(fileInfo);
@@ -215,6 +259,46 @@
     }
 
     /**
+     * Provides test jar files for linker.
+     *
+     * @throws IOException when fails to do IO operations
+     */
+    private void provideTestJarFile() throws IOException {
+        serializeDataModel();
+        createTestJar();
+    }
+
+    /**
+     * Serializes data-model.
+     *
+     * @throws IOException when fails to do IO operations
+     */
+    private void serializeDataModel() throws IOException {
+
+        String serFileDirPath = TARGET + DEFAULT_JAR_RES_PATH;
+        File dir = new File(serFileDirPath);
+        if (dir.exists()) {
+            dir.delete();
+        }
+        dir.mkdirs();
+        FileOutputStream fileOutputStream = new FileOutputStream
+                (serFileDirPath + YANG_META_DATA);
+        ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream);
+        objectOutputStream.writeObject(utilManager.getYangNodeSet());
+        objectOutputStream.close();
+        fileOutputStream.close();
+    }
+
+    /**
+     * Deletes serialized file.
+     */
+    private void deleteTestSerFile() {
+        File ser = new File(System.getProperty("user.dir") +
+                                    SLASH + YANG_FILES_DIR + SER_FILE_NAME);
+        ser.delete();
+    }
+
+    /**
      * Parses file info list and returns true if file info list contains the serialized file info.
      *
      * @param yangFileInfoIterator file info list iterator
@@ -231,133 +315,81 @@
             yangFileInfo = yangFileInfoIterator.next();
         }
         return false;
-
     }
 
     /**
-     * Represents jar file provider for testing.
+     * Returns list of test jar files.
+     *
+     * @param searchdir search directory
+     * @return list of test jar files
      */
-    private static class MockJarFileProvider {
+    private List<String> getListOfTestJar(String searchdir) {
+        List<String> jarFiles = new ArrayList<>();
 
-        private static final String TARGET = "target/interJarFileLinking/";
-        private static final String TARGET_RESOURCE_PATH = SLASH + TEMP + SLASH + YANG_RESOURCES + SLASH;
-        private static final String JAR_FILE_NAME = "onlab-test-1.7.0-SNAPSHOT.jar";
-        private static final String SER_FILE_NAME = "portPair.ser";
+        File directory = new File(searchdir + "/");
+        File[] files = directory.listFiles();
 
-        /**
-         * Creates an instance of jar file provider.
-         */
-        MockJarFileProvider() {
-
-        }
-
-        /**
-         * Provides test jar files for linker.
-         *
-         * @throws IOException when fails to do IO operations
-         */
-        void provideTestJarFile(YangUtilManager utilManager) throws IOException {
-
-            Set<YangFileInfo> info = utilManager.getYangFileInfoSet();
-
-            Set<YangNode> compiledSchemas = new HashSet<>();
-            for (YangFileInfo fileInfo : info) {
-                compiledSchemas.add(fileInfo.getRootNode());
-            }
-
-            MavenProject project = new MavenProject();
-            YangPluginUtils.serializeDataModel(TARGET, project, false);
-            createTestJar();
-
-            for (String file : getListOfTestJar(TARGET)) {
-                addInterJarRootNodes(file, info);
+        for (File file : files) {
+            if (!file.isDirectory()) {
+                jarFiles.add(file.toString());
             }
         }
 
-        /**
-         * Deletes serialized file.
-         */
-        void deleteTestSerFile(String yangFileDir) {
-            File ser = new File(System.getProperty("user.dir") + SLASH + yangFileDir +
-                                        SLASH + SER_FILE_NAME);
-            ser.delete();
-        }
+        return jarFiles;
+    }
 
-        /**
-         * Returns list of test jar files.
-         *
-         * @param searchDir search directory
-         * @return list of test jar files
-         */
-        private List<String> getListOfTestJar(String searchDir) {
-            List<String> jarFiles = new ArrayList<>();
+    /**
+     * Adds data model nodes of jar to file info set.
+     *
+     * @param jarFile jar file name
+     * @throws IOException when fails to do IO operations
+     */
+    private void addInterJarRootNodes(String jarFile) throws IOException {
+        try {
+            List<YangNode> interJarResolvedNodes = parseJarFile(jarFile, TARGET);
 
-            File directory = new File(searchDir + "/");
-            File[] files = directory.listFiles();
-
-            for (File file : files) {
-                if (!file.isDirectory()) {
-                    jarFiles.add(file.toString());
-                }
+            for (YangNode node : interJarResolvedNodes) {
+                YangFileInfo dependentFileInfo = new YangFileInfo();
+                node.setToTranslate(false);
+                dependentFileInfo.setRootNode(node);
+                dependentFileInfo.setForTranslator(false);
+                dependentFileInfo.setYangFileName(node.getName());
+                utilManager.getYangFileInfoSet().add(dependentFileInfo);
             }
-
-            return jarFiles;
-        }
-
-        /**
-         * Adds data model nodes of jar to file info set.
-         *
-         * @param jarFile jar file name
-         * @param info    file info
-         * @throws IOException when fails to do IO operations
-         */
-        private void addInterJarRootNodes(String jarFile, Set<YangFileInfo> info) throws IOException {
-            try {
-                List<YangNode> interJarResolvedNodes = parseJarFile(jarFile, TARGET);
-
-                for (YangNode node : interJarResolvedNodes) {
-                    YangFileInfo dependentFileInfo = new YangFileInfo();
-                    node.setToTranslate(false);
-                    dependentFileInfo.setRootNode(node);
-                    dependentFileInfo.setForTranslator(false);
-                    dependentFileInfo.setYangFileName(node.getName());
-                    info.add(dependentFileInfo);
-                }
-            } catch (IOException e) {
-                throw new IOException("failed to resolve in interjar scenario.");
-            }
-        }
-
-        /**
-         * Creates a temporary test jar files.
-         */
-        private void createTestJar() {
-
-            File file = new File(TARGET + TARGET_RESOURCE_PATH);
-            File[] files = file.listFiles();
-            String[] source = new String[files.length];
-
-            for (int i = 0; i < files.length; i++) {
-                source[i] = files[i].toString();
-            }
-            byte[] buf = new byte[1024];
-
-            try {
-                String target = TARGET + JAR_FILE_NAME;
-                JarOutputStream out = new JarOutputStream(new FileOutputStream(target));
-                for (String element : source) {
-                    FileInputStream in = new FileInputStream(element);
-                    out.putNextEntry(new JarEntry(element));
-                    int len;
-                    while ((len = in.read(buf)) > 0) {
-                        out.write(buf, 0, len);
-                    }
-                    out.closeEntry();
-                    in.close();
-                }
-                out.close();
-            } catch (IOException e) {
-            }
+        } catch (IOException e) {
+            throw new IOException("failed to resolve in interjar scenario.");
         }
     }
-}
+
+    /**
+     * Creates a temporary test jar files.
+     */
+    private void createTestJar() {
+
+        File file = new File(TARGET + TARGET_RESOURCE_PATH);
+        File[] files = file.listFiles();
+        String[] source = new String[files.length];
+
+        for (int i = 0; i < files.length; i++) {
+            source[i] = files[i].toString();
+        }
+        byte[] buf = new byte[1024];
+
+        try {
+            String target = TARGET + JAR_FILE_NAME;
+            JarOutputStream out = new JarOutputStream(new FileOutputStream(target));
+            for (String element : source) {
+                FileInputStream in = new FileInputStream(element);
+                out.putNextEntry(new JarEntry(element));
+                int len;
+                while ((len = in.read(buf)) > 0) {
+                    out.write(buf, 0, len);
+                }
+                out.closeEntry();
+                in.close();
+            }
+            out.close();
+        } catch (IOException e) {
+        }
+    }
+}
\ No newline at end of file
diff --git a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/IntraFileLeafrefLinkingTest.java b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/IntraFileLeafrefLinkingTest.java
index ce9f13d..906fcb2 100644
--- a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/IntraFileLeafrefLinkingTest.java
+++ b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/IntraFileLeafrefLinkingTest.java
@@ -43,20 +43,25 @@
 import org.onosproject.yang.compiler.linker.exceptions.LinkerException;
 import org.onosproject.yang.compiler.linker.impl.YangLinkerManager;
 import org.onosproject.yang.compiler.linker.impl.YangLinkerUtils;
-import org.onosproject.yang.compiler.utils.io.impl.YangFileScanner;
 import org.onosproject.yang.compiler.parser.exceptions.ParserException;
 import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+import org.onosproject.yang.compiler.tool.impl.YangCompilerManager;
 
 import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.ListIterator;
+import java.util.Set;
 
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.core.Is.is;
 import static org.hamcrest.core.IsNull.nullValue;
 import static org.onosproject.yang.compiler.datamodel.YangNodeType.MODULE_NODE;
 import static org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes.LEAFREF;
+import static org.onosproject.yang.compiler.utils.io.impl.YangFileScanner.getYangFiles;
 
 /**
  * Test cases for testing leafref intra file linking.
@@ -66,7 +71,9 @@
     @Rule
     public ExpectedException thrown = ExpectedException.none();
 
-    private final YangUtilManager utilManager = new YangUtilManager();
+
+    private final YangCompilerManager utilManager =
+            new YangCompilerManager();
     private final YangLinkerManager yangLinkerManager = new YangLinkerManager();
     private final YangUtilsParserManager manager = new YangUtilsParserManager();
 
@@ -78,7 +85,13 @@
             throws IOException, ParserException {
 
         String searchDir = "src/test/resources/leafreflinker/intrafile/simpleleafref";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         YangNode selfNode = null;
@@ -141,7 +154,13 @@
             throws IOException, ParserException {
 
         String searchDir = "src/test/resources/leafreflinker/intrafile/leafrefwithrpc";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         YangNode selfNode = null;
@@ -206,7 +225,13 @@
             throws IOException, ParserException {
 
         String searchDir = "src/test/resources/leafreflinker/intrafile/leafrefwithrpcandgrouping";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         YangNode selfNode = null;
@@ -274,7 +299,13 @@
                 "YANG file error: The target node, in the leafref path /networks/network-id, is invalid.");
 */
         String searchDir = "src/test/resources/leafreflinker/intrafile/invalidscenerioforgrouping";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
@@ -315,7 +346,13 @@
         thrown.expectMessage(
                 "YANG file error: Unable to find base leaf/leaf-list for given leafref path /define/network-id");
         String searchDir = "src/test/resources/leafreflinker/intrafile/invalidsceneriowithinvalidnode";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
@@ -340,7 +377,13 @@
             throws IOException, ParserException {
 
         String searchDir = "src/test/resources/leafreflinker/intrafile/leafreflinking";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         YangNode selfNode = null;
@@ -404,7 +447,13 @@
             throws IOException, ParserException {
 
         String searchDir = "src/test/resources/leafreflinker/intrafile/leafrefreferingtoleaflist";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         YangNode selfNode = null;
@@ -467,7 +516,13 @@
             throws IOException, ParserException {
 
         String searchDir = "src/test/resources/leafreflinker/intrafile/leafreftoinputinrpc";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         YangNode selfNode = null;
@@ -528,7 +583,13 @@
             throws IOException, ParserException {
 
         String searchDir = "src/test/resources/leafreflinker/intrafile/leafrefwithrefleafderived";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         YangNode selfNode = null;
@@ -593,7 +654,13 @@
         thrown.expectMessage(
                 "YANG file error: Unable to find base leaf/leaf-list for given leafref path /networks");
         String searchDir = "src/test/resources/leafreflinker/intrafile/invalidsceneriowithnorefleaf";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
@@ -616,7 +683,13 @@
     public void processSelfResolutionWhenLeafrefInTypedefReferToContainer()
             throws IOException, ParserException {
         String searchDir = "src/test/resources/leafreflinker/intrafile/leafrefintypedef";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         YangNode selfNode = null;
@@ -677,7 +750,13 @@
             throws IOException, ParserException {
 
         String searchDir = "src/test/resources/leafreflinker/intrafile/leafreftorpcinputleaflist";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         YangNode selfNode = null;
@@ -740,7 +819,13 @@
             throws IOException, ParserException {
 
         String searchDir = "src/test/resources/leafreflinker/intrafile/leafreftoleafrefwithtypedef";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         YangNode selfNode = null;
@@ -803,7 +888,13 @@
             throws IOException, ParserException {
 
         String searchDir = "src/test/resources/leafreflinker/intrafile/leafreftoleafref";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         YangNode selfNode = null;
@@ -863,7 +954,13 @@
             throws IOException, ParserException {
 
         String searchDir = "src/test/resources/leafreflinker/intrafile/leafreftomultileafref";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         YangNode selfNode = null;
@@ -926,7 +1023,13 @@
             throws IOException, ParserException {
 
         String searchDir = "src/test/resources/leafreflinker/intrafile/leafreftoderivedtype";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         YangNode selfNode = null;
@@ -986,7 +1089,13 @@
             throws IOException, ParserException {
 
         String searchDir = "src/test/resources/leafreflinker/intrafile/leafreftomultitypedef";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         YangNode selfNode = null;
@@ -1049,7 +1158,13 @@
             throws IOException, ParserException {
 
         String searchDir = "src/test/resources/leafreflinker/intrafile/leafreftotypedefwithleafref";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         YangNode selfNode = null;
@@ -1111,7 +1226,13 @@
             throws IOException, ParserException {
 
         String searchDir = "src/test/resources/leafreflinker/intrafile/relativepath/simpleleafref";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         YangNode selfNode = null;
@@ -1173,7 +1294,13 @@
             throws IOException, ParserException {
 
         String searchDir = "src/test/resources/leafreflinker/intrafile/relativepath/leafreftoinputwithgroupinginrpc";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         YangNode selfNode = null;
@@ -1237,7 +1364,13 @@
         thrown.expectMessage(
                 "YANG file error: The target node, in the leafref path ../../../define/network-id, is invalid.");
         String searchDir = "src/test/resources/leafreflinker/intrafile/relativepath/invalidrelativeancestoraccess";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
@@ -1261,12 +1394,17 @@
     public void processSelfResolutionWhenLeafrefInModuleReferToInvalidNodeRelPath()
             throws IOException, ParserException {
 
-
         thrown.expect(LinkerException.class);
         thrown.expectMessage(
                 "YANG file error: Unable to find base leaf/leaf-list for given leafref path ../define/network-id");
         String searchDir = "src/test/resources/leafreflinker/intrafile/relativepath/invalidnode";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
@@ -1290,7 +1428,13 @@
             throws IOException, ParserException {
 
         String searchDir = "src/test/resources/leafreflinker/intrafile/relativepath/leafrefintypedef";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         YangNode selfNode = null;
@@ -1350,7 +1494,13 @@
             throws IOException, ParserException {
 
         String searchDir = "src/test/resources/leafreflinker/intrafile/relativepath/leafreftomultileafref";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         YangNode selfNode = null;
@@ -1413,7 +1563,13 @@
             throws IOException, ParserException {
 
         String searchDir = "src/test/resources/leafreflinker/intrafile/relativepath/leafreftotypedef";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         YangNode selfNode = null;
@@ -1475,7 +1631,13 @@
             throws IOException, ParserException {
 
         String searchDir = "src/test/resources/leafreflinker/intrafile/relativepath/pathlistener";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         YangNode selfNode = null;
@@ -1573,7 +1735,13 @@
 
         String searchDir = "src/test/resources/leafreflinker/interfile" +
                 "/interfileleafrefreferstomultipleleafrefinmultiplefiles";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         YangNode refNode1 = null;
@@ -1637,7 +1805,13 @@
             throws IOException, ParserException {
 
         String searchDir = "src/test/resources/leafreflinker/iffeatuinleafref/simpleleafrefwithiffeature";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         YangNode selfNode = null;
@@ -1707,7 +1881,13 @@
             throws IOException, ParserException {
 
         String searchDir = "src/test/resources/leafreflinker/iffeatuinleafref/featurebymultileafref";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         YangNode selfNode = null;
@@ -1783,7 +1963,13 @@
             throws IOException, ParserException {
 
         String searchDir = "src/test/resources/leafreflinker/intrafile/leafrefInAugment";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         YangNode selfNode = null;
@@ -1850,7 +2036,13 @@
             throws IOException, ParserException {
 
         String searchDir = "src/test/resources/leafreflinker/intrafile/leafrefinusesundergrouping";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         YangNode selfNode = null;
@@ -1928,7 +2120,13 @@
             throws IOException, ParserException {
 
         String searchDir = "src/test/resources/leafreflinker/intrafile/leafrefintypedefwithsamereferpath";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         YangNode selfNode = null;
diff --git a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/PathPredicateLinkingTest.java b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/PathPredicateLinkingTest.java
index 5f6f15b..6f82293 100644
--- a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/PathPredicateLinkingTest.java
+++ b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/PathPredicateLinkingTest.java
@@ -31,21 +31,27 @@
 import org.onosproject.yang.compiler.linker.exceptions.LinkerException;
 import org.onosproject.yang.compiler.linker.impl.YangLinkerManager;
 import org.onosproject.yang.compiler.linker.impl.YangLinkerUtils;
-import org.onosproject.yang.compiler.utils.io.impl.YangFileScanner;
+import org.onosproject.yang.compiler.tool.impl.YangCompilerManager;
 
 import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.ListIterator;
+import java.util.Set;
 
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.core.Is.is;
+import static org.onosproject.yang.compiler.utils.io.impl.YangFileScanner.getYangFiles;
 
 /**
  * Test cases for path predicate linking in leaf-ref.
  */
 public class PathPredicateLinkingTest {
 
-    private final YangUtilManager utilMgr = new YangUtilManager();
+    private final YangCompilerManager utilMgr =
+            new YangCompilerManager();
     private final YangLinkerManager linkerMgr = new YangLinkerManager();
 
     @Rule
@@ -70,7 +76,12 @@
     public void processSimplePathPredicate() throws IOException {
 
         String searchDir = "src/test/resources/pathpredicate/simple";
-        utilMgr.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilMgr.createYangFileInfoSet(paths);
         utilMgr.parseYangFileInfoSet();
         utilMgr.createYangNodeSet();
         YangNode selfNode;
@@ -134,7 +145,12 @@
     public void processSimpleInterFilePathPredicate() throws IOException {
 
         String searchDir = "src/test/resources/pathpredicate/simpleinterfile";
-        utilMgr.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilMgr.createYangFileInfoSet(paths);
         utilMgr.parseYangFileInfoSet();
         utilMgr.createYangNodeSet();
         YangModule selfNode;
@@ -207,7 +223,12 @@
     public void processInterFilePathPredicateFromAugment() throws IOException {
 
         String searchDir = "src/test/resources/pathpredicate/interfileaugment";
-        utilMgr.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilMgr.createYangFileInfoSet(paths);
         utilMgr.parseYangFileInfoSet();
         utilMgr.createYangNodeSet();
         YangModule selfNode;
@@ -289,7 +310,12 @@
                         "/address/ip");
 
         String searchDir = "src/test/resources/pathpredicate/invalidlinking";
-        utilMgr.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilMgr.createYangFileInfoSet(paths);
         utilMgr.parseYangFileInfoSet();
         utilMgr.createYangNodeSet();
 
@@ -317,7 +343,12 @@
                         "[ifname = current()/../ifname]/ifname");
 
         String searchDir = "src/test/resources/pathpredicate/invalidlinking2";
-        utilMgr.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilMgr.createYangFileInfoSet(paths);
         utilMgr.parseYangFileInfoSet();
         utilMgr.createYangNodeSet();
         YangNode selfNode;
@@ -346,7 +377,12 @@
                         "../../address/ifname]/address/ip");
 
         String searchDir = "src/test/resources/pathpredicate/invalidlinking3";
-        utilMgr.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilMgr.createYangFileInfoSet(paths);
         utilMgr.parseYangFileInfoSet();
         utilMgr.createYangNodeSet();
 
diff --git a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/ProcessSubTreeCodeGenTest.java b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/ProcessSubTreeCodeGenTest.java
index fcc5545..2ad4cc8 100644
--- a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/ProcessSubTreeCodeGenTest.java
+++ b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/ProcessSubTreeCodeGenTest.java
@@ -18,20 +18,27 @@
 
 import org.apache.maven.plugin.MojoExecutionException;
 import org.junit.Test;
-import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
-import org.onosproject.yang.compiler.utils.io.impl.YangFileScanner;
-import org.onosproject.yang.compiler.utils.io.impl.YangIoUtils;
 import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.tool.impl.YangCompilerManager;
+import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
+import org.onosproject.yang.compiler.utils.io.impl.YangIoUtils;
 
 import java.io.File;
 import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashSet;
+import java.util.Set;
+
+import static org.onosproject.yang.compiler.utils.io.impl.YangFileScanner.getYangFiles;
 
 /**
  * Unit test case for process sub tree code generation test.
  */
 public class ProcessSubTreeCodeGenTest {
 
-    private final YangUtilManager utilManager = new YangUtilManager();
+    private final YangCompilerManager utilManager =
+            new YangCompilerManager();
     private static final String DIR = "target/pstf/";
     private static final String COMP = System.getProperty("user.dir") + File
             .separator + DIR;
@@ -46,7 +53,13 @@
 
         YangIoUtils.deleteDirectory(DIR);
         String searchDir = "src/test/resources/pstcodegen";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
@@ -57,5 +70,4 @@
         YangPluginConfig.compileCode(COMP);
         YangIoUtils.deleteDirectory(DIR);
     }
-
 }
diff --git a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/RootClassGeneratorTest.java b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/RootClassGeneratorTest.java
index 2b01abe..0cca732 100644
--- a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/RootClassGeneratorTest.java
+++ b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/RootClassGeneratorTest.java
@@ -18,29 +18,41 @@
 
 import org.apache.maven.plugin.MojoExecutionException;
 import org.junit.Test;
-import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
-import org.onosproject.yang.compiler.utils.io.impl.YangFileScanner;
-import org.onosproject.yang.compiler.utils.io.impl.YangIoUtils;
 import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.tool.impl.YangCompilerManager;
+import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
+import org.onosproject.yang.compiler.utils.io.impl.YangIoUtils;
 
 import java.io.File;
 import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashSet;
+import java.util.Set;
 
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.core.Is.is;
+import static org.onosproject.yang.compiler.utils.io.impl.YangFileScanner.getYangFiles;
 
 /**
  * Unit test case for root node's code generation.
  */
 public class RootClassGeneratorTest {
 
-    private final YangUtilManager utilManager = new YangUtilManager();
+    private final YangCompilerManager utilManager =
+            new YangCompilerManager();
 
     @Test
     public void rootClassGenTest() throws IOException, ParserException, MojoExecutionException {
         YangIoUtils.deleteDirectory("target/manager/");
         String searchDir = "src/test/resources/manager/singleChild";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
@@ -66,7 +78,13 @@
     public void rootClassGenwithoutRevTest() throws IOException, ParserException, MojoExecutionException {
         YangIoUtils.deleteDirectory("target/manager/");
         String searchDir = "src/test/resources/manager/genwithoutrev";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
@@ -87,7 +105,13 @@
     public void rootClassMethodGenTest() throws IOException, ParserException, MojoExecutionException {
         YangIoUtils.deleteDirectory("target/manager/");
         String searchDir = "src/test/resources/manager/MultiChild";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
diff --git a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/SchemaNodeTest.java b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/SchemaNodeTest.java
index 3593398..b3a88f0 100644
--- a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/SchemaNodeTest.java
+++ b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/SchemaNodeTest.java
@@ -25,27 +25,33 @@
 import org.onosproject.yang.compiler.datamodel.YangSchemaNodeContextInfo;
 import org.onosproject.yang.compiler.datamodel.YangSchemaNodeIdentifier;
 import org.onosproject.yang.compiler.datamodel.exceptions.DataModelException;
-import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
-import org.onosproject.yang.compiler.utils.io.impl.YangFileScanner;
-import org.onosproject.yang.compiler.utils.io.impl.YangIoUtils;
 import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.tool.impl.YangCompilerManager;
+import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
+import org.onosproject.yang.compiler.utils.io.impl.YangIoUtils;
 
 import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 import static org.hamcrest.CoreMatchers.notNullValue;
 import static org.hamcrest.CoreMatchers.nullValue;
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.core.Is.is;
+import static org.onosproject.yang.compiler.utils.io.impl.YangFileScanner.getYangFiles;
 
 /**
  * Test cases for testing YANG schema node.
  */
 public class SchemaNodeTest {
 
-    private final YangUtilManager utilManager = new YangUtilManager();
+    private final YangCompilerManager utilManager =
+            new YangCompilerManager();
 
     /**
      * Checks method to get schema node from map.
@@ -62,8 +68,12 @@
 
         YangIoUtils.deleteDirectory("target/schemaMap/");
         String searchDir = "src/test/resources/schemaMap";
-        utilManager
-                .createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
@@ -198,8 +208,12 @@
 
         YangIoUtils.deleteDirectory("target/schemaMap/");
         String searchDir = "src/test/resources/schemaMap";
-        utilManager
-                .createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
diff --git a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/TypeDefTranslatorTest.java b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/TypeDefTranslatorTest.java
index d45be4a..5cd1b15 100644
--- a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/TypeDefTranslatorTest.java
+++ b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/TypeDefTranslatorTest.java
@@ -18,20 +18,27 @@
 
 import org.apache.maven.plugin.MojoExecutionException;
 import org.junit.Test;
-import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
-import org.onosproject.yang.compiler.utils.io.impl.YangFileScanner;
-import org.onosproject.yang.compiler.utils.io.impl.YangIoUtils;
 import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.tool.impl.YangCompilerManager;
+import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
+import org.onosproject.yang.compiler.utils.io.impl.YangIoUtils;
 
 import java.io.File;
 import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashSet;
+import java.util.Set;
+
+import static org.onosproject.yang.compiler.utils.io.impl.YangFileScanner.getYangFiles;
 
 /**
  * Unit test case for typedef translator.
  */
 public class TypeDefTranslatorTest {
 
-    private final YangUtilManager utilManager = new YangUtilManager();
+    private final YangCompilerManager utilManager =
+            new YangCompilerManager();
     private static final String DIR = "target/typedefTranslator/";
     private static final String DIR1 = System.getProperty("user.dir") + File
             .separator + DIR;
@@ -47,7 +54,12 @@
 
         YangIoUtils.deleteDirectory(DIR);
         String searchDir = "src/test/resources/typedefTranslator/without";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
@@ -70,7 +82,12 @@
 
         YangIoUtils.deleteDirectory(DIR);
         String searchDir = "src/test/resources/typedefTranslator/with";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
@@ -80,7 +97,6 @@
         utilManager.translateToJava(yangPluginConfig);
         YangPluginConfig.compileCode(DIR1);
         YangIoUtils.deleteDirectory(DIR);
-
     }
 
     /**
@@ -94,7 +110,12 @@
 
         YangIoUtils.deleteDirectory(DIR);
         String searchDir = "src/test/resources/typedefTranslator/union";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
diff --git a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/TypeLinkingAfterCloningTest.java b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/TypeLinkingAfterCloningTest.java
index 88937ae..3a10625 100644
--- a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/TypeLinkingAfterCloningTest.java
+++ b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/TypeLinkingAfterCloningTest.java
@@ -34,12 +34,16 @@
 import org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes;
 import org.onosproject.yang.compiler.linker.impl.YangLinkerManager;
 import org.onosproject.yang.compiler.linker.impl.YangLinkerUtils;
-import org.onosproject.yang.compiler.utils.io.impl.YangFileScanner;
 import org.onosproject.yang.compiler.parser.exceptions.ParserException;
+import org.onosproject.yang.compiler.tool.impl.YangCompilerManager;
 
 import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.ListIterator;
+import java.util.Set;
 
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.core.Is.is;
@@ -47,6 +51,7 @@
 import static org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes.DERIVED;
 import static org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes.IDENTITYREF;
 import static org.onosproject.yang.compiler.datamodel.utils.builtindatatype.YangDataTypes.STRING;
+import static org.onosproject.yang.compiler.utils.io.impl.YangFileScanner.getYangFiles;
 
 /**
  * Test cases for type linking after cloning happens grouping.
@@ -74,8 +79,8 @@
     private static final String BASE2 = "id1";
     private static final String DIR =
             "src/test/resources/typelinkingaftercloning/";
-
-    private final YangUtilManager utilMgr = new YangUtilManager();
+    private final YangCompilerManager utilMgr =
+            new YangCompilerManager();
     private final YangLinkerManager linkerMgr = new YangLinkerManager();
 
     @Rule
@@ -155,7 +160,12 @@
     @Test
     public void processLeafRefAfterCloning() throws IOException {
 
-        utilMgr.createYangFileInfoSet(YangFileScanner.getYangFiles(DIR + "leafref/intrafile"));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(DIR + "leafref/intrafile")) {
+            paths.add(Paths.get(file));
+        }
+
+        utilMgr.createYangFileInfoSet(paths);
         utilMgr.parseYangFileInfoSet();
         utilMgr.createYangNodeSet();
         YangNode selfNode;
@@ -249,11 +259,17 @@
      */
     @Test
     public void processInvalidLeafRef() throws IOException {
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(DIR + "leafref/invalid")) {
+            paths.add(Paths.get(file));
+        }
+
+        utilMgr.createYangFileInfoSet(paths);
         thrown.expect(ParserException.class);
         thrown.expectMessage("Union member type must not be one of the " +
                                      "built-in types \"empty\" or " +
                                      "\"leafref\"node-id_union");
-        utilMgr.createYangFileInfoSet(YangFileScanner.getYangFiles(DIR + "leafref/invalid"));
         utilMgr.parseYangFileInfoSet();
     }
 
@@ -264,8 +280,12 @@
      */
     @Test
     public void processIdentityRefBeforeCloning() throws IOException {
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(DIR + "identityref")) {
+            paths.add(Paths.get(file));
+        }
 
-        utilMgr.createYangFileInfoSet(YangFileScanner.getYangFiles(DIR + "identityref"));
+        utilMgr.createYangFileInfoSet(paths);
         utilMgr.parseYangFileInfoSet();
         utilMgr.createYangNodeSet();
         YangNode selfNode;
@@ -389,7 +409,6 @@
         assertThat(getInCrtLeafType(LEAF, NODE_ID),
                    idRef.getBaseIdentity().getName(),
                    is(FACILITY_SYS_LOG));
-
     }
 
     /**
@@ -399,8 +418,12 @@
      */
     @Test
     public void processUnionAfterCloning() throws IOException {
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(DIR + "union")) {
+            paths.add(Paths.get(file));
+        }
 
-        utilMgr.createYangFileInfoSet(YangFileScanner.getYangFiles(DIR + "union"));
+        utilMgr.createYangFileInfoSet(paths);
         utilMgr.parseYangFileInfoSet();
         utilMgr.createYangNodeSet();
         YangNode selfNode;
@@ -530,7 +553,6 @@
         YangContainer container = (YangContainer) list.getChild()
                 .getNextSibling().getNextSibling();
 
-
         Iterator<YangLeafList> leafListItr = container.getListOfLeafList()
                 .listIterator();
         YangLeafList leafListInfo = leafListItr.next();
@@ -631,8 +653,12 @@
      */
     @Test
     public void processIdentityRefWithTypeDef() throws IOException {
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(DIR + "idreftypedef")) {
+            paths.add(Paths.get(file));
+        }
 
-        utilMgr.createYangFileInfoSet(YangFileScanner.getYangFiles(DIR + "idreftypedef"));
+        utilMgr.createYangFileInfoSet(paths);
         utilMgr.parseYangFileInfoSet();
         utilMgr.createYangNodeSet();
         YangNode selfNode;
@@ -741,8 +767,12 @@
      */
     @Test
     public void processIdentityRefInGrouping() throws IOException {
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(DIR + "idrefingrouping")) {
+            paths.add(Paths.get(file));
+        }
 
-        utilMgr.createYangFileInfoSet(YangFileScanner.getYangFiles(DIR + "idrefingrouping"));
+        utilMgr.createYangFileInfoSet(paths);
         utilMgr.parseYangFileInfoSet();
         utilMgr.createYangNodeSet();
         YangNode selfNode;
diff --git a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/UnionTranslatorTest.java b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/UnionTranslatorTest.java
index cf4fb1f..c4e9b4e 100644
--- a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/UnionTranslatorTest.java
+++ b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/UnionTranslatorTest.java
@@ -19,15 +19,21 @@
 import org.apache.maven.plugin.MojoExecutionException;
 import org.junit.Test;
 import org.onosproject.yang.compiler.datamodel.YangNode;
-import org.onosproject.yang.compiler.translator.tojava.JavaCodeGeneratorUtil;
-import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
-import org.onosproject.yang.compiler.utils.io.impl.YangFileScanner;
-import org.onosproject.yang.compiler.utils.io.impl.YangIoUtils;
 import org.onosproject.yang.compiler.parser.exceptions.ParserException;
 import org.onosproject.yang.compiler.parser.impl.YangUtilsParserManager;
+import org.onosproject.yang.compiler.tool.impl.YangCompilerManager;
+import org.onosproject.yang.compiler.translator.tojava.JavaCodeGeneratorUtil;
+import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
+import org.onosproject.yang.compiler.utils.io.impl.YangIoUtils;
 
 import java.io.File;
 import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashSet;
+import java.util.Set;
+
+import static org.onosproject.yang.compiler.utils.io.impl.YangFileScanner.getYangFiles;
 
 /**
  * Unit tests for union translator.
@@ -39,6 +45,8 @@
     private static final String DIR1 = System.getProperty("user.dir") + File
             .separator + DIR;
 
+    YangCompilerManager utilManager = new YangCompilerManager();
+
     /**
      * Checks union translation should not result in any exception.
      */
@@ -66,8 +74,13 @@
     public void processUnionIntUintConflictingTypes() throws IOException, MojoExecutionException {
         YangIoUtils.deleteDirectory(DIR);
         String searchDir = "src/test/resources/unionTranslator/intuint";
-        YangUtilManager utilManager = new YangUtilManager();
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
@@ -91,8 +104,13 @@
             MojoExecutionException {
         YangIoUtils.deleteDirectory(DIR);
         String searchDir = "src/test/resources/unionTranslator/uintint";
-        YangUtilManager utilManager = new YangUtilManager();
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
@@ -116,8 +134,13 @@
             MojoExecutionException {
         YangIoUtils.deleteDirectory(DIR);
         String searchDir = "src/test/resources/unionTranslator/longulong";
-        YangUtilManager utilManager = new YangUtilManager();
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
@@ -141,8 +164,13 @@
             MojoExecutionException {
         YangIoUtils.deleteDirectory(DIR);
         String searchDir = "src/test/resources/unionTranslator/ulonglong";
-        YangUtilManager utilManager = new YangUtilManager();
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
@@ -166,8 +194,13 @@
             MojoExecutionException {
         YangIoUtils.deleteDirectory(DIR);
         String searchDir = "src/test/resources/unionTranslator/intuintulonglong";
-        YangUtilManager utilManager = new YangUtilManager();
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
@@ -191,8 +224,13 @@
             MojoExecutionException {
         YangIoUtils.deleteDirectory(DIR);
         String searchDir = "src/test/resources/unionTranslator/intuintulonglongstring";
-        YangUtilManager utilManager = new YangUtilManager();
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
@@ -216,8 +254,13 @@
             MojoExecutionException {
         YangIoUtils.deleteDirectory(DIR);
         String searchDir = "src/test/resources/unionTranslator/intuintstring";
-        YangUtilManager utilManager = new YangUtilManager();
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
@@ -241,8 +284,13 @@
             MojoExecutionException {
         YangIoUtils.deleteDirectory(DIR);
         String searchDir = "src/test/resources/unionTranslator/unionwithbinary";
-        YangUtilManager utilManager = new YangUtilManager();
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
diff --git a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/YangJavaModelUtilsTest.java b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/YangJavaModelUtilsTest.java
index 6612ab6..9b35c2c 100644
--- a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/YangJavaModelUtilsTest.java
+++ b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/YangJavaModelUtilsTest.java
@@ -21,12 +21,17 @@
 import org.junit.Test;
 import org.onosproject.yang.compiler.datamodel.YangNode;
 import org.onosproject.yang.compiler.parser.exceptions.ParserException;
-import org.onosproject.yang.compiler.translator.tojava.YangJavaModelUtils;
-import org.onosproject.yang.compiler.utils.io.impl.YangFileScanner;
+import org.onosproject.yang.compiler.tool.impl.YangCompilerManager;
 
 import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashSet;
+import java.util.Set;
 
 import static org.hamcrest.MatcherAssert.assertThat;
+import static org.onosproject.yang.compiler.translator.tojava.YangJavaModelUtils.isRootNodesCodeGenRequired;
+import static org.onosproject.yang.compiler.utils.io.impl.YangFileScanner.getYangFiles;
 
 /**
  * Unit test case for java model utils.
@@ -34,23 +39,30 @@
 public class YangJavaModelUtilsTest {
 
 
-    private final YangUtilManager utilManager = new YangUtilManager();
+    private final YangCompilerManager utilManager =
+            new YangCompilerManager();
 
     @Test
     public void isRootNodeContainsOnlyAugmentTest() throws IOException,
             ParserException, MojoExecutionException {
         String searchDir = "src/test/resources/rootNode/onlyaugment";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
 
         for (YangNode node : utilManager.getYangNodeSet()) {
             if (node.getName().equals("test5")) {
-                assertThat(true, Is.is(YangJavaModelUtils.isRootNodesCodeGenRequired(node)));
+                assertThat(true, Is.is(isRootNodesCodeGenRequired(node)));
             }
             if (node.getName().equals("test6")) {
-                assertThat(true, Is.is(YangJavaModelUtils.isRootNodesCodeGenRequired(node)));
+                assertThat(true, Is.is(isRootNodesCodeGenRequired(node)));
             }
         }
     }
@@ -59,14 +71,20 @@
     public void isRootNodeCodeGenRequiredOnlyLeafTest() throws IOException
             , ParserException, MojoExecutionException {
         String searchDir = "src/test/resources/rootNode/onlyleaf";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
 
         for (YangNode node : utilManager.getYangNodeSet()) {
             if (node.getName().equals("test5")) {
-                assertThat(true, Is.is(YangJavaModelUtils.isRootNodesCodeGenRequired(node)));
+                assertThat(true, Is.is(isRootNodesCodeGenRequired(node)));
             }
         }
     }
@@ -75,14 +93,20 @@
     public void isRootNodeCodeGenRequiredOnlyLeafListTest() throws IOException
             , ParserException, MojoExecutionException {
         String searchDir = "src/test/resources/rootNode/onlyleaflist";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
 
         for (YangNode node : utilManager.getYangNodeSet()) {
             if (node.getName().equals("test5")) {
-                assertThat(true, Is.is(YangJavaModelUtils.isRootNodesCodeGenRequired(node)));
+                assertThat(true, Is.is(isRootNodesCodeGenRequired(node)));
             }
         }
     }
@@ -91,17 +115,23 @@
     public void isRootNodeCodeGenRequiredOnlyGroupingTest() throws IOException
             , ParserException, MojoExecutionException {
         String searchDir = "src/test/resources/rootNode/onlygrouping";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
 
         for (YangNode node : utilManager.getYangNodeSet()) {
             if (node.getName().equals("test5")) {
-                assertThat(false, Is.is(YangJavaModelUtils.isRootNodesCodeGenRequired(node)));
+                assertThat(false, Is.is(isRootNodesCodeGenRequired(node)));
             }
             if (node.getName().equals("test6")) {
-                assertThat(false, Is.is(YangJavaModelUtils.isRootNodesCodeGenRequired(node)));
+                assertThat(false, Is.is(isRootNodesCodeGenRequired(node)));
             }
         }
     }
@@ -111,17 +141,23 @@
     public void isRootNodeCodeGenRequiredOnlyTypeDefTest() throws IOException
             , ParserException, MojoExecutionException {
         String searchDir = "src/test/resources/rootNode/onlytypdef";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
 
         for (YangNode node : utilManager.getYangNodeSet()) {
             if (node.getName().equals("test5")) {
-                assertThat(false, Is.is(YangJavaModelUtils.isRootNodesCodeGenRequired(node)));
+                assertThat(false, Is.is(isRootNodesCodeGenRequired(node)));
             }
             if (node.getName().equals("test6")) {
-                assertThat(false, Is.is(YangJavaModelUtils.isRootNodesCodeGenRequired(node)));
+                assertThat(false, Is.is(isRootNodesCodeGenRequired(node)));
             }
         }
     }
@@ -130,53 +166,68 @@
     public void isRootNodeCodeGenRequiredNoGenTest() throws IOException
             , ParserException, MojoExecutionException {
         String searchDir = "src/test/resources/rootNode/nogen";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
 
         for (YangNode node : utilManager.getYangNodeSet()) {
             if (node.getName().equals("test5")) {
-                assertThat(false, Is.is(YangJavaModelUtils.isRootNodesCodeGenRequired(node)));
+                assertThat(false, Is.is(isRootNodesCodeGenRequired(node)));
             }
         }
-
     }
 
     @Test
     public void isRootNodeCodeGenRequiredMixedTest() throws IOException
             , ParserException, MojoExecutionException {
         String searchDir = "src/test/resources/rootNode/mixed";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
 
         for (YangNode node : utilManager.getYangNodeSet()) {
             if (node.getName().equals("test5")) {
-                assertThat(true, Is.is(YangJavaModelUtils.isRootNodesCodeGenRequired(node)));
+                assertThat(true, Is.is(isRootNodesCodeGenRequired(node)));
             }
             if (node.getName().equals("test6")) {
-                assertThat(true, Is.is(YangJavaModelUtils.isRootNodesCodeGenRequired(node)));
+                assertThat(true, Is.is(isRootNodesCodeGenRequired(node)));
             }
         }
-
     }
 
     @Test
     public void isRootNodeCodeGenRequiredTypedefGroupingTest() throws IOException
             , ParserException, MojoExecutionException {
         String searchDir = "src/test/resources/rootNode/typedefgrouping";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
 
         for (YangNode node : utilManager.getYangNodeSet()) {
             if (node.getName().equals("test5")) {
-                assertThat(false, Is.is(YangJavaModelUtils.isRootNodesCodeGenRequired(node)));
+                assertThat(false, Is.is(isRootNodesCodeGenRequired(node)));
             }
         }
-
     }
 }
diff --git a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/YangXpathLinkerTest.java b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/YangXpathLinkerTest.java
index 28c3db8..4919914 100644
--- a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/YangXpathLinkerTest.java
+++ b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/YangXpathLinkerTest.java
@@ -18,25 +18,30 @@
 
 import org.apache.maven.plugin.MojoExecutionException;
 import org.junit.Test;
-import org.onosproject.yang.compiler.datamodel.ResolvableType;
 import org.onosproject.yang.compiler.datamodel.YangAugment;
 import org.onosproject.yang.compiler.datamodel.YangNode;
 import org.onosproject.yang.compiler.datamodel.YangReferenceResolver;
 import org.onosproject.yang.compiler.datamodel.YangResolutionInfo;
-import org.onosproject.yang.compiler.linker.impl.XpathLinkingTypes;
 import org.onosproject.yang.compiler.linker.impl.YangLinkerManager;
 import org.onosproject.yang.compiler.linker.impl.YangLinkerUtils;
 import org.onosproject.yang.compiler.linker.impl.YangXpathLinker;
+import org.onosproject.yang.compiler.tool.impl.YangCompilerManager;
 import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
-import org.onosproject.yang.compiler.utils.io.impl.YangFileScanner;
-import org.onosproject.yang.compiler.utils.io.impl.YangIoUtils;
 
 import java.io.File;
 import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.core.Is.is;
+import static org.onosproject.yang.compiler.datamodel.ResolvableType.YANG_AUGMENT;
+import static org.onosproject.yang.compiler.linker.impl.XpathLinkingTypes.AUGMENT_LINKING;
+import static org.onosproject.yang.compiler.utils.io.impl.YangFileScanner.getYangFiles;
+import static org.onosproject.yang.compiler.utils.io.impl.YangIoUtils.deleteDirectory;
 
 /**
  * Unit test cases for x-path linker.
@@ -46,7 +51,9 @@
     private static final String INTRA_FILE_PATH = "src/test/resources/xPathLinker/IntraFile/";
     private static final String INTER_FILE_PATH = "src/test/resources/xPathLinker/InterFile/";
     private static final String CASE_FILE_PATH = "src/test/resources/xPathLinker/Case/";
-    private YangUtilManager utilManager = new YangUtilManager();
+
+    private final YangCompilerManager utilManager =
+            new YangCompilerManager();
     private YangXpathLinker<?> linker = new YangXpathLinker();
     private YangLinkerManager linkerManager = new YangLinkerManager();
 
@@ -59,7 +66,12 @@
     @Test
     public void processIntraFileLinkingSingleLevel() throws IOException, MojoExecutionException {
 
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTRA_FILE_PATH + "IntraSingle/"));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(INTRA_FILE_PATH + "IntraSingle/")) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         utilManager.resolveDependenciesUsingLinker();
@@ -69,14 +81,15 @@
 
         for (YangNode node : utilManager.getYangNodeSet()) {
             YangReferenceResolver ref = (YangReferenceResolver) node;
-            List<YangResolutionInfo> infos = ref.getUnresolvedResolutionList(ResolvableType.YANG_AUGMENT);
+            List<YangResolutionInfo> infos = ref.getUnresolvedResolutionList(YANG_AUGMENT);
             YangResolutionInfo info = infos.get(0);
 
-            YangAugment augment = (YangAugment) info.getEntityToResolveInfo().getEntityToResolve();
-            targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+            YangAugment augment = (YangAugment) info
+                    .getEntityToResolveInfo().getEntityToResolve();
+            targetNodeName = augment.getTargetNode().get(
+                    augment.getTargetNode().size() - 1).getNodeIdentifier()
                     .getName();
             targetNode = augment.getAugmentedNode();
-
         }
 
         assertThat(true, is(targetNode.getName().equals(targetNodeName)));
@@ -90,7 +103,12 @@
     @Test
     public void processIntraFileLinkingMultipleLevel() throws IOException {
 
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTRA_FILE_PATH + "IntraMulti/"));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(INTRA_FILE_PATH + "IntraMulti/")) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
@@ -101,9 +119,11 @@
             List<YangAugment> augments = linker.getListOfYangAugment(node);
 
             for (YangAugment augment : augments) {
-                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+                targetNodeName = augment.getTargetNode().get(
+                        augment.getTargetNode().size() - 1).getNodeIdentifier()
                         .getName();
-                targetNode = linker.processXpathLinking(augment.getTargetNode(), node, XpathLinkingTypes.AUGMENT_LINKING);
+                targetNode = linker.processXpathLinking(
+                        augment.getTargetNode(), node, AUGMENT_LINKING);
             }
         }
 
@@ -117,7 +137,13 @@
      */
     @Test
     public void processIntraFileLinkingInAugmentSingleLevel() throws IOException {
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTRA_FILE_PATH + "IntraSingleAugment/"));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(INTRA_FILE_PATH + "IntraSingleAugment/")) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
 
@@ -128,9 +154,11 @@
             List<YangAugment> augments = linker.getListOfYangAugment(node);
 
             for (YangAugment augment : augments) {
-                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+                targetNodeName = augment.getTargetNode().get(
+                        augment.getTargetNode().size() - 1).getNodeIdentifier()
                         .getName();
-                targetNode = linker.processXpathLinking(augment.getTargetNode(), node, XpathLinkingTypes.AUGMENT_LINKING);
+                targetNode = linker.processXpathLinking(augment.getTargetNode(),
+                                                        node, AUGMENT_LINKING);
             }
         }
 
@@ -145,9 +173,13 @@
      */
     @Test
     public void processIntraFileMultiLevelWithoutPrefix() throws IOException {
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(INTRA_FILE_PATH +
+                                                "IntraMultiAugment/withoutprefix/")) {
+            paths.add(Paths.get(file));
+        }
 
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(
-                INTRA_FILE_PATH + "IntraMultiAugment/withoutprefix"));
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
@@ -165,7 +197,7 @@
                         .get(augment.getTargetNode().size() - 1)
                         .getNodeIdentifier().getName();
                 target = linker.processXpathLinking(augment.getTargetNode(),
-                                                    node, XpathLinkingTypes.AUGMENT_LINKING);
+                                                    node, AUGMENT_LINKING);
             }
         }
         assertThat(true, is(target.getName().equals(name)));
@@ -179,9 +211,13 @@
      */
     @Test
     public void processIntraFileWithPrefix() throws IOException {
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(INTRA_FILE_PATH +
+                                                "IntraMultiAugment/withprefix/")) {
+            paths.add(Paths.get(file));
+        }
 
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(
-                INTRA_FILE_PATH + "IntraMultiAugment/withprefix"));
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
@@ -199,11 +235,10 @@
                         .get(augment.getTargetNode().size() - 1)
                         .getNodeIdentifier().getName();
                 target = linker.processXpathLinking(augment.getTargetNode(),
-                                                    node, XpathLinkingTypes.AUGMENT_LINKING);
+                                                    node, AUGMENT_LINKING);
             }
         }
         assertThat(true, is(target.getName().equals(name)));
-
     }
 
     /**
@@ -214,9 +249,13 @@
      */
     @Test
     public void processIntraFileWithPartialPrefix() throws IOException {
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(INTRA_FILE_PATH +
+                                                "IntraMultiAugment/withpartialprefix/")) {
+            paths.add(Paths.get(file));
+        }
 
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(
-                INTRA_FILE_PATH + "IntraMultiAugment/withpartialprefix"));
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
@@ -234,7 +273,7 @@
                         .get(augment.getTargetNode().size() - 1)
                         .getNodeIdentifier().getName();
                 target = linker.processXpathLinking(augment.getTargetNode(),
-                                                    node, XpathLinkingTypes.AUGMENT_LINKING);
+                                                    node, AUGMENT_LINKING);
             }
         }
         assertThat(true, is(target.getName().equals(name)));
@@ -247,7 +286,14 @@
      */
     @Test
     public void processIntraFileLinkingInSubModuleSingleLevel() throws IOException {
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTRA_FILE_PATH + "IntraSingleSubModule/"));
+
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(INTRA_FILE_PATH +
+                                                "IntraSingleSubModule/")) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
@@ -261,9 +307,11 @@
             List<YangAugment> augments = linker.getListOfYangAugment(node);
 
             for (YangAugment augment : augments) {
-                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+                targetNodeName = augment.getTargetNode().get(
+                        augment.getTargetNode().size() - 1).getNodeIdentifier()
                         .getName();
-                targetNode = linker.processXpathLinking(augment.getTargetNode(), node, XpathLinkingTypes.AUGMENT_LINKING);
+                targetNode = linker.processXpathLinking
+                        (augment.getTargetNode(), node, AUGMENT_LINKING);
             }
         }
 
@@ -277,8 +325,13 @@
      */
     @Test
     public void processIntraFileLinkingInSubModuleMultiLevel() throws IOException {
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(INTRA_FILE_PATH +
+                                                "IntraMultiSubModule/")) {
+            paths.add(Paths.get(file));
+        }
 
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTRA_FILE_PATH + "IntraMultiSubModule/"));
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
@@ -292,9 +345,11 @@
             List<YangAugment> augments = linker.getListOfYangAugment(node);
 
             for (YangAugment augment : augments) {
-                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+                targetNodeName = augment.getTargetNode().get(
+                        augment.getTargetNode().size() - 1).getNodeIdentifier()
                         .getName();
-                targetNode = linker.processXpathLinking(augment.getTargetNode(), node, XpathLinkingTypes.AUGMENT_LINKING);
+                targetNode = linker.processXpathLinking(
+                        augment.getTargetNode(), node, AUGMENT_LINKING);
             }
         }
 
@@ -308,8 +363,13 @@
      */
     @Test
     public void processIntraFileLinkingInUsesSingleLevel() throws IOException {
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(INTRA_FILE_PATH +
+                                                "IntraSingleUses/")) {
+            paths.add(Paths.get(file));
+        }
 
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTRA_FILE_PATH + "IntraSingleUses/"));
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
@@ -323,9 +383,11 @@
             List<YangAugment> augments = linker.getListOfYangAugment(node);
 
             for (YangAugment augment : augments) {
-                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+                targetNodeName = augment.getTargetNode().get(
+                        augment.getTargetNode().size() - 1).getNodeIdentifier()
                         .getName();
-                targetNode = linker.processXpathLinking(augment.getTargetNode(), node, XpathLinkingTypes.AUGMENT_LINKING);
+                targetNode = linker.processXpathLinking(
+                        augment.getTargetNode(), node, AUGMENT_LINKING);
             }
         }
 
@@ -339,8 +401,13 @@
      */
     @Test
     public void processIntraFileLinkingInUsesMultiLevel() throws IOException {
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(INTRA_FILE_PATH +
+                                                "IntraMultiUses/")) {
+            paths.add(Paths.get(file));
+        }
 
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTRA_FILE_PATH + "IntraMultiUses/"));
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
@@ -354,9 +421,11 @@
             List<YangAugment> augments = linker.getListOfYangAugment(node);
 
             for (YangAugment augment : augments) {
-                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+                targetNodeName = augment.getTargetNode().get(
+                        augment.getTargetNode().size() - 1).getNodeIdentifier()
                         .getName();
-                targetNode = linker.processXpathLinking(augment.getTargetNode(), node, XpathLinkingTypes.AUGMENT_LINKING);
+                targetNode = linker.processXpathLinking(
+                        augment.getTargetNode(), node, AUGMENT_LINKING);
             }
         }
 
@@ -370,8 +439,13 @@
      */
     @Test
     public void processInterFileLinkingSingleLevel() throws IOException {
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(INTER_FILE_PATH +
+                                                "InterSingle/")) {
+            paths.add(Paths.get(file));
+        }
 
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTER_FILE_PATH + "InterSingle/"));
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
@@ -384,9 +458,11 @@
             List<YangAugment> augments = linker.getListOfYangAugment(node);
 
             for (YangAugment augment : augments) {
-                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+                targetNodeName = augment.getTargetNode().get(
+                        augment.getTargetNode().size() - 1).getNodeIdentifier()
                         .getName();
-                targetNode = linker.processXpathLinking(augment.getTargetNode(), node, XpathLinkingTypes.AUGMENT_LINKING);
+                targetNode = linker.processXpathLinking(
+                        augment.getTargetNode(), node, AUGMENT_LINKING);
             }
         }
 
@@ -400,8 +476,13 @@
      */
     @Test
     public void processInterFileLinkingMultipleLevel() throws IOException {
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(INTER_FILE_PATH +
+                                                "InterMulti/")) {
+            paths.add(Paths.get(file));
+        }
 
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTER_FILE_PATH + "InterMulti/"));
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
@@ -414,9 +495,11 @@
             List<YangAugment> augments = linker.getListOfYangAugment(node);
 
             for (YangAugment augment : augments) {
-                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+                targetNodeName = augment.getTargetNode().get(
+                        augment.getTargetNode().size() - 1).getNodeIdentifier()
                         .getName();
-                targetNode = linker.processXpathLinking(augment.getTargetNode(), node, XpathLinkingTypes.AUGMENT_LINKING);
+                targetNode = linker.processXpathLinking(
+                        augment.getTargetNode(), node, AUGMENT_LINKING);
             }
         }
 
@@ -430,8 +513,13 @@
      */
     @Test
     public void processInterFileLinkingInAugmentSingleLevel() throws IOException {
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(INTER_FILE_PATH +
+                                                "InterSingleAugment/")) {
+            paths.add(Paths.get(file));
+        }
 
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTER_FILE_PATH + "InterSingleAugment/"));
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
@@ -444,9 +532,11 @@
             List<YangAugment> augments = linker.getListOfYangAugment(node);
 
             for (YangAugment augment : augments) {
-                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+                targetNodeName = augment.getTargetNode().get(
+                        augment.getTargetNode().size() - 1).getNodeIdentifier()
                         .getName();
-                targetNode = linker.processXpathLinking(augment.getTargetNode(), node, XpathLinkingTypes.AUGMENT_LINKING);
+                targetNode = linker.processXpathLinking(
+                        augment.getTargetNode(), node, AUGMENT_LINKING);
             }
         }
 
@@ -460,8 +550,13 @@
      */
     @Test
     public void processInterFileLinkingInAugmentMultiLevel() throws IOException {
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(INTER_FILE_PATH +
+                                                "InterMultiAugment/")) {
+            paths.add(Paths.get(file));
+        }
 
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTER_FILE_PATH + "InterMultiAugment/"));
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
@@ -474,9 +569,11 @@
             List<YangAugment> augments = linker.getListOfYangAugment(node);
 
             for (YangAugment augment : augments) {
-                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+                targetNodeName = augment.getTargetNode().get(
+                        augment.getTargetNode().size() - 1).getNodeIdentifier()
                         .getName();
-                targetNode = linker.processXpathLinking(augment.getTargetNode(), node, XpathLinkingTypes.AUGMENT_LINKING);
+                targetNode = linker.processXpathLinking(
+                        augment.getTargetNode(), node, AUGMENT_LINKING);
             }
         }
 
@@ -490,8 +587,13 @@
      */
     @Test
     public void processMultiInterFileLinkingInAugmentSingleLevel() throws IOException {
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(INTER_FILE_PATH +
+                                                "InterMultiFileAugment/")) {
+            paths.add(Paths.get(file));
+        }
 
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTER_FILE_PATH + "InterMultiFileAugment/"));
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
@@ -504,9 +606,11 @@
             List<YangAugment> augments = linker.getListOfYangAugment(node);
 
             for (YangAugment augment : augments) {
-                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+                targetNodeName = augment.getTargetNode().get(
+                        augment.getTargetNode().size() - 1).getNodeIdentifier()
                         .getName();
-                targetNode = linker.processXpathLinking(augment.getTargetNode(), node, XpathLinkingTypes.AUGMENT_LINKING);
+                targetNode = linker.processXpathLinking(
+                        augment.getTargetNode(), node, AUGMENT_LINKING);
             }
         }
 
@@ -520,9 +624,13 @@
      */
     @Test
     public void processMultiInterFileLinkingInAugmentMultiLevel() throws IOException {
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(INTER_FILE_PATH +
+                                                "InterMultiFileAugmentMulti/")) {
+            paths.add(Paths.get(file));
+        }
 
-        utilManager
-                .createYangFileInfoSet(YangFileScanner.getYangFiles(INTER_FILE_PATH + "InterMultiFileAugmentMulti/"));
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
@@ -539,7 +647,8 @@
             List<YangAugment> augments = linker.getListOfYangAugment(node);
 
             for (YangAugment augment : augments) {
-                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+                targetNodeName = augment.getTargetNode().get(
+                        augment.getTargetNode().size() - 1).getNodeIdentifier()
                         .getName();
                 targetNode = augment.getAugmentedNode();
             }
@@ -555,8 +664,13 @@
      */
     @Test
     public void processInterFileLinkingInSubModuleSingleLevel() throws IOException {
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(INTER_FILE_PATH +
+                                                "InterSingleSubModule/")) {
+            paths.add(Paths.get(file));
+        }
 
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTER_FILE_PATH + "InterSingleSubModule/"));
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
@@ -572,7 +686,8 @@
             List<YangAugment> augments = linker.getListOfYangAugment(node);
 
             for (YangAugment augment : augments) {
-                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+                targetNodeName = augment.getTargetNode().get(
+                        augment.getTargetNode().size() - 1).getNodeIdentifier()
                         .getName();
                 targetNode = augment.getAugmentedNode();
             }
@@ -588,8 +703,13 @@
      */
     @Test
     public void processInterFileLinkingInSubModuleMultiLevel() throws IOException {
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(INTER_FILE_PATH +
+                                                "InterMultiSubModule/")) {
+            paths.add(Paths.get(file));
+        }
 
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTER_FILE_PATH + "InterMultiSubModule/"));
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
@@ -605,7 +725,8 @@
             List<YangAugment> augments = linker.getListOfYangAugment(node);
 
             for (YangAugment augment : augments) {
-                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+                targetNodeName = augment.getTargetNode().get(
+                        augment.getTargetNode().size() - 1).getNodeIdentifier()
                         .getName();
                 targetNode = augment.getAugmentedNode();
             }
@@ -621,8 +742,13 @@
      */
     @Test
     public void processInterFileLinkingInUsesInAugment() throws IOException {
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(INTER_FILE_PATH +
+                                                "InterSingleUses/")) {
+            paths.add(Paths.get(file));
+        }
 
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTER_FILE_PATH + "InterSingleUses/"));
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
@@ -639,14 +765,14 @@
             List<YangAugment> augments = linker.getListOfYangAugment(node);
 
             for (YangAugment augment : augments) {
-                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1)
+                targetNodeName = augment.getTargetNode().get(
+                        augment.getTargetNode().size() - 1)
                         .getNodeIdentifier().getName();
                 targetNode = augment.getAugmentedNode();
             }
         }
 
         assertThat(true, is(targetNode.getName().equals(targetNodeName)));
-
     }
 
     /**
@@ -656,8 +782,13 @@
      */
     @Test
     public void processInterFileLinkingInUsesMultiLevel() throws IOException {
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(INTER_FILE_PATH +
+                                                "InterMultiUses/")) {
+            paths.add(Paths.get(file));
+        }
 
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(INTER_FILE_PATH + "InterMultiUses/"));
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
@@ -673,9 +804,11 @@
             List<YangAugment> augments = linker.getListOfYangAugment(node);
 
             for (YangAugment augment : augments) {
-                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1).getNodeIdentifier()
+                targetNodeName = augment.getTargetNode().get(
+                        augment.getTargetNode().size() - 1).getNodeIdentifier()
                         .getName();
-                targetNode = linker.processXpathLinking(augment.getTargetNode(), node, XpathLinkingTypes.AUGMENT_LINKING);
+                targetNode = linker.processXpathLinking(
+                        augment.getTargetNode(), node, AUGMENT_LINKING);
             }
         }
 
@@ -689,8 +822,13 @@
      */
     @Test
     public void processInterFileLinkingInMultipleSubmodules() throws IOException {
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(CASE_FILE_PATH +
+                                                "submodule/")) {
+            paths.add(Paths.get(file));
+        }
 
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(CASE_FILE_PATH + "submodule/"));
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
@@ -708,14 +846,14 @@
             List<YangAugment> augments = linker.getListOfYangAugment(node);
 
             for (YangAugment augment : augments) {
-                targetNodeName = augment.getTargetNode().get(augment.getTargetNode().size() - 1)
+                targetNodeName = augment.getTargetNode().get(
+                        augment.getTargetNode().size() - 1)
                         .getNodeIdentifier().getName();
                 targetNode = augment.getAugmentedNode();
             }
         }
 
         assertThat(true, is(targetNode.getName().equals(targetNodeName)));
-
     }
 
     /**
@@ -725,9 +863,14 @@
      */
     @Test
     public void processInterFileLinkingInMultipleUses() throws IOException {
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(CASE_FILE_PATH +
+                                                "uses/")) {
+            paths.add(Paths.get(file));
+        }
 
-        YangIoUtils.deleteDirectory("target/xpath/");
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(CASE_FILE_PATH + "uses/"));
+        utilManager.createYangFileInfoSet(paths);
+        deleteDirectory("target/xpath/");
         utilManager.parseYangFileInfoSet();
         utilManager.createYangNodeSet();
         linkerManager.createYangNodeSet(utilManager.getYangNodeSet());
@@ -755,7 +898,7 @@
         utilManager.translateToJava(yangPluginConfig);
         String dir = System.getProperty("user.dir") + File.separator + "target/xpath/";
         YangPluginConfig.compileCode(dir);
-        YangIoUtils.deleteDirectory("target/xpath/");
+        deleteDirectory("target/xpath/");
         assertThat(true, is(targetNode.getName().equals(targetNodeName)));
     }
 }
diff --git a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/ietfyang/IetfYangFileTest.java b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/ietfyang/IetfYangFileTest.java
index 82de4c5..d0eab39 100644
--- a/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/ietfyang/IetfYangFileTest.java
+++ b/compiler/plugin/maven/src/test/java/org/onosproject/yang/compiler/plugin/maven/ietfyang/IetfYangFileTest.java
@@ -18,21 +18,26 @@
 
 import org.apache.maven.plugin.MojoExecutionException;
 import org.junit.Test;
-import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
-import org.onosproject.yang.compiler.utils.io.impl.YangFileScanner;
-import org.onosproject.yang.compiler.utils.io.impl.YangIoUtils;
 import org.onosproject.yang.compiler.parser.exceptions.ParserException;
-import org.onosproject.yang.compiler.plugin.maven.YangUtilManager;
+import org.onosproject.yang.compiler.tool.impl.YangCompilerManager;
+import org.onosproject.yang.compiler.utils.io.YangPluginConfig;
+import org.onosproject.yang.compiler.utils.io.impl.YangIoUtils;
 
 import java.io.File;
 import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashSet;
+import java.util.Set;
+
+import static org.onosproject.yang.compiler.utils.io.impl.YangFileScanner.getYangFiles;
 
 /**
  * Test cases for testing IETF YANG files.
  */
 public class IetfYangFileTest {
 
-    private final YangUtilManager utilManager = new YangUtilManager();
+    private final YangCompilerManager utilManager = new YangCompilerManager();
 
     /**
      * Checks hierarchical intra with inter file type linking.
@@ -45,7 +50,12 @@
         String dir = "target/ietfyang/l3vpnservice/";
         YangIoUtils.deleteDirectory(dir);
         String searchDir = "src/test/resources/ietfyang/l3vpnservice";
-        utilManager.createYangFileInfoSet(YangFileScanner.getYangFiles(searchDir));
+        Set<Path> paths = new HashSet<>();
+        for (String file : getYangFiles(searchDir)) {
+            paths.add(Paths.get(file));
+        }
+
+        utilManager.createYangFileInfoSet(paths);
         utilManager.parseYangFileInfoSet();
         utilManager.resolveDependenciesUsingLinker();
 
@@ -57,5 +67,4 @@
         YangPluginConfig.compileCode(dir1);
         YangIoUtils.deleteDirectory("target/ietfyang/");
     }
-
 }
diff --git a/compiler/plugin/pom.xml b/compiler/plugin/pom.xml
index fd23dfc..bcf0061 100644
--- a/compiler/plugin/pom.xml
+++ b/compiler/plugin/pom.xml
@@ -62,11 +62,6 @@
             <artifactId>onos-yang-compiler-linker</artifactId>
             <version>${project.version}</version>
         </dependency>
-        <dependency>
-            <groupId>org.onosproject</groupId>
-            <artifactId>onos-yang-compiler-datamodel</artifactId>
-            <version>${project.version}</version>
-        </dependency>
     </dependencies>
 </project>
 
