diff --git a/VERSION b/VERSION
index 13e636e..838c0e7 100755
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.12.10-dev3
+2.12.10-dev4
\ No newline at end of file
diff --git a/cmd/openonu-adapter/main.go b/cmd/openonu-adapter/main.go
index f0d8a76..e298ccc 100644
--- a/cmd/openonu-adapter/main.go
+++ b/cmd/openonu-adapter/main.go
@@ -423,7 +423,7 @@
 			}
 		case <-timeoutTimer.C:
 			// Check the status of the kv-store
-			logger.Info(ctx, "kv-store liveliness-recheck")
+			logger.Debug(ctx, "kv-store liveliness-recheck")
 			if a.kvClient.IsConnectionUp(ctx) {
 				kvStoreChannel <- true
 			} else {
diff --git a/internal/pkg/avcfg/omci_vlan_config.go b/internal/pkg/avcfg/omci_vlan_config.go
index bfe1bc9..9eb4c10 100755
--- a/internal/pkg/avcfg/omci_vlan_config.go
+++ b/internal/pkg/avcfg/omci_vlan_config.go
@@ -43,7 +43,7 @@
 	// internal predefined values
 	cDefaultDownstreamMode = 0
 	cDefaultTpid           = 0x8100
-	cVtfdTableSize         = 12             //as per G.988
+	cVtfdTableSize         = 64             //as per G.988
 	cMaxAllowedFlows       = cVtfdTableSize //which might be under discussion, for the moment connected to limit of VLAN's within VTFD
 )
 
diff --git a/internal/pkg/core/device_handler.go b/internal/pkg/core/device_handler.go
index 02d996f..e5cc1e0 100755
--- a/internal/pkg/core/device_handler.go
+++ b/internal/pkg/core/device_handler.go
@@ -461,13 +461,11 @@
 			}
 			deadline = time.Now().Add(dh.pOpenOnuAc.maxTimeoutInterAdapterComm) //allowed run time to finish before execution
 			dctx2, cancel2 := context.WithDeadline(context.Background(), deadline)
-			pDevEntry.ResetKvProcessingErrorIndication()
-			wg.Add(1) // for the 1 go routine to finish
-			go pDevEntry.UpdateOnuKvStore(log.WithSpanFromContext(dctx2, ctx), &wg)
-			dh.waitForCompletion(ctx, cancel2, &wg, "TechProfDwld") //wait for background process to finish
-			if kvErr := pDevEntry.GetKvProcessingErrorIndication(); kvErr != nil {
-				logger.Errorw(ctx, "error-updating-KV", log.Fields{"device-id": dh.DeviceID, "err": kvErr, "tp-path": techProfMsg.TpInstancePath})
-				return kvErr
+			defer cancel2()
+			err1 := pDevEntry.UpdateOnuKvStore(log.WithSpanFromContext(dctx2, ctx))
+			if err1 != nil {
+				logger.Errorf(ctx, "UpdateOnuKvStore-failed", log.Fields{"device-id": dh.DeviceID, "error": err1})
+				return err
 			}
 			return nil
 		default:
@@ -551,16 +549,14 @@
 	}
 	pDevEntry.FreeTcont(ctx, uint16(delTcontMsg.AllocId))
 
-	var wg sync.WaitGroup
 	deadline := time.Now().Add(dh.pOpenOnuAc.maxTimeoutInterAdapterComm) //allowed run time to finish before execution
 	dctx, cancel := context.WithDeadline(context.Background(), deadline)
-	wg.Add(1)
+	defer cancel()
 	logger.Debugw(ctx, "remove-tcont-in-kv", log.Fields{"device-id": dh.DeviceID, "uni-id": uniID, "tpID": tpID, "tcont": delTcontMsg.AllocId})
-	go pDevEntry.UpdateOnuKvStore(log.WithSpanFromContext(dctx, ctx), &wg)
-	dh.waitForCompletion(ctx, cancel, &wg, "DeleteTcont") //wait for background process to finish
-	if err := pDevEntry.GetKvProcessingErrorIndication(); err != nil {
-		logger.Errorw(ctx, err.Error(), log.Fields{"device-id": dh.DeviceID})
-		return err
+	err1 := pDevEntry.UpdateOnuKvStore(log.WithSpanFromContext(dctx, ctx))
+	if err1 != nil {
+		logger.Errorw(ctx, "UpdateOnuKvStore-failed", log.Fields{"device-id": dh.DeviceID, "err": err1})
+		return err1
 	}
 
 	return dh.deleteTechProfileResource(ctx, uniID, tpID, delTcontMsg.TpInstancePath,
@@ -602,15 +598,13 @@
 		logger.Debugw(ctx, "techProfile-config-cleared", log.Fields{"device-id": dh.DeviceID, "uni-id": uniID, "tpID": tpID})
 		if bTpModify := pDevEntry.UpdateOnuUniTpPath(ctx, uniID, tpID, ""); bTpModify {
 			pDevEntry.ResetKvProcessingErrorIndication()
-			var wg2 sync.WaitGroup
 			dctx2, cancel2 := context.WithDeadline(context.Background(), deadline)
-			wg2.Add(1)
+			defer cancel2()
 			// Removal of the gem id mapping represents the removal of the tech profile
 			logger.Debugw(ctx, "remove-techProfile-indication-in-kv", log.Fields{"device-id": dh.DeviceID, "uni-id": uniID, "tpID": tpID})
-			go pDevEntry.UpdateOnuKvStore(log.WithSpanFromContext(dctx2, ctx), &wg2)
-			dh.waitForCompletion(ctx, cancel2, &wg2, "TechProfileDeleteOn"+resourceName) //wait for background process to finish
-			if err := pDevEntry.GetKvProcessingErrorIndication(); err != nil {
-				logger.Errorw(ctx, err.Error(), log.Fields{"device-id": dh.DeviceID})
+			err := pDevEntry.UpdateOnuKvStore(log.WithSpanFromContext(dctx2, ctx))
+			if err != nil {
+				logger.Errorw(ctx, "UpdateOnuKvStore-failed", log.Fields{"device-id": dh.DeviceID, "err": err})
 				return err
 			}
 		}
@@ -1189,8 +1183,7 @@
 						waitGroup.Done()
 					}
 				} else {
-					logger.Errorw(ctx, "received unexpected UNI flowConfig done indication - is ignored",
-						log.Fields{"device-id": dh.DeviceID, "uni-id": uniIndication})
+					logger.Errorw(ctx, "received unexpected UNI flowConfig done indication - is ignored", log.Fields{"device-id": dh.DeviceID, "uni-id": uniIndication})
 				}
 			} //switch uniIndication
 
@@ -1251,16 +1244,13 @@
 	//20200721: 10s proved to be less in 8*8 ONU test on local vbox machine with debug, might be further adapted
 	deadline := time.Now().Add(dh.pOpenOnuAc.maxTimeoutInterAdapterComm) //allowed run time to finish before execution
 	dctx, cancel := context.WithDeadline(ctx, deadline)
-
-	pDevEntry.ResetKvProcessingErrorIndication()
-
-	var wg sync.WaitGroup
-	wg.Add(1) // for the 1 go routine to finish
-	go pDevEntry.DeleteDataFromOnuKvStore(log.WithSpanFromContext(dctx, ctx), &wg)
-	dh.waitForCompletion(ctx, cancel, &wg, "DeleteDevice") //wait for background process to finish
-
-	// TODO: further actions - stop metrics and FSMs, remove device ...
-	return pDevEntry.GetKvProcessingErrorIndication()
+	defer cancel()
+	err := pDevEntry.DeleteDataFromOnuKvStore(log.WithSpanFromContext(dctx, ctx))
+	if err != nil {
+		logger.Errorw(ctx, "delete data from onu kv store failed", log.Fields{"device-id": dh.DeviceID, "err": err})
+		return err
+	}
+	return nil
 }
 
 // func (dh *deviceHandler) rebootDevice(ctx context.Context, device *voltha.Device) error {
@@ -3604,15 +3594,14 @@
 	//20200721: 10s proved to be less in 8*8 ONU test on local vbox machine with debug, might be further adapted
 	deadline := time.Now().Add(dh.pOpenOnuAc.maxTimeoutInterAdapterComm) //allowed run time to finish before execution
 	dctx, cancel := context.WithDeadline(context.Background(), deadline)
+	defer cancel() // Ensure cancel is called to release resources
 
-	aPDevEntry.ResetKvProcessingErrorIndication()
-	var wg sync.WaitGroup
-	wg.Add(1) // for the 1 go routine to finish
-
-	go aPDevEntry.UpdateOnuKvStore(log.WithSpanFromContext(dctx, ctx), &wg)
-	dh.waitForCompletion(ctx, cancel, &wg, "UpdateKvStore") //wait for background process to finish
-
-	return aPDevEntry.GetKvProcessingErrorIndication()
+	err := aPDevEntry.UpdateOnuKvStore(log.WithSpanFromContext(dctx, ctx))
+	if err != nil {
+		logger.Errorw(ctx, "UpdateOnuKvStore-failed", log.Fields{"device-id": dh.DeviceID})
+		return err
+	}
+	return nil
 }
 
 // StorePersUniFlowConfig updates local storage of OnuUniFlowConfig and writes it into kv-store afterwards to have it
diff --git a/internal/pkg/mib/onu_device_entry.go b/internal/pkg/mib/onu_device_entry.go
index 1b7303a..6398e0a 100755
--- a/internal/pkg/mib/onu_device_entry.go
+++ b/internal/pkg/mib/onu_device_entry.go
@@ -189,7 +189,6 @@
 	onuKVStorePath             string
 	mutexOnuKVStoreProcResult  sync.RWMutex
 	onuKVStoreProcResult       error //error indication of processing
-	chOnuKvProcessingStep      chan uint8
 	mutexOnuSwImageIndications sync.RWMutex
 	onuSwImageIndications      cmn.SswImageIndications
 	MutexOnuImageStatus        sync.RWMutex
@@ -237,7 +236,6 @@
 	onuDeviceEntry.ReconciledTpInstances = make(map[uint8]map[uint8]inter_adapter.TechProfileDownloadMessage)
 	onuDeviceEntry.chReconcilingFlowsFinished = make(chan bool)
 	onuDeviceEntry.reconcilingFlows = false
-	onuDeviceEntry.chOnuKvProcessingStep = make(chan uint8)
 	onuDeviceEntry.omciRebootMessageReceivedChannel = make(chan cmn.Message, 2)
 	//openomciagent.lockDeviceHandlersMap = sync.RWMutex{}
 	//OMCI related databases are on a per-agent basis. State machines and tasks
@@ -573,28 +571,23 @@
 }
 
 // DeleteDataFromOnuKvStore - TODO: add comment
-func (oo *OnuDeviceEntry) DeleteDataFromOnuKvStore(ctx context.Context, wg *sync.WaitGroup) {
-	defer wg.Done()
+func (oo *OnuDeviceEntry) DeleteDataFromOnuKvStore(ctx context.Context) error {
 
 	if oo.onuKVStore == nil {
 		logger.Debugw(ctx, "onuKVStore not set - abort", log.Fields{"device-id": oo.deviceID})
-		oo.setKvProcessingErrorIndication(errors.New("onu-data delete aborted: onuKVStore not set"))
-		return
+		return errors.New("onu-data delete aborted: onuKVStore not set")
 	}
-	var processingStep uint8 = 1 // used to synchronize the different processing steps with chOnuKvProcessingStep
-	go oo.deletePersistentData(ctx, processingStep)
-	if !oo.waitForTimeoutOrCompletion(ctx, oo.chOnuKvProcessingStep, processingStep) {
-		//timeout or error detected
-		logger.Debugw(ctx, "ONU-data not deleted - abort", log.Fields{"device-id": oo.deviceID})
-		oo.setKvProcessingErrorIndication(errors.New("onu-data delete aborted: during kv-access"))
-		return
+	err := oo.deletePersistentData(ctx)
+	if err != nil {
+		logger.Errorf(ctx, "onu-data delete aborted: during kv-access", log.Fields{"device-id": oo.deviceID, "err": err})
+		return err
 	}
+	return nil
 }
 
-func (oo *OnuDeviceEntry) deletePersistentData(ctx context.Context, aProcessingStep uint8) {
+func (oo *OnuDeviceEntry) deletePersistentData(ctx context.Context) error {
 
 	logger.Debugw(ctx, "delete and clear internal persistency data", log.Fields{"device-id": oo.deviceID})
-
 	oo.MutexPersOnuConfig.Lock()
 	defer oo.MutexPersOnuConfig.Unlock()
 
@@ -608,32 +601,27 @@
 	oo.mutexOnuKVStore.Unlock()
 	if err != nil {
 		logger.Errorw(ctx, "unable to delete in KVstore", log.Fields{"device-id": oo.deviceID, "err": err})
-		oo.chOnuKvProcessingStep <- 0 //error indication
-		return
+		return err
 	}
-	oo.chOnuKvProcessingStep <- aProcessingStep //done
+	return nil
 }
 
 // UpdateOnuKvStore - TODO: add comment
-func (oo *OnuDeviceEntry) UpdateOnuKvStore(ctx context.Context, wg *sync.WaitGroup) {
-	defer wg.Done()
+func (oo *OnuDeviceEntry) UpdateOnuKvStore(ctx context.Context) error {
 
 	if oo.onuKVStore == nil {
 		logger.Debugw(ctx, "onuKVStore not set - abort", log.Fields{"device-id": oo.deviceID})
-		oo.setKvProcessingErrorIndication(errors.New("onu-data update aborted: onuKVStore not set"))
-		return
+		return errors.New("onu-data update aborted: onuKVStore not set")
 	}
-	var processingStep uint8 = 1 // used to synchronize the different processing steps with chOnuKvProcessingStep
-	go oo.storeDataInOnuKvStore(ctx, processingStep)
-	if !oo.waitForTimeoutOrCompletion(ctx, oo.chOnuKvProcessingStep, processingStep) {
-		//timeout or error detected
-		logger.Debugw(ctx, "ONU-data not written - abort", log.Fields{"device-id": oo.deviceID})
-		oo.setKvProcessingErrorIndication(errors.New("onu-data update aborted: during writing process"))
-		return
+	err := oo.storeDataInOnuKvStore(ctx)
+	if err != nil {
+		logger.Errorf(ctx, "onu-data update aborted: during writing process", log.Fields{"device-id": oo.deviceID, "err": err})
+		return err
 	}
+	return nil
 }
 
-func (oo *OnuDeviceEntry) storeDataInOnuKvStore(ctx context.Context, aProcessingStep uint8) {
+func (oo *OnuDeviceEntry) storeDataInOnuKvStore(ctx context.Context) error {
 
 	oo.MutexPersOnuConfig.Lock()
 	defer oo.MutexPersOnuConfig.Unlock()
@@ -641,17 +629,15 @@
 	oo.pOpenOnuAc.RLockMutexDeviceHandlersMap()
 	if _, exist := oo.pOpenOnuAc.GetDeviceHandler(oo.deviceID); !exist {
 		logger.Debugw(ctx, "delete_device in progress - skip write request", log.Fields{"device-id": oo.deviceID})
-		oo.chOnuKvProcessingStep <- aProcessingStep
 		oo.pOpenOnuAc.RUnlockMutexDeviceHandlersMap()
-		return
+		return nil
 	}
 	oo.baseDeviceHandler.RLockMutexDeletionInProgressFlag()
 	if oo.baseDeviceHandler.GetDeletionInProgress() {
 		logger.Debugw(ctx, "delete_device in progress - skip write request", log.Fields{"device-id": oo.deviceID})
-		oo.chOnuKvProcessingStep <- aProcessingStep
 		oo.pOpenOnuAc.RUnlockMutexDeviceHandlersMap()
 		oo.baseDeviceHandler.RUnlockMutexDeletionInProgressFlag()
-		return
+		return nil
 	}
 	oo.pOpenOnuAc.RUnlockMutexDeviceHandlersMap()
 	oo.baseDeviceHandler.RUnlockMutexDeletionInProgressFlag()
@@ -666,8 +652,7 @@
 		oo.SOnuPersistentData.PersOperState = onuIndication.OperState
 	} else {
 		logger.Errorw(ctx, "onuIndication not set, unable to load ONU-data", log.Fields{"device-id": oo.deviceID})
-		oo.chOnuKvProcessingStep <- 0 //error indication
-		return
+		return errors.New("onuIndication not set, unable to load ONU-data")
 	}
 
 	logger.Debugw(ctx, "Update ONU-data in KVStore", log.Fields{"device-id": oo.deviceID, "SOnuPersistentData": oo.SOnuPersistentData})
@@ -676,19 +661,17 @@
 	if err != nil {
 		logger.Errorw(ctx, "unable to marshal ONU-data", log.Fields{"SOnuPersistentData": oo.SOnuPersistentData,
 			"device-id": oo.deviceID, "err": err})
-		oo.chOnuKvProcessingStep <- 0 //error indication
-		return
+		return err
 	}
 
 	oo.mutexOnuKVStore.Lock()
 	err = oo.onuKVStore.Put(ctx, oo.onuKVStorePath, Value)
 	oo.mutexOnuKVStore.Unlock()
 	if err != nil {
-		logger.Errorw(ctx, "unable to write ONU-data into KVstore", log.Fields{"device-id": oo.deviceID, "err": err})
-		oo.chOnuKvProcessingStep <- 0 //error indication
-		return
+		logger.Errorf(ctx, "unable to write ONU-data into KVstore", log.Fields{"device-id": oo.deviceID, "err": err})
+		return err
 	}
-	oo.chOnuKvProcessingStep <- aProcessingStep //done
+	return nil
 }
 
 // UpdateOnuUniTpPath - TODO: add comment
@@ -785,25 +768,6 @@
 	oo.SOnuPersistentData.PersUniConfig = append(oo.SOnuPersistentData.PersUniConfig, tmpConfig)
 }
 
-func (oo *OnuDeviceEntry) waitForTimeoutOrCompletion(
-	ctx context.Context, aChOnuProcessingStep <-chan uint8, aProcessingStep uint8) bool {
-	select {
-	case <-ctx.Done():
-		logger.Warnw(ctx, "processing not completed in-time!",
-			log.Fields{"device-id": oo.deviceID, "error": ctx.Err()})
-		return false
-	case rxStep := <-aChOnuProcessingStep:
-		if rxStep == aProcessingStep {
-			return true
-		}
-		//all other values are not accepted - including 0 for error indication
-		logger.Warnw(ctx, "Invalid processing step received: abort!",
-			log.Fields{"device-id": oo.deviceID,
-				"wantedStep": aProcessingStep, "haveStep": rxStep})
-		return false
-	}
-}
-
 // ResetKvProcessingErrorIndication - TODO: add comment
 func (oo *OnuDeviceEntry) ResetKvProcessingErrorIndication() {
 	oo.mutexOnuKVStoreProcResult.Lock()
@@ -819,11 +783,11 @@
 	return value
 }
 
-func (oo *OnuDeviceEntry) setKvProcessingErrorIndication(value error) {
-	oo.mutexOnuKVStoreProcResult.Lock()
-	oo.onuKVStoreProcResult = value
-	oo.mutexOnuKVStoreProcResult.Unlock()
-}
+// func (oo *OnuDeviceEntry) setKvProcessingErrorIndication(value error) {
+// 	oo.mutexOnuKVStoreProcResult.Lock()
+// 	oo.onuKVStoreProcResult = value
+// 	oo.mutexOnuKVStoreProcResult.Unlock()
+// }
 
 // IncrementMibDataSync - TODO: add comment
 func (oo *OnuDeviceEntry) IncrementMibDataSync(ctx context.Context) {
