diff --git a/providers/snmp/device/src/main/java/org/onosproject/provider/snmp/device/impl/SnmpDeviceProvider.java b/providers/snmp/device/src/main/java/org/onosproject/provider/snmp/device/impl/SnmpDeviceProvider.java
index 5a78260..c4fdcd1 100644
--- a/providers/snmp/device/src/main/java/org/onosproject/provider/snmp/device/impl/SnmpDeviceProvider.java
+++ b/providers/snmp/device/src/main/java/org/onosproject/provider/snmp/device/impl/SnmpDeviceProvider.java
@@ -15,7 +15,6 @@
  */
 package org.onosproject.provider.snmp.device.impl;
 
-import com.google.common.collect.ImmutableList;
 import org.apache.felix.scr.annotations.Activate;
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Deactivate;
@@ -25,7 +24,6 @@
 import org.onlab.packet.ChassisId;
 import org.onosproject.core.ApplicationId;
 import org.onosproject.core.CoreService;
-import org.onosproject.net.config.ConfigException;
 import org.onosproject.net.AnnotationKeys;
 import org.onosproject.net.DefaultAnnotations;
 import org.onosproject.net.Device;
@@ -54,14 +52,12 @@
 import org.osgi.service.component.ComponentContext;
 import org.slf4j.Logger;
 
-import java.util.List;
 import java.util.Set;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
 
 import static org.onlab.util.Tools.groupedThreads;
-import static org.onosproject.net.config.basics.SubjectFactories.APP_SUBJECT_FACTORY;
 import static org.slf4j.LoggerFactory.getLogger;
 
 /**
@@ -106,16 +102,7 @@
     protected final NetworkConfigListener cfgLister = new InternalNetworkConfigListener();
 
 
-    protected final List<ConfigFactory> factories = ImmutableList.of(
-            new ConfigFactory<ApplicationId, SnmpProviderConfig>(APP_SUBJECT_FACTORY,
-                                                                 SnmpProviderConfig.class,
-                                                                 "snmp_devices",
-                                                                 true) {
-                @Override
-                public SnmpProviderConfig createConfig() {
-                    return new SnmpProviderConfig();
-                }
-            },
+    protected final ConfigFactory factory =
             new ConfigFactory<DeviceId, SnmpDeviceConfig>(SubjectFactories.DEVICE_SUBJECT_FACTORY,
                                                           SnmpDeviceConfig.class,
                                                           SCHEME) {
@@ -123,7 +110,7 @@
                 public SnmpDeviceConfig createConfig() {
                     return new SnmpDeviceConfig();
                 }
-            });
+            };
 
 
     /**
@@ -139,10 +126,9 @@
 
         providerService = providerRegistry.register(this);
         appId = coreService.registerApplication(APP_NAME);
-        factories.forEach(netCfgService::registerConfigFactory);
+        netCfgService.registerConfigFactory(factory);
         netCfgService.addListener(cfgLister);
         connectDevices();
-        addOrRemoveDevicesConfig();
         modified(context);
         log.info("Started");
     }
@@ -160,7 +146,7 @@
             log.error("Device builder did not terminate");
         }
         deviceBuilderExecutor.shutdownNow();
-        factories.forEach(netCfgService::unregisterConfigFactory);
+        netCfgService.unregisterConfigFactory(factory);
         netCfgService.removeListener(cfgLister);
         providerRegistry.unregister(this);
         providerService = null;
@@ -172,23 +158,6 @@
         log.info("Modified");
     }
 
-    //Old method to register devices provided via net-cfg under apps/snmp/ tree
-    private void addOrRemoveDevicesConfig() {
-        SnmpProviderConfig cfg = netCfgService.getConfig(appId, SnmpProviderConfig.class);
-        if (cfg != null) {
-            try {
-                cfg.getDevicesInfo().forEach(info -> {
-                    buildDevice(new DefaultSnmpDevice(info.ip().toString(),
-                                                      info.port(), info.username(),
-                                                      info.password()));
-
-                });
-            } catch (ConfigException e) {
-                log.error("Cannot read config error " + e);
-            }
-        }
-    }
-
     //Method to register devices provided via net-cfg under devices/ tree
     private void connectDevices() {
         Set<DeviceId> deviceSubjects =
@@ -344,14 +313,12 @@
             } else {
                 log.warn("Injecting device via this Json is deprecated, " +
                                  "please put configuration under devices/");
-                addOrRemoveDevicesConfig();
             }
         }
 
         @Override
         public boolean isRelevant(NetworkConfigEvent event) {
-            return (event.configClass().equals(SnmpDeviceConfig.class) ||
-                    event.configClass().equals(SnmpProviderConfig.class)) &&
+            return (event.configClass().equals(SnmpDeviceConfig.class)) &&
                     (event.type() == NetworkConfigEvent.Type.CONFIG_ADDED ||
                             event.type() == NetworkConfigEvent.Type.CONFIG_UPDATED);
         }
diff --git a/providers/snmp/device/src/main/java/org/onosproject/provider/snmp/device/impl/SnmpProviderConfig.java b/providers/snmp/device/src/main/java/org/onosproject/provider/snmp/device/impl/SnmpProviderConfig.java
deleted file mode 100644
index 43f4ad7..0000000
--- a/providers/snmp/device/src/main/java/org/onosproject/provider/snmp/device/impl/SnmpProviderConfig.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright 2016-present Open Networking Foundation
- *
- * 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.provider.snmp.device.impl;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.google.common.annotations.Beta;
-import com.google.common.collect.Sets;
-import org.onlab.packet.IpAddress;
-import org.onosproject.core.ApplicationId;
-import org.onosproject.net.config.ConfigException;
-import org.onosproject.net.config.Config;
-
-import java.util.Set;
-
-/**
- * Configuration decoder for SNMP provider.
- * @deprecated 1.10.0 Kingfisher
- */
-@Deprecated
-@Beta
-public class SnmpProviderConfig extends Config<ApplicationId> {
-
-    public static final String CONFIG_VALUE_ERROR = "Error parsing config value";
-    private static final String IP = "ip";
-    private static final int DEFAULT_TCP_PORT = 830;
-    private static final String PORT = "port";
-    private static final String NAME = "username";
-    private static final String PASSWORD = "password";
-
-    /**
-     * Retrieves a set of SnmpDeviceInfo containing all the device
-     * configuration pertaining to the SNMP device provider.
-     * @return set of device configurations.
-     *
-     * @throws ConfigException if configuration can't be read
-     */
-    public Set<SnmpDeviceInfo> getDevicesInfo() throws ConfigException {
-        Set<SnmpDeviceInfo> deviceInfos = Sets.newHashSet();
-
-        try {
-            for (JsonNode node : array) {
-                String ip = node.path(IP).asText();
-                IpAddress ipAddr = ip.isEmpty() ? null : IpAddress.valueOf(ip);
-                int port = node.path(PORT).asInt(DEFAULT_TCP_PORT);
-                String name = node.path(NAME).asText();
-                String password = node.path(PASSWORD).asText();
-                deviceInfos.add(new SnmpDeviceInfo(ipAddr, port, name, password));
-
-            }
-        } catch (IllegalArgumentException e) {
-            throw new ConfigException(CONFIG_VALUE_ERROR, e);
-        }
-
-        return deviceInfos;
-    }
-
-    /**
-     * Contains information about a SNMP device retrieved form the net-cfg subsystem.
-     */
-    public class SnmpDeviceInfo {
-        private final IpAddress ip;
-        private final int port;
-        private final String username;
-        private final String password;
-
-        /**
-         * Build an information object containing the given device specifics.
-         * @param ip ip
-         * @param port port
-         * @param username username
-         * @param password password (a.k.a community in SNMP)
-         */
-        public SnmpDeviceInfo(IpAddress ip, int port, String username, String password) {
-            this.ip = ip;
-            this.port = port;
-            this.username = username;
-            this.password = password;
-        }
-
-        /**
-         * Returns IpAddress of the device.
-         * @return ip
-         */
-        public IpAddress ip() {
-            return ip;
-        }
-
-        /**
-         * Returns port of the device.
-         * @return port
-         */
-        public int port() {
-            return port;
-        }
-
-        /**
-         * Returns username of the device.
-         * @return username
-         */
-        public String username() {
-            return username;
-        }
-
-        /**
-         * Returns password of the device.
-         * @return password
-         */
-        public String password() {
-            return password;
-        }
-    }
-
-}
-
diff --git a/providers/snmp/device/src/test/java/org/onosproject/provider/snmp/device/impl/SnmpDeviceProviderTest.java b/providers/snmp/device/src/test/java/org/onosproject/provider/snmp/device/impl/SnmpDeviceProviderTest.java
index c9e20b2..49374cc 100644
--- a/providers/snmp/device/src/test/java/org/onosproject/provider/snmp/device/impl/SnmpDeviceProviderTest.java
+++ b/providers/snmp/device/src/test/java/org/onosproject/provider/snmp/device/impl/SnmpDeviceProviderTest.java
@@ -21,12 +21,10 @@
 import com.google.common.collect.ImmutableSet;
 import org.junit.Before;
 import org.junit.Test;
-import org.onlab.packet.IpAddress;
 import org.onosproject.TestApplicationId;
 import org.onosproject.core.ApplicationId;
 import org.onosproject.core.CoreService;
 import org.onosproject.core.CoreServiceAdapter;
-import org.onosproject.net.config.ConfigException;
 import org.onosproject.net.AbstractProjectableModel;
 import org.onosproject.net.DefaultAnnotations;
 import org.onosproject.net.DefaultDevice;
@@ -60,7 +58,11 @@
 import java.util.HashSet;
 import java.util.Set;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 import static org.onlab.junit.TestTools.assertAfter;
 
 /**
@@ -79,14 +81,10 @@
     protected CoreService coreService = new MockCoreService();
     private final DeviceProviderService deviceProviderService = new MockDeviceProviderService();
     private final TestApplicationId applicationId = new TestApplicationId("TestAppId");
-    private final SnmpProviderConfig snmpProviderConfig = new MockSnmpProviderConfig();
     private final DeviceId deviceId = DeviceId.deviceId("snmp:1.1.1.1:1");
     private final DeviceId wrongDeviceId = DeviceId.deviceId("snmp:2.2.2.2:2");
     private final Set<ConfigFactory> cfgFactories = new HashSet<>();
     private final Set<NetworkConfigListener> netCfgListeners = new HashSet<>();
-    private final NetworkConfigEvent deviceAddedEvent =
-            new NetworkConfigEvent(NetworkConfigEvent.Type.CONFIG_ADDED,
-                                   null, SnmpProviderConfig.class);
     private final NetworkConfigEvent deviceAddedIrrelevantEvent =
             new NetworkConfigEvent(NetworkConfigEvent.Type.CONFIG_ADDED,
                                    null, BasicDeviceConfig.class);
@@ -119,7 +117,7 @@
     public void testActivate() {
         assertEquals("Incorrect provider service", deviceProviderService, provider.providerService);
         assertEquals("Incorrect application id", applicationId, provider.appId);
-        assertTrue("Incorrect config factories", cfgFactories.containsAll(provider.factories));
+        assertTrue("Incorrect config factories", cfgFactories.contains(provider.factory));
         assertTrue("Incorrect network config listener", netCfgListeners.contains(provider.cfgLister));
 
 
@@ -145,8 +143,6 @@
 
     @Test
     public void addDevice() {
-        assertTrue("Event should be relevant", provider.cfgLister.isRelevant(deviceAddedEvent));
-        provider.cfgLister.event(deviceAddedEvent);
         AbstractProjectableModel.setDriverService(null, new MockDriverService());
         //FIXME this needs sleep
         assertAfter(DELAY, TEST_DURATION, () ->
@@ -219,9 +215,7 @@
 
         @Override
         public <S, C extends Config<S>> C getConfig(S subject, Class<C> configClass) {
-            if (configClass.equals(SnmpProviderConfig.class)) {
-                return (C) snmpProviderConfig;
-            } else if (configClass.equals(SnmpDeviceConfig.class)) {
+            if (configClass.equals(SnmpDeviceConfig.class)) {
                 return (C) config;
             } else {
                 return (C) new BasicDeviceConfig();
@@ -271,16 +265,6 @@
         }
     }
 
-    private class MockSnmpProviderConfig extends SnmpProviderConfig {
-        protected SnmpDeviceInfo deviceInfo = new SnmpDeviceInfo(IpAddress.valueOf("1.1.1.1"), 1, "test", "test");
-
-        @Override
-        public Set<SnmpProviderConfig.SnmpDeviceInfo> getDevicesInfo() throws ConfigException {
-            return ImmutableSet.of(deviceInfo);
-        }
-
-    }
-
     private class MockDriverService extends DriverServiceAdapter {
 
     }
