diff --git a/nss_ipv4.c b/nss_ipv4.c
index 7b8a09a..6c81bca 100755
--- a/nss_ipv4.c
+++ b/nss_ipv4.c
@@ -26,12 +26,16 @@
 extern void nss_rx_ipv4_sync(struct nss_ctx_instance *nss_ctx, struct nss_ipv4_conn_sync *nirs);
 
 /*
- * nss_ipv4_driver_update()
+ * nss_ipv4_driver_conn_sync_update()
  *	Update driver specific information from the messsage.
+ *
+ * TODO: export for now but once we remove old APIs, this can be made statis.
  */
-#if 0
-static void nss_ipv4_driver_conn_update(struct nss_ipv4_msg *nim)
+void nss_ipv4_driver_conn_sync_update(struct nss_ctx_instance *nss_ctx, struct nss_ipv4_conn_sync *nirs)
 {
+	struct nss_top_instance *nss_top = nss_ctx->nss_top;
+	struct net_device *pppoe_dev = NULL;
+
 	/*
 	 * Update statistics maintained by NSS driver
 	 */
@@ -41,8 +45,28 @@
 	nss_top->stats_ipv4[NSS_STATS_IPV4_ACCELERATED_TX_PKTS] += nirs->flow_tx_packet_count + nirs->return_tx_packet_count;
 	nss_top->stats_ipv4[NSS_STATS_IPV4_ACCELERATED_TX_BYTES] += nirs->flow_tx_byte_count + nirs->return_tx_byte_count;
 	spin_unlock_bh(&nss_top->stats_lock);
+
+	/*
+	 * Update the PPPoE interface stats, if there is any PPPoE session on the interfaces.
+	 */
+	if (nirs->flow_pppoe_session_id) {
+		pppoe_dev = ppp_session_to_netdev(nirs->flow_pppoe_session_id, (uint8_t *)nirs->flow_pppoe_remote_mac);
+		if (pppoe_dev) {
+			ppp_update_stats(pppoe_dev, nirs->flow_rx_packet_count, nirs->flow_rx_byte_count,
+					nirs->flow_tx_packet_count, nirs->flow_tx_byte_count);
+			dev_put(pppoe_dev);
+		}
+	}
+
+	if (nirs->return_pppoe_session_id) {
+		pppoe_dev = ppp_session_to_netdev(nirs->return_pppoe_session_id, (uint8_t *)nirs->return_pppoe_remote_mac);
+		if (pppoe_dev) {
+			ppp_update_stats(pppoe_dev, nirs->return_rx_packet_count, nirs->return_rx_byte_count,
+					nirs->return_tx_packet_count, nirs->return_tx_byte_count);
+			dev_put(pppoe_dev);
+		}
+	}
 }
-#endif
 
 /*
  * nss_ipv4_rx_msg_handler()
@@ -51,10 +75,7 @@
 static void nss_ipv4_rx_msg_handler(struct nss_ctx_instance *nss_ctx, struct nss_cmn_msg *ncm, __attribute__((unused))void *app_data)
 {
 	struct nss_ipv4_msg *nim = (struct nss_ipv4_msg *)ncm;
-/*
- * TODO: Turn back on for new APIs
- */
-//	nss_ipv4_rx_msg_callback_t cb;
+	nss_ipv4_msg_callback_t cb;
 
 	BUG_ON(ncm->interface != NSS_IPV4_RX_INTERFACE);
 
@@ -72,15 +93,6 @@
 	}
 
 	/*
-	 * Update the callback and app_data for NOTIFY messages, IPv4 sends all notify messages
-	 * to the same callback/app_data.
-	 */
-	if (nim->cm.response == NSS_CMM_RESPONSE_NOTIFY) {
-		ncm->cb = (uint32_t)nss_ctx->nss_top->ipv4_callback;
-		ncm->app_data = (uint32_t)nss_ctx->nss_top->ipv4_ctx;
-	}
-
-	/*
 	 * Log failures
 	 */
 	nss_core_log_msg_failures(nss_ctx, ncm);
@@ -94,15 +106,22 @@
 		break;
 
 	case NSS_IPV4_RX_CONN_STATS_SYNC_MSG:
+		/*
+		 * Update driver statistics on connection sync.
+		 */
+		nss_ipv4_driver_conn_sync_update(nss_ctx, &nim->msg.conn_stats);
 		return nss_rx_ipv4_sync(nss_ctx, &nim->msg.conn_stats);
 		break;
 	}
 
-#if 0
 	/*
-	 * Local driver updates for ipv4.
+	 * Update the callback and app_data for NOTIFY messages, IPv4 sends all notify messages
+	 * to the same callback/app_data.
 	 */
-	nss_ipv4_driver_update(nim);
+	if (nim->cm.response == NSS_CMM_RESPONSE_NOTIFY) {
+		ncm->cb = (uint32_t)nss_ctx->nss_top->ipv4_callback;
+		ncm->app_data = (uint32_t)nss_ctx->nss_top->ipv4_ctx;
+	}
 
 	/*
 	 * Do we have a callback?
@@ -114,9 +133,8 @@
 	/*
 	 * Callback
 	 */
-	cb = (nss_ipv4_rx_msg_callback_t)ncm->cb;
+	cb = (nss_ipv4_msg_callback_t)ncm->cb;
 	cb((void *)ncm->app_data, nim);
-#endif
 }
 
 /*
diff --git a/nss_tx_rx_ipv4.c b/nss_tx_rx_ipv4.c
index a8fd7d4..0f777d1 100755
--- a/nss_tx_rx_ipv4.c
+++ b/nss_tx_rx_ipv4.c
@@ -25,14 +25,22 @@
 #include "nss_ipv4.h"
 
 /*
+ * Depreceated callback maintained locally.
+ */
+nss_ipv4_callback_t nss_tx_rx_ipv4_event_callback = NULL;
+
+/*
+ * TOOD: When we remove this backward compat layer, clean up nss_ipv4.c
+ */
+extern void nss_ipv4_driver_conn_sync_update(struct nss_ctx_instance *nss_ctx, struct nss_ipv4_conn_sync *nirs);
+
+/*
  * nss_rx_ipv4_sync()
- *	Deprecated - Handle the syncing of an IPv4 node.
+ *	Handle the syncing of an IPv4 node.
  */
 void nss_rx_ipv4_sync(struct nss_ctx_instance *nss_ctx, struct nss_ipv4_conn_sync *nirs)
 {
-	struct nss_top_instance *nss_top = nss_ctx->nss_top;
 	struct nss_ipv4_cb_params nicp;
-	struct net_device *pppoe_dev = NULL;
 
 	nicp.reason = NSS_IPV4_CB_REASON_SYNC;
 	nicp.params.sync.index = nirs->index;
@@ -100,49 +108,17 @@
 	/*
 	 * Call IPv4 manager callback function
 	 */
-	if (nss_ctx->nss_top->ipv4_callback) {
-		nss_ipv4_callback_t cb = (nss_ipv4_callback_t)nss_ctx->nss_top->ipv4_callback;
-		cb(&nicp);
-	} else {
+	if (!nss_tx_rx_ipv4_event_callback) {
 		nss_info("%p: IPV4 sync message received before connection manager has registered", nss_ctx);
+	} else {
+		nss_ipv4_callback_t cb = nss_tx_rx_ipv4_event_callback;
+		cb(&nicp);
 	}
 
 	/*
-	 * Update statistics maintained by NSS driver
+	 * Update local driver statistics
 	 */
-	spin_lock_bh(&nss_top->stats_lock);
-
-	nss_top->stats_ipv4[NSS_STATS_IPV4_ACCELERATED_RX_PKTS] += nirs->flow_rx_packet_count + nirs->return_rx_packet_count;
-	nss_top->stats_ipv4[NSS_STATS_IPV4_ACCELERATED_RX_BYTES] += nirs->flow_rx_byte_count + nirs->return_rx_byte_count;
-	nss_top->stats_ipv4[NSS_STATS_IPV4_ACCELERATED_TX_PKTS] += nirs->flow_tx_packet_count + nirs->return_tx_packet_count;
-	nss_top->stats_ipv4[NSS_STATS_IPV4_ACCELERATED_TX_BYTES] += nirs->flow_tx_byte_count + nirs->return_tx_byte_count;
-
-	/*
-	 * Update the PPPoE interface stats, if there is any PPPoE session on the interfaces.
-	 */
-	if (nirs->flow_pppoe_session_id) {
-		pppoe_dev = ppp_session_to_netdev(nirs->flow_pppoe_session_id, (uint8_t *)nirs->flow_pppoe_remote_mac);
-		if (pppoe_dev) {
-			ppp_update_stats(pppoe_dev, nirs->flow_rx_packet_count, nirs->flow_rx_byte_count,
-					nirs->flow_tx_packet_count, nirs->flow_tx_byte_count);
-			dev_put(pppoe_dev);
-		}
-	}
-
-	if (nirs->return_pppoe_session_id) {
-		pppoe_dev = ppp_session_to_netdev(nirs->return_pppoe_session_id, (uint8_t *)nirs->return_pppoe_remote_mac);
-		if (pppoe_dev) {
-			ppp_update_stats(pppoe_dev, nirs->return_rx_packet_count, nirs->return_rx_byte_count,
-					nirs->return_tx_packet_count, nirs->return_tx_byte_count);
-			dev_put(pppoe_dev);
-		}
-	}
-
-	/*
-	 * TODO: Update per dev accelerated statistics
-	 */
-
-	spin_unlock_bh(&nss_top->stats_lock);
+	nss_ipv4_driver_conn_sync_update(nss_ctx, nirs);
 }
 
 /*
@@ -161,11 +137,11 @@
 	/*
 	 * Call IPv4 manager callback function
 	 */
-	if (!nss_ctx->nss_top->ipv4_callback) {
+	if (!nss_tx_rx_ipv4_event_callback) {
 		nss_info("%p: IPV4 establish message received before connection manager has registered", nss_ctx);
 		return;
 	}
-	cb = (nss_ipv4_callback_t)nss_ctx->nss_top->ipv4_callback;
+	cb = nss_tx_rx_ipv4_event_callback;
 	cb(&nicp);
 	nss_info("%p: Establish message - Index: %d\n", nss_ctx, nire->index);
 }
@@ -430,7 +406,8 @@
  */
 void *nss_register_ipv4_mgr(nss_ipv4_callback_t event_callback)
 {
-	return (void *)nss_ipv4_notify_register((nss_ipv4_msg_callback_t)event_callback, NULL);
+	nss_tx_rx_ipv4_event_callback = event_callback;
+	return (void *)&nss_top_main.nss[nss_top_main.ipv4_handler_id];
 }
 
 /*
@@ -438,7 +415,7 @@
  */
 void nss_unregister_ipv4_mgr(void)
 {
-	nss_ipv4_notify_unregister();
+	nss_tx_rx_ipv4_event_callback = NULL;
 }
 
 /*
