diff --git a/VERSION b/VERSION
index 2add3a1..ed941c2 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.12-dev130
+0.1.12-dev131
diff --git a/internal/pkg/onuadaptercore/device_handler.go b/internal/pkg/onuadaptercore/device_handler.go
index f7dad9a..9e98452 100644
--- a/internal/pkg/onuadaptercore/device_handler.go
+++ b/internal/pkg/onuadaptercore/device_handler.go
@@ -237,7 +237,7 @@
 		return pDevEntry.PDevOmciCC.receiveMessage(context.TODO(), omciMsg.Message)
 	}
 	logger.Errorw("No valid OnuDevice -aborting", log.Fields{"device-id": dh.deviceID})
-	return errors.New("no valid OnuDevice")
+	return fmt.Errorf("no valid OnuDevice: %s", dh.deviceID)
 }
 
 func (dh *deviceHandler) processInterAdapterONUIndReqMessage(msg *ic.InterAdapterMessage) error {
@@ -261,23 +261,29 @@
 		_ = dh.updateInterface(onuIndication)
 	} else {
 		logger.Errorw("unknown-onu-indication operState", log.Fields{"OnuId": onuIndication.GetOnuId()})
-		return errors.New("invalidOperState")
+		return fmt.Errorf("invalidOperState: %s, %s", onuOperstate, dh.deviceID)
 	}
 	return nil
 }
 
 func (dh *deviceHandler) processInterAdapterTechProfileDownloadReqMessage(
 	msg *ic.InterAdapterMessage) error {
+
+	pDevEntry := dh.getOnuDeviceEntry(true)
+	if pDevEntry == nil {
+		logger.Errorw("No valid OnuDevice - aborting", log.Fields{"device-id": dh.deviceID})
+		return fmt.Errorf("no valid OnuDevice: %s", dh.deviceID)
+	}
 	if dh.pOnuTP == nil {
 		//should normally not happen ...
 		logger.Warnw("onuTechProf instance not set up for DLMsg request - ignoring request",
 			log.Fields{"device-id": dh.deviceID})
-		return errors.New("techProfile DLMsg request while onuTechProf instance not setup")
+		return fmt.Errorf("techProfile DLMsg request while onuTechProf instance not setup: %s", dh.deviceID)
 	}
 	if (dh.deviceReason == "stopping-openomci") || (dh.deviceReason == "omci-admin-lock") {
 		// I've seen cases for this request, where the device was already stopped
 		logger.Warnw("TechProf stopped: device-unreachable", log.Fields{"device-id": dh.deviceID})
-		return errors.New("device-unreachable")
+		return fmt.Errorf("device-unreachable: %s", dh.deviceID)
 	}
 
 	msgBody := msg.GetBody()
@@ -289,10 +295,20 @@
 	}
 
 	// we have to lock access to TechProfile processing based on different messageType calls or
-	// even to fast subsequent calls of the same messageType
+	// even to fast subsequent calls of the same messageType as well as OnuKVStore processing due
+	// to possible concurrent access by flow processing
 	dh.pOnuTP.lockTpProcMutex()
-	// lock hangs as long as below decoupled or other related TechProfile processing is active
-	if bTpModify := dh.pOnuTP.updateOnuUniTpPath(techProfMsg.UniId, techProfMsg.Path); bTpModify {
+	defer dh.pOnuTP.unlockTpProcMutex()
+	pDevEntry.lockOnuKVStoreMutex()
+	defer pDevEntry.unlockOnuKVStoreMutex()
+
+	if techProfMsg.UniId > 255 {
+		return fmt.Errorf(fmt.Sprintf("received UniId value exceeds range: %d, device-id: %s",
+			techProfMsg.UniId, dh.deviceID))
+	}
+	uniID := uint8(techProfMsg.UniId)
+
+	if bTpModify := pDevEntry.updateOnuUniTpPath(uniID, techProfMsg.Path); bTpModify {
 		//	if there has been some change for some uni TechProfilePath
 		//in order to allow concurrent calls to other dh instances we do not wait for execution here
 		//but doing so we can not indicate problems to the caller (who does what with that then?)
@@ -305,30 +321,35 @@
 		deadline := time.Now().Add(30 * time.Second) //allowed run time to finish before execution
 		dctx, cancel := context.WithDeadline(context.Background(), deadline)
 
-		dh.pOnuTP.resetProcessingErrorIndication()
+		dh.pOnuTP.resetTpProcessingErrorIndication()
+		pDevEntry.resetKvProcessingErrorIndication()
+
 		var wg sync.WaitGroup
 		wg.Add(2) // for the 2 go routines to finish
 		// attention: deadline completion check and wg.Done is to be done in both routines
-		go dh.pOnuTP.configureUniTp(dctx, uint8(techProfMsg.UniId), techProfMsg.Path, &wg)
-		go dh.pOnuTP.updateOnuTpPathKvStore(dctx, &wg)
-		//the wait.. function is responsible for tpProcMutex.Unlock()
-		err := dh.pOnuTP.waitForTpCompletion(cancel, &wg) //wait for background process to finish and collect their result
-		return err
+		go dh.pOnuTP.configureUniTp(dctx, uniID, techProfMsg.Path, &wg)
+		go pDevEntry.updateOnuKvStore(dctx, &wg)
+		dh.waitForCompletion(cancel, &wg) //wait for background process to finish
+
+		return dh.combineErrorStrings(dh.pOnuTP.getTpProcessingErrorIndication(), pDevEntry.getKvProcessingErrorIndication())
 	}
-	// no change, nothing really to do
-	dh.pOnuTP.unlockTpProcMutex()
-	//return success
+	// no change, nothing really to do - return success
 	return nil
 }
 
 func (dh *deviceHandler) processInterAdapterDeleteGemPortReqMessage(
 	msg *ic.InterAdapterMessage) error {
 
+	pDevEntry := dh.getOnuDeviceEntry(true)
+	if pDevEntry == nil {
+		logger.Errorw("No valid OnuDevice - aborting", log.Fields{"device-id": dh.deviceID})
+		return fmt.Errorf("no valid OnuDevice: %s", dh.deviceID)
+	}
 	if dh.pOnuTP == nil {
 		//should normally not happen ...
 		logger.Warnw("onuTechProf instance not set up for DelGem request - ignoring request",
 			log.Fields{"device-id": dh.deviceID})
-		return errors.New("techProfile DelGem request while onuTechProf instance not setup")
+		return fmt.Errorf("techProfile DelGem request while onuTechProf instance not setup: %s", dh.deviceID)
 	}
 
 	msgBody := msg.GetBody()
@@ -341,28 +362,50 @@
 
 	//compare TECH_PROFILE_DOWNLOAD_REQUEST
 	dh.pOnuTP.lockTpProcMutex()
+	defer dh.pOnuTP.unlockTpProcMutex()
+	pDevEntry.lockOnuKVStoreMutex()
+	defer pDevEntry.unlockOnuKVStoreMutex()
 
-	// deadline context to ensure completion of background routines waited for
-	deadline := time.Now().Add(10 * time.Second) //allowed run time to finish before execution
-	dctx, cancel := context.WithDeadline(context.Background(), deadline)
+	if delGemPortMsg.UniId > 255 {
+		return fmt.Errorf(fmt.Sprintf("received UniId value exceeds range: %d, device-id: %s",
+			delGemPortMsg.UniId, dh.deviceID))
+	}
+	uniID := uint8(delGemPortMsg.UniId)
 
-	dh.pOnuTP.resetProcessingErrorIndication()
-	var wg sync.WaitGroup
-	wg.Add(1) // for the 1 go routine to finish
-	go dh.pOnuTP.deleteTpResource(dctx, delGemPortMsg.UniId, delGemPortMsg.TpPath,
-		cResourceGemPort, delGemPortMsg.GemPortId, &wg)
-	//the wait.. function is responsible for tpProcMutex.Unlock()
-	err := dh.pOnuTP.waitForTpCompletion(cancel, &wg) //let that also run off-line to let the IA messaging return!
-	return err
+	if bTpModify := pDevEntry.updateOnuUniTpPath(uniID, ""); bTpModify {
+		// deadline context to ensure completion of background routines waited for
+		deadline := time.Now().Add(10 * time.Second) //allowed run time to finish before execution
+		dctx, cancel := context.WithDeadline(context.Background(), deadline)
+
+		dh.pOnuTP.resetTpProcessingErrorIndication()
+		pDevEntry.resetKvProcessingErrorIndication()
+
+		var wg sync.WaitGroup
+		wg.Add(2) // for the 2 go routines to finish
+		go pDevEntry.deleteTpResource(dctx, uniID, delGemPortMsg.TpPath,
+			cResourceGemPort, delGemPortMsg.GemPortId, &wg)
+		// Removal of the tcont/alloc id mapping represents the removal of the tech profile
+		go pDevEntry.updateOnuKvStore(dctx, &wg)
+		dh.waitForCompletion(cancel, &wg) //wait for background process to finish
+
+		return dh.combineErrorStrings(dh.pOnuTP.getTpProcessingErrorIndication(), pDevEntry.getKvProcessingErrorIndication())
+	}
+	return nil
 }
 
 func (dh *deviceHandler) processInterAdapterDeleteTcontReqMessage(
 	msg *ic.InterAdapterMessage) error {
+
+	pDevEntry := dh.getOnuDeviceEntry(true)
+	if pDevEntry == nil {
+		logger.Errorw("No valid OnuDevice - aborting", log.Fields{"device-id": dh.deviceID})
+		return fmt.Errorf("no valid OnuDevice: %s", dh.deviceID)
+	}
 	if dh.pOnuTP == nil {
 		//should normally not happen ...
 		logger.Warnw("onuTechProf instance not set up for DelTcont request - ignoring request",
 			log.Fields{"device-id": dh.deviceID})
-		return errors.New("techProfile DelTcont request while onuTechProf instance not setup")
+		return fmt.Errorf("techProfile DelTcont request while onuTechProf instance not setup: %s", dh.deviceID)
 	}
 
 	msgBody := msg.GetBody()
@@ -375,24 +418,34 @@
 
 	//compare TECH_PROFILE_DOWNLOAD_REQUEST
 	dh.pOnuTP.lockTpProcMutex()
-	if bTpModify := dh.pOnuTP.updateOnuUniTpPath(delTcontMsg.UniId, ""); bTpModify {
+	defer dh.pOnuTP.unlockTpProcMutex()
+	pDevEntry.lockOnuKVStoreMutex()
+	defer pDevEntry.unlockOnuKVStoreMutex()
+
+	if delTcontMsg.UniId > 255 {
+		return fmt.Errorf(fmt.Sprintf("received UniId value exceeds range: %d, device-id: %s",
+			delTcontMsg.UniId, dh.deviceID))
+	}
+	uniID := uint8(delTcontMsg.UniId)
+
+	if bTpModify := pDevEntry.updateOnuUniTpPath(uniID, ""); bTpModify {
 		// deadline context to ensure completion of background routines waited for
 		deadline := time.Now().Add(10 * time.Second) //allowed run time to finish before execution
 		dctx, cancel := context.WithDeadline(context.Background(), deadline)
 
-		dh.pOnuTP.resetProcessingErrorIndication()
+		dh.pOnuTP.resetTpProcessingErrorIndication()
+		pDevEntry.resetKvProcessingErrorIndication()
+
 		var wg sync.WaitGroup
 		wg.Add(2) // for the 2 go routines to finish
-		go dh.pOnuTP.deleteTpResource(dctx, delTcontMsg.UniId, delTcontMsg.TpPath,
+		go pDevEntry.deleteTpResource(dctx, uniID, delTcontMsg.TpPath,
 			cResourceTcont, delTcontMsg.AllocId, &wg)
 		// Removal of the tcont/alloc id mapping represents the removal of the tech profile
-		go dh.pOnuTP.updateOnuTpPathKvStore(dctx, &wg)
-		//the wait.. function is responsible for tpProcMutex.Unlock()
-		err := dh.pOnuTP.waitForTpCompletion(cancel, &wg) //let that also run off-line to let the IA messaging return!
-		return err
+		go pDevEntry.updateOnuKvStore(dctx, &wg)
+		dh.waitForCompletion(cancel, &wg) //wait for background process to finish
+
+		return dh.combineErrorStrings(dh.pOnuTP.getTpProcessingErrorIndication(), pDevEntry.getKvProcessingErrorIndication())
 	}
-	dh.pOnuTP.unlockTpProcMutex()
-	//return success
 	return nil
 }
 
@@ -434,8 +487,8 @@
 	default:
 		{
 			logger.Errorw("inter-adapter-unhandled-type", log.Fields{
-				"device-id": dh.deviceID, "msgType": msg.Header.Type})
-			return errors.New("unimplemented")
+				"msgType": msg.Header.Type, "device-id": dh.deviceID})
+			return fmt.Errorf("inter-adapter-unhandled-type: %d, %s", msg.Header.Type, dh.deviceID)
 		}
 	}
 }
@@ -461,7 +514,7 @@
 			flowInPort := flow.GetInPort(flowItem)
 			if flowInPort == uint32(of.OfpPortNo_OFPP_INVALID) {
 				logger.Errorw("flow inPort invalid", log.Fields{"deviceID": dh.deviceID})
-				return errors.New("flow inPort invalid")
+				return fmt.Errorf("flow inPort invalid: %s", dh.deviceID)
 			} else if flowInPort == dh.ponPortNumber {
 				//this is some downstream flow
 				logger.Debugw("incremental flow ignore downstream", log.Fields{
@@ -557,64 +610,127 @@
 func (dh *deviceHandler) reconcileDeviceOnuInd() {
 	logger.Debugw("reconciling - simulate onu indication", log.Fields{"device-id": dh.deviceID})
 
-	if err := dh.pOnuTP.restoreFromOnuTpPathKvStore(context.TODO()); err != nil {
+	pDevEntry := dh.getOnuDeviceEntry(true)
+	if pDevEntry == nil {
+		logger.Errorw("No valid OnuDevice - aborting", log.Fields{"device-id": dh.deviceID})
+		return
+	}
+	if err := pDevEntry.restoreDataFromOnuKvStore(context.TODO()); err != nil {
 		logger.Errorw("reconciling - restoring OnuTp-data failed - abort", log.Fields{"err": err, "device-id": dh.deviceID})
 		dh.reconciling = false
 		return
 	}
 	var onuIndication oop.OnuIndication
-	onuIndication.IntfId = dh.pOnuTP.sOnuPersistentData.PersIntfID
-	onuIndication.OnuId = dh.pOnuTP.sOnuPersistentData.PersOnuID
-	onuIndication.OperState = dh.pOnuTP.sOnuPersistentData.PersOperState
-	onuIndication.AdminState = dh.pOnuTP.sOnuPersistentData.PersAdminState
+	onuIndication.IntfId = pDevEntry.sOnuPersistentData.PersIntfID
+	onuIndication.OnuId = pDevEntry.sOnuPersistentData.PersOnuID
+	onuIndication.OperState = pDevEntry.sOnuPersistentData.PersOperState
+	onuIndication.AdminState = pDevEntry.sOnuPersistentData.PersAdminState
 	_ = dh.createInterface(&onuIndication)
 }
 
 func (dh *deviceHandler) reconcileDeviceTechProf() {
 	logger.Debugw("reconciling - trigger tech profile config", log.Fields{"device-id": dh.deviceID})
 
-	dh.pOnuTP.lockTpProcMutex()
-	// lock hangs as long as below decoupled or other related TechProfile processing is active
-	for _, uniData := range dh.pOnuTP.sOnuPersistentData.PersUniTpPath {
-		//In order to allow concurrent calls to other dh instances we do not wait for execution here
-		//but doing so we can not indicate problems to the caller (who does what with that then?)
-		//by now we just assume straightforward successful execution
-		//TODO!!! Generally: In this scheme it would be good to have some means to indicate
-		//  possible problems to the caller later autonomously
+	pDevEntry := dh.getOnuDeviceEntry(true)
+	if pDevEntry == nil {
+		logger.Errorw("No valid OnuDevice - aborting", log.Fields{"device-id": dh.deviceID})
+		return
+	}
 
+	dh.pOnuTP.lockTpProcMutex()
+	defer dh.pOnuTP.unlockTpProcMutex()
+
+	for _, uniData := range pDevEntry.sOnuPersistentData.PersUniConfig {
 		// deadline context to ensure completion of background routines waited for
 		//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(30 * time.Second) //allowed run time to finish before execution
 		dctx, cancel := context.WithDeadline(context.Background(), deadline)
 
-		dh.pOnuTP.resetProcessingErrorIndication()
+		dh.pOnuTP.resetTpProcessingErrorIndication()
+
 		var wg sync.WaitGroup
-		wg.Add(1) // for the 1 go routines to finish
-		// attention: deadline completion check and wg.Done is to be done in both routines
-		go dh.pOnuTP.configureUniTp(dctx, uint8(uniData.PersUniID), uniData.PersTpPath, &wg)
-		//the wait.. function is responsible for tpProcMutex.Unlock()
-		_ = dh.pOnuTP.waitForTpCompletion(cancel, &wg) //wait for background process to finish and collect their result
+		wg.Add(1) // for the 1 go routine to finish
+		go dh.pOnuTP.configureUniTp(dctx, uniData.PersUniID, uniData.PersTpPath, &wg)
+		dh.waitForCompletion(cancel, &wg) //wait for background process to finish
+
+		if err := dh.pOnuTP.getTpProcessingErrorIndication(); err != nil {
+			logger.Errorw(err.Error(), log.Fields{"device-id": dh.deviceID})
+		}
+	}
+}
+
+func (dh *deviceHandler) reconcileDeviceFlowConfig() {
+	logger.Debugw("reconciling - trigger flow config", log.Fields{"device-id": dh.deviceID})
+
+	pDevEntry := dh.getOnuDeviceEntry(true)
+	if pDevEntry == nil {
+		logger.Errorw("No valid OnuDevice - aborting", log.Fields{"device-id": dh.deviceID})
 		return
 	}
-	dh.pOnuTP.unlockTpProcMutex()
-	//TODO: reset of reconciling-flag has always to be done in the last ReconcileDevice*() function
+	for _, uniData := range pDevEntry.sOnuPersistentData.PersUniConfig {
+		var uniPort *onuUniPort
+		var exist bool
+		uniNo := mkUniPortNum(dh.pOnuIndication.GetIntfId(), dh.pOnuIndication.GetOnuId(), uint32(uniData.PersUniID))
+		if uniPort, exist = dh.uniEntityMap[uniNo]; !exist {
+			logger.Errorw("onuUniPort data not found!", log.Fields{"uniNo": uniNo, "deviceID": dh.deviceID})
+			return
+		}
+		for _, flowData := range uniData.PersFlowParams {
+			if _, exist = dh.UniVlanConfigFsmMap[uniData.PersUniID]; exist {
+				if err := dh.UniVlanConfigFsmMap[uniData.PersUniID].SetUniFlowParams(flowData.TpID, uint16(flowData.MatchVid),
+					uint16(flowData.SetVid), uint8(flowData.SetPcp)); err != nil {
+					logger.Errorw(err.Error(), log.Fields{"device-id": dh.deviceID})
+				}
+
+			} else {
+				if err := dh.createVlanFilterFsm(uniPort, flowData.TpID, uint16(flowData.MatchVid), uint16(flowData.SetVid),
+					uint8(flowData.SetPcp), OmciVlanFilterDone); err != nil {
+					logger.Errorw(err.Error(), log.Fields{"device-id": dh.deviceID})
+				}
+			}
+		}
+	}
+}
+
+func (dh *deviceHandler) reconcileMetrics() {
+	logger.Debugw("reconciling - trigger metrics - to be implemented in scope of VOL-3324!", log.Fields{"device-id": dh.deviceID})
+
+	//TODO: reset of reconciling-flag has always to be done in the last reconcile*() function
 	dh.reconciling = false
 }
 
 func (dh *deviceHandler) deleteDevice(device *voltha.Device) error {
 	logger.Debugw("delete-device", log.Fields{"device-id": device.Id, "SerialNumber": device.SerialNumber})
-	if err := dh.pOnuTP.deleteOnuTpPathKvStore(context.TODO()); err != nil {
-		return err
+
+	pDevEntry := dh.getOnuDeviceEntry(true)
+	if pDevEntry == nil {
+		logger.Errorw("No valid OnuDevice - aborting", log.Fields{"device-id": dh.deviceID})
+		return fmt.Errorf("no valid OnuDevice: %s", dh.deviceID)
 	}
+	pDevEntry.lockOnuKVStoreMutex()
+	defer pDevEntry.unlockOnuKVStoreMutex()
+
+	// deadline context to ensure completion of background routines waited for
+	//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(30 * time.Second) //allowed run time to finish before execution
+	dctx, cancel := context.WithDeadline(context.Background(), deadline)
+
+	pDevEntry.resetKvProcessingErrorIndication()
+
+	var wg sync.WaitGroup
+	wg.Add(1) // for the 1 go routine to finish
+	go pDevEntry.deleteDataFromOnuKvStore(dctx, &wg)
+	dh.waitForCompletion(cancel, &wg) //wait for background process to finish
+
 	// TODO: further actions - stop metrics and FSMs, remove device ...
-	return nil
+	return pDevEntry.getKvProcessingErrorIndication()
 }
 
 func (dh *deviceHandler) rebootDevice(device *voltha.Device) error {
 	logger.Debugw("reboot-device", log.Fields{"device-id": device.Id, "SerialNumber": device.SerialNumber})
 	if device.ConnectStatus != voltha.ConnectStatus_REACHABLE {
 		logger.Errorw("device-unreachable", log.Fields{"device-id": device.Id, "SerialNumber": device.SerialNumber})
-		return errors.New("device-unreachable")
+		return fmt.Errorf("device-unreachable: %s, %s", dh.deviceID, device.SerialNumber)
 	}
 	if err := dh.pOnuOmciDevice.reboot(context.TODO()); err != nil {
 		//TODO with VOL-3045/VOL-3046: return the error and stop further processing
@@ -879,7 +995,7 @@
 // ###################################################
 // deviceHandler utility methods ##### begin #########
 
-//getOnuDeviceEntry getsthe  ONU device entry and may wait until its value is defined
+//getOnuDeviceEntry gets the ONU device entry and may wait until its value is defined
 func (dh *deviceHandler) getOnuDeviceEntry(aWait bool) *OnuDeviceEntry {
 	dh.lockDevice.RLock()
 	pOnuDeviceEntry := dh.pOnuOmciDevice
@@ -977,7 +1093,7 @@
 		}
 	} else {
 		logger.Errorw("No valid OnuDevice -aborting", log.Fields{"device-id": dh.deviceID})
-		return errors.New("no valid OnuDevice")
+		return fmt.Errorf("no valid OnuDevice: %s", dh.deviceID)
 	}
 	if !dh.reconciling {
 		if err := dh.coreProxy.DeviceReasonUpdate(context.TODO(), dh.deviceID, "starting-openomci"); err != nil {
@@ -1091,7 +1207,7 @@
 		if pMibUlFsm.Is(ulStDisabled) {
 			if err := pMibUlFsm.Event(ulEvStart); err != nil {
 				logger.Errorw("MibSyncFsm: Can't go to state starting", log.Fields{"err": err})
-				return errors.New("can't go to state starting")
+				return fmt.Errorf("can't go to state starting: %s", dh.deviceID)
 			}
 			logger.Debugw("MibSyncFsm", log.Fields{"state": string(pMibUlFsm.Current())})
 			//Determine ONU status and start/re-start MIB Synchronization tasks
@@ -1099,12 +1215,12 @@
 			if true { //TODO: insert valid check
 				if err := pMibUlFsm.Event(ulEvResetMib); err != nil {
 					logger.Errorw("MibSyncFsm: Can't go to state resetting_mib", log.Fields{"err": err})
-					return errors.New("can't go to state resetting_mib")
+					return fmt.Errorf("can't go to state resetting_mib: %s", dh.deviceID)
 				}
 			} else {
 				if err := pMibUlFsm.Event(ulEvExamineMds); err != nil {
 					logger.Errorw("MibSyncFsm: Can't go to state examine_mds", log.Fields{"err": err})
-					return errors.New("can't go to examine_mds")
+					return fmt.Errorf("can't go to examine_mds: %s", dh.deviceID)
 				}
 				logger.Debugw("state of MibSyncFsm", log.Fields{"state": string(pMibUlFsm.Current())})
 				//Examine the MIB Data Sync
@@ -1115,11 +1231,11 @@
 			}
 		} else {
 			logger.Errorw("wrong state of MibSyncFsm - want: disabled", log.Fields{"have": string(pMibUlFsm.Current())})
-			return errors.New("wrong state of MibSyncFsm")
+			return fmt.Errorf("wrong state of MibSyncFsm: %s", dh.deviceID)
 		}
 	} else {
 		logger.Errorw("MibSyncFsm invalid - cannot be executed!!", log.Fields{"device-id": dh.deviceID})
-		return errors.New("cannot execut MibSync")
+		return fmt.Errorf("can't execute MibSync: %s", dh.deviceID)
 	}
 	return nil
 }
@@ -1132,7 +1248,7 @@
 		pDevEntry := dh.getOnuDeviceEntry(false)
 		if pDevEntry == nil {
 			logger.Errorw("No valid OnuDevice -aborting", log.Fields{"device-id": dh.deviceID})
-			return errors.New("no valid OnuDevice")
+			return fmt.Errorf("no valid OnuDevice: %s", dh.deviceID)
 		}
 
 		switch dh.deviceReason {
@@ -1361,7 +1477,7 @@
 		logger.Debugw("reconciling - don't notify core that onu went to active but trigger tech profile config",
 			log.Fields{"device-id": dh.deviceID})
 		go dh.reconcileDeviceTechProf()
-		//TODO: further actions e.g. restore flows, metrics, ...
+		// reconcilement will be continued after ani config is done
 	}
 }
 
@@ -1387,6 +1503,9 @@
 		//set internal state anyway - as it was done
 		dh.deviceReason = "tech-profile-config-download-success"
 	}
+	if dh.reconciling {
+		go dh.reconcileDeviceFlowConfig()
+	}
 }
 
 func (dh *deviceHandler) processOmciVlanFilterDoneEvent(devEvent OnuDeviceEvent) {
@@ -1399,15 +1518,24 @@
 	if dh.deviceReason != "omci-flows-pushed" {
 		// which may be the case from some previous actvity on another UNI Port of the ONU
 		// or even some previous flow add activity on the same port
-		if err := dh.coreProxy.DeviceReasonUpdate(context.TODO(), dh.deviceID, "omci-flows-pushed"); err != nil {
-			logger.Errorw("error-DeviceReasonUpdate to 'omci-flows-pushed'",
-				log.Fields{"device-id": dh.deviceID, "error": err})
+		if !dh.reconciling {
+			if err := dh.coreProxy.DeviceReasonUpdate(context.TODO(), dh.deviceID, "omci-flows-pushed"); err != nil {
+				logger.Errorw("error-DeviceReasonUpdate to 'omci-flows-pushed'",
+					log.Fields{"device-id": dh.deviceID, "error": err})
+			} else {
+				logger.Infow("updated dev reason to ''omci-flows-pushed'",
+					log.Fields{"device-id": dh.deviceID})
+			}
 		} else {
-			logger.Infow("updated dev reason to ''omci-flows-pushed'",
+			logger.Debugw("reconciling - don't notify core about DeviceReasonUpdate to omci-flows-pushed",
 				log.Fields{"device-id": dh.deviceID})
 		}
 		//set internal state anyway - as it was done
 		dh.deviceReason = "omci-flows-pushed"
+
+		if dh.reconciling {
+			go dh.reconcileMetrics()
+		}
 	}
 }
 
@@ -1784,7 +1912,7 @@
 	if metadata == 0 {
 		logger.Debugw("FlowAdd invalid metadata - abort",
 			log.Fields{"device-id": dh.deviceID})
-		return errors.New("flowAdd invalid metadata")
+		return fmt.Errorf("flowAdd invalid metadata: %s", dh.deviceID)
 	}
 	loTpID := flow.GetTechProfileIDFromWriteMetaData(metadata)
 	logger.Debugw("FlowAdd TechProfileId", log.Fields{"device-id": dh.deviceID, "TP-Id": loTpID})
@@ -1807,7 +1935,7 @@
 			"match_vid": strconv.FormatInt(int64(loMatchVlan), 16)})
 		//TODO!!: Use DeviceId within the error response to rwCore
 		//  likewise also in other error response cases to calling components as requested in [VOL-3458]
-		return errors.New("flowAdd Set/Match VlanId inconsistent")
+		return fmt.Errorf("flowAdd Set/Match VlanId inconsistent: %s", dh.deviceID)
 	}
 	if loSetVlan == uint16(of.OfpVlanId_OFPVID_NONE) && loMatchVlan == uint16(of.OfpVlanId_OFPVID_PRESENT) {
 		logger.Debugw("FlowAdd vlan-any/copy", log.Fields{"device-id": dh.deviceID})
@@ -1821,7 +1949,7 @@
 		logger.Debugw("FlowAdd vlan-set", log.Fields{"device-id": dh.deviceID})
 	}
 	if _, exist := dh.UniVlanConfigFsmMap[apUniPort.uniID]; exist {
-		return dh.UniVlanConfigFsmMap[apUniPort.uniID].SetUniFlowParams(loMatchVlan, loSetVlan, loSetPcp)
+		return dh.UniVlanConfigFsmMap[apUniPort.uniID].SetUniFlowParams(loTpID, loMatchVlan, loSetVlan, loSetPcp)
 	}
 	return dh.createVlanFilterFsm(apUniPort,
 		loTpID, loMatchVlan, loSetVlan, loSetPcp, OmciVlanFilterDone)
@@ -1910,3 +2038,59 @@
 	//save to do, even if entry dows not exist
 	delete(dh.UniVlanConfigFsmMap, apUniPort.uniID)
 }
+
+//storePersUniFlowConfig updates local storage of OnuUniFlowConfig and writes it into kv-store afterwards to have it
+//available for potential reconcilement
+
+func (dh *deviceHandler) storePersUniFlowConfig(aUniID uint8, aUniVlanFlowParams *[]uniVlanFlowParams) error {
+
+	if dh.reconciling {
+		logger.Debugw("reconciling - don't store persistent UniFlowConfig", log.Fields{"device-id": dh.deviceID})
+		return nil
+	}
+	logger.Debugw("Store persistent UniFlowConfig", log.Fields{"device-id": dh.deviceID})
+
+	pDevEntry := dh.getOnuDeviceEntry(true)
+	if pDevEntry == nil {
+		logger.Errorw("No valid OnuDevice - aborting", log.Fields{"device-id": dh.deviceID})
+		return fmt.Errorf("no valid OnuDevice: %s", dh.deviceID)
+	}
+	pDevEntry.updateOnuUniFlowConfig(aUniID, aUniVlanFlowParams)
+
+	pDevEntry.lockOnuKVStoreMutex()
+	defer pDevEntry.unlockOnuKVStoreMutex()
+
+	// deadline context to ensure completion of background routines waited for
+	//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(30 * time.Second) //allowed run time to finish before execution
+	dctx, cancel := context.WithDeadline(context.Background(), deadline)
+
+	pDevEntry.resetKvProcessingErrorIndication()
+	var wg sync.WaitGroup
+	wg.Add(1) // for the 1 go routine to finish
+
+	go pDevEntry.updateOnuKvStore(dctx, &wg)
+	dh.waitForCompletion(cancel, &wg) //wait for background process to finish
+
+	return pDevEntry.getKvProcessingErrorIndication()
+}
+
+func (dh *deviceHandler) waitForCompletion(cancel context.CancelFunc, wg *sync.WaitGroup) {
+	defer cancel() //ensure termination of context (may be pro forma)
+	wg.Wait()
+	logger.Debug("WaitGroup processing completed")
+
+}
+
+func (dh *deviceHandler) combineErrorStrings(errS ...error) error {
+	var errStr string = ""
+	for _, err := range errS {
+		if err != nil {
+			errStr = errStr + err.Error() + " "
+		}
+	}
+	if errStr != "" {
+		return fmt.Errorf("%s: %s", errStr, dh.deviceID)
+	}
+	return nil
+}
diff --git a/internal/pkg/onuadaptercore/omci_vlan_config.go b/internal/pkg/onuadaptercore/omci_vlan_config.go
index a414186..34eeef6 100644
--- a/internal/pkg/onuadaptercore/omci_vlan_config.go
+++ b/internal/pkg/onuadaptercore/omci_vlan_config.go
@@ -105,15 +105,6 @@
 	vlanStResetting       = "vlanStResetting"
 )
 
-type uniVlanFlowParameter struct {
-	//use uint32 types for allowing immediate bitshifting
-	matchVid     uint32
-	matchPcp     uint32
-	tagsToRemove uint32
-	setVid       uint32
-	setPcp       uint32
-}
-
 //UniVlanConfigFsm defines the structure for the state machine to config the PON ANI ports of ONU UNI ports via OMCI
 type UniVlanConfigFsm struct {
 	pDeviceHandler              *deviceHandler
@@ -127,7 +118,7 @@
 	pAdaptFsm                   *AdapterFsm
 	acceptIncrementalEvtoOption bool
 	mutexFlowParams             sync.Mutex
-	uniFlowParamsSlice          []uniVlanFlowParameter
+	uniFlowParamsSlice          []uniVlanFlowParams
 	numUniFlows                 uint8 // expected number of flows should be less than 12
 	configuredUniFlow           uint8
 	numVlanFilterEntries        uint8
@@ -205,7 +196,7 @@
 		return nil
 	}
 
-	_ = instFsm.SetUniFlowParams(aMatchVlan, aSetVlan, aSetPcp)
+	_ = instFsm.SetUniFlowParams(aTechProfileID, aMatchVlan, aSetVlan, aSetPcp)
 
 	logger.Infow("UniVlanConfigFsm created", log.Fields{"device-id": aDeviceID,
 		"accIncrEvto": instFsm.acceptIncrementalEvtoOption})
@@ -214,37 +205,38 @@
 
 //SetUniFlowParams verifies on existence of flow parameters to be configured
 // and appends a new flow if there is space
-func (oFsm *UniVlanConfigFsm) SetUniFlowParams(aMatchVlan uint16, aSetVlan uint16, aSetPcp uint8) error {
-	loFlowParams := uniVlanFlowParameter{
-		matchVid: uint32(aMatchVlan),
-		setVid:   uint32(aSetVlan),
-		setPcp:   uint32(aSetPcp),
+func (oFsm *UniVlanConfigFsm) SetUniFlowParams(aTpID uint16, aMatchVlan uint16, aSetVlan uint16, aSetPcp uint8) error {
+	loFlowParams := uniVlanFlowParams{
+		TpID:     aTpID,
+		MatchVid: uint32(aMatchVlan),
+		SetVid:   uint32(aSetVlan),
+		SetPcp:   uint32(aSetPcp),
 	}
 	// some automatic adjustments on the filter/treat parameters as not specifically configured/ensured by flow configuration parameters
-	loFlowParams.tagsToRemove = 1            //one tag to remove as default setting
-	loFlowParams.matchPcp = cPrioDoNotFilter // do not Filter on prio as default
+	loFlowParams.TagsToRemove = 1            //one tag to remove as default setting
+	loFlowParams.MatchPcp = cPrioDoNotFilter // do not Filter on prio as default
 
-	if loFlowParams.setVid == uint32(of.OfpVlanId_OFPVID_PRESENT) {
+	if loFlowParams.SetVid == uint32(of.OfpVlanId_OFPVID_PRESENT) {
 		//then matchVlan is don't care and should be overwritten to 'transparent' here to avoid unneeded multiple flow entries
-		loFlowParams.matchVid = uint32(of.OfpVlanId_OFPVID_PRESENT)
+		loFlowParams.MatchVid = uint32(of.OfpVlanId_OFPVID_PRESENT)
 		//TODO!!: maybe be needed to be re-checked at flow deletion (but assume all flows are always deleted togehther)
 	} else {
 		if !oFsm.acceptIncrementalEvtoOption {
 			//then matchVlan is don't care and should be overwritten to 'transparent' here to avoid unneeded multiple flow entries
-			loFlowParams.matchVid = uint32(of.OfpVlanId_OFPVID_PRESENT)
+			loFlowParams.MatchVid = uint32(of.OfpVlanId_OFPVID_PRESENT)
 		}
 	}
 
-	if loFlowParams.matchVid == uint32(of.OfpVlanId_OFPVID_PRESENT) {
+	if loFlowParams.MatchVid == uint32(of.OfpVlanId_OFPVID_PRESENT) {
 		// no prio/vid filtering requested
-		loFlowParams.tagsToRemove = 0          //no tag pop action
-		loFlowParams.matchPcp = cPrioIgnoreTag // no vlan tag filtering
-		if loFlowParams.setPcp == cCopyPrioFromInner {
+		loFlowParams.TagsToRemove = 0          //no tag pop action
+		loFlowParams.MatchPcp = cPrioIgnoreTag // no vlan tag filtering
+		if loFlowParams.SetPcp == cCopyPrioFromInner {
 			//in case of no filtering and configured PrioCopy ensure default prio setting to 0
 			// which is required for stacking of untagged, but obviously also ensures prio setting for prio/singletagged
 			// might collide with NoMatchVid/CopyPrio(/setVid) setting
 			// this was some precondition setting taken over from py adapter ..
-			loFlowParams.setPcp = 0
+			loFlowParams.SetPcp = 0
 		}
 	}
 	flowEntryMatch := false
@@ -265,10 +257,18 @@
 			oFsm.uniFlowParamsSlice = append(oFsm.uniFlowParamsSlice, loFlowParams)
 			oFsm.numUniFlows++
 			logger.Debugw("UniVlanConfigFsm flow added", log.Fields{
-				"matchVid": strconv.FormatInt(int64(loFlowParams.matchVid), 16),
-				"setVid":   strconv.FormatInt(int64(loFlowParams.setVid), 16),
-				"setPcp":   loFlowParams.setPcp, "numberofFlows": oFsm.numUniFlows,
+				"MatchVid": strconv.FormatInt(int64(loFlowParams.MatchVid), 16),
+				"SetVid":   strconv.FormatInt(int64(loFlowParams.SetVid), 16),
+				"SetPcp":   loFlowParams.SetPcp, "numberofFlows": oFsm.numUniFlows,
 				"device-id": oFsm.pAdaptFsm.deviceID})
+
+			//permanently store flow config for reconcile case
+
+			if err := oFsm.pDeviceHandler.storePersUniFlowConfig(oFsm.pOnuUniPort.uniID, &oFsm.uniFlowParamsSlice); err != nil {
+				logger.Errorw(err.Error(), log.Fields{"device-id": oFsm.pAdaptFsm.deviceID})
+				return err
+			}
+
 			pConfigVlanStateBaseFsm := oFsm.pAdaptFsm.pFsm
 			if pConfigVlanStateBaseFsm.Is(vlanStConfigDone) {
 				//have to re-trigger the FSM to proceed with outstanding incremental flow configuration
@@ -321,7 +321,7 @@
 func (oFsm *UniVlanConfigFsm) enterConfigVtfd(e *fsm.Event) {
 	//mutex protection is required for possible concurrent access to FSM members
 	oFsm.mutexFlowParams.Lock()
-	if oFsm.uniFlowParamsSlice[0].setVid == uint32(of.OfpVlanId_OFPVID_PRESENT) {
+	if oFsm.uniFlowParamsSlice[0].SetVid == uint32(of.OfpVlanId_OFPVID_PRESENT) {
 		// meaning transparent setup - no specific VTFD setting required
 		oFsm.mutexFlowParams.Unlock()
 		logger.Debugw("UniVlanConfigFsm: no VTFD config required", log.Fields{
@@ -336,7 +336,7 @@
 		logger.Debugw("UniVlanConfigFsm create VTFD", log.Fields{
 			"EntitytId": strconv.FormatInt(int64(oFsm.vtfdID), 16),
 			"in state":  e.FSM.Current(), "device-id": oFsm.pAdaptFsm.deviceID})
-		oFsm.vlanFilterList[0] = uint16(oFsm.uniFlowParamsSlice[0].setVid) // setVid is assumed to be masked already by the caller to 12 bit
+		oFsm.vlanFilterList[0] = uint16(oFsm.uniFlowParamsSlice[0].SetVid) // setVid is assumed to be masked already by the caller to 12 bit
 		oFsm.mutexFlowParams.Unlock()
 		vtfdFilterList := make([]uint16, 12) //needed for parameter serialization
 		vtfdFilterList[0] = oFsm.vlanFilterList[0]
@@ -397,7 +397,7 @@
 		"device-id": oFsm.pAdaptFsm.deviceID})
 	oFsm.mutexFlowParams.Lock()
 
-	if oFsm.uniFlowParamsSlice[oFsm.configuredUniFlow].setVid == uint32(of.OfpVlanId_OFPVID_PRESENT) {
+	if oFsm.uniFlowParamsSlice[oFsm.configuredUniFlow].SetVid == uint32(of.OfpVlanId_OFPVID_PRESENT) {
 		// meaning transparent setup - no specific VTFD setting required
 		oFsm.mutexFlowParams.Unlock()
 		logger.Debugw("UniVlanConfigFsm: no VTFD config required", log.Fields{
@@ -408,7 +408,7 @@
 			logger.Debugw("UniVlanConfigFsm create VTFD", log.Fields{
 				"EntitytId": strconv.FormatInt(int64(oFsm.vtfdID), 16),
 				"in state":  e.FSM.Current(), "device-id": oFsm.pAdaptFsm.deviceID})
-			oFsm.vlanFilterList[0] = uint16(oFsm.uniFlowParamsSlice[oFsm.configuredUniFlow].setVid) // setVid is assumed to be masked already by the caller to 12 bit
+			oFsm.vlanFilterList[0] = uint16(oFsm.uniFlowParamsSlice[oFsm.configuredUniFlow].SetVid) // setVid is assumed to be masked already by the caller to 12 bit
 			oFsm.mutexFlowParams.Unlock()
 			vtfdFilterList := make([]uint16, 12) //needed for parameter serialization
 			vtfdFilterList[0] = oFsm.vlanFilterList[0]
@@ -437,7 +437,7 @@
 				"in state":  e.FSM.Current(), "device-id": oFsm.pAdaptFsm.deviceID})
 			// setVid is assumed to be masked already by the caller to 12 bit
 			oFsm.vlanFilterList[oFsm.numVlanFilterEntries] =
-				uint16(oFsm.uniFlowParamsSlice[oFsm.configuredUniFlow].setVid)
+				uint16(oFsm.uniFlowParamsSlice[oFsm.configuredUniFlow].SetVid)
 			oFsm.mutexFlowParams.Unlock()
 			vtfdFilterList := make([]uint16, 12) //needed for parameter serialization
 			for i := uint8(0); i <= oFsm.numVlanFilterEntries; i++ {
@@ -679,7 +679,7 @@
 	} //first flow element
 
 	oFsm.mutexFlowParams.Lock()
-	if oFsm.uniFlowParamsSlice[aFlowEntryNo].setVid == uint32(of.OfpVlanId_OFPVID_PRESENT) {
+	if oFsm.uniFlowParamsSlice[aFlowEntryNo].SetVid == uint32(of.OfpVlanId_OFPVID_PRESENT) {
 		//transparent transmission required
 		oFsm.mutexFlowParams.Unlock()
 		logger.Debugw("UniVlanConfigFsm Tx Set::EVTOCD single tagged transparent rule", log.Fields{
@@ -742,20 +742,20 @@
 					cDoNotFilterTPID<<cFilterTpidOffset) // Do not filter on outer TPID field
 
 			binary.BigEndian.PutUint32(sliceEvtocdRule[cFilterInnerOffset:],
-				oFsm.uniFlowParamsSlice[aFlowEntryNo].matchPcp<<cFilterPrioOffset| // either DNFonPrio or ignore tag (default) on innerVLAN
-					oFsm.uniFlowParamsSlice[aFlowEntryNo].matchVid<<cFilterVidOffset| // either DNFonVid or real filter VID
+				oFsm.uniFlowParamsSlice[aFlowEntryNo].MatchPcp<<cFilterPrioOffset| // either DNFonPrio or ignore tag (default) on innerVLAN
+					oFsm.uniFlowParamsSlice[aFlowEntryNo].MatchVid<<cFilterVidOffset| // either DNFonVid or real filter VID
 					cDoNotFilterTPID<<cFilterTpidOffset| // Do not filter on inner TPID field
 					cDoNotFilterEtherType<<cFilterEtherTypeOffset) // Do not filter of EtherType
 
 			binary.BigEndian.PutUint32(sliceEvtocdRule[cTreatOuterOffset:],
-				oFsm.uniFlowParamsSlice[aFlowEntryNo].tagsToRemove<<cTreatTTROffset| // either 1 or 0
+				oFsm.uniFlowParamsSlice[aFlowEntryNo].TagsToRemove<<cTreatTTROffset| // either 1 or 0
 					cDoNotAddPrio<<cTreatPrioOffset| // do not add outer tag
 					cDontCareVid<<cTreatVidOffset| // Outer VID don't care
 					cDontCareTpid<<cTreatTpidOffset) // Outer TPID field don't care
 
 			binary.BigEndian.PutUint32(sliceEvtocdRule[cTreatInnerOffset:],
-				oFsm.uniFlowParamsSlice[aFlowEntryNo].setPcp<<cTreatPrioOffset| // as configured in flow
-					oFsm.uniFlowParamsSlice[aFlowEntryNo].setVid<<cTreatVidOffset| //as configured in flow
+				oFsm.uniFlowParamsSlice[aFlowEntryNo].SetPcp<<cTreatPrioOffset| // as configured in flow
+					oFsm.uniFlowParamsSlice[aFlowEntryNo].SetVid<<cTreatVidOffset| //as configured in flow
 					cSetOutputTpidCopyDei<<cTreatTpidOffset) // Set TPID = 0x8100
 			oFsm.mutexFlowParams.Unlock()
 
@@ -807,7 +807,7 @@
 				binary.BigEndian.PutUint32(sliceEvtocdRule[cTreatInnerOffset:],
 					0<<cTreatPrioOffset| // vlan prio set to 0
 						//   (as done in Py code, maybe better option would be setPcp here, which still could be 0?)
-						oFsm.uniFlowParamsSlice[aFlowEntryNo].setVid<<cTreatVidOffset| // Outer VID don't care
+						oFsm.uniFlowParamsSlice[aFlowEntryNo].SetVid<<cTreatVidOffset| // Outer VID don't care
 						cSetOutputTpidCopyDei<<cTreatTpidOffset) // Set TPID = 0x8100
 
 				oFsm.mutexFlowParams.Unlock()
@@ -859,7 +859,7 @@
 				binary.BigEndian.PutUint32(sliceEvtocdRule[cTreatInnerOffset:],
 					cCopyPrioFromInner<<cTreatPrioOffset| // vlan copy from PrioTag
 						//   (as done in Py code, maybe better option would be setPcp here, which still could be PrioCopy?)
-						oFsm.uniFlowParamsSlice[aFlowEntryNo].setVid<<cTreatVidOffset| // Outer VID as configured
+						oFsm.uniFlowParamsSlice[aFlowEntryNo].SetVid<<cTreatVidOffset| // Outer VID as configured
 						cSetOutputTpidCopyDei<<cTreatTpidOffset) // Set TPID = 0x8100
 				oFsm.mutexFlowParams.Unlock()
 
diff --git a/internal/pkg/onuadaptercore/onu_device_entry.go b/internal/pkg/onuadaptercore/onu_device_entry.go
index 382984c..8c1d097 100644
--- a/internal/pkg/onuadaptercore/onu_device_entry.go
+++ b/internal/pkg/onuadaptercore/onu_device_entry.go
@@ -19,7 +19,10 @@
 
 import (
 	"context"
+	"encoding/json"
 	"errors"
+	"fmt"
+	"sync"
 	"time"
 
 	"github.com/opencord/omci-lib-go"
@@ -31,6 +34,7 @@
 	"github.com/looplab/fsm"
 	"github.com/opencord/voltha-lib-go/v3/pkg/adapters/adapterif"
 	"github.com/opencord/voltha-lib-go/v3/pkg/db"
+	"github.com/opencord/voltha-lib-go/v3/pkg/db/kvstore"
 
 	//"github.com/opencord/voltha-lib-go/v3/pkg/kafka"
 	"github.com/opencord/voltha-lib-go/v3/pkg/log"
@@ -104,6 +108,7 @@
 const (
 	cBasePathMibTemplateKvStore = "service/voltha/omci_mibs/go_templates"
 	cSuffixMibTemplateKvStore   = "%s/%s/%s"
+	cBasePathOnuKVStore         = "service/voltha/openonu"
 )
 
 // OnuDeviceEvent - event of interest to Device Adapters and OpenOMCI State Machines
@@ -188,22 +193,52 @@
 	isActive uint8
 }
 
+type uniVlanFlowParams struct {
+	TpID         uint16 `json:"tp_id"`
+	MatchVid     uint32 `json:"match_vid"` //use uint32 types for allowing immediate bitshifting
+	MatchPcp     uint32 `json:"match_pcp"`
+	TagsToRemove uint32 `json:"tags_to_revome"`
+	SetVid       uint32 `json:"set_vid"`
+	SetPcp       uint32 `json:"set_pcp"`
+}
+
+type uniPersConfig struct {
+	PersUniID      uint8               `json:"uni_id"`
+	PersTpPath     string              `json:"tp_path"`
+	PersFlowParams []uniVlanFlowParams `json:"flow_params"`
+}
+
+type onuPersistentData struct {
+	PersOnuID      uint32          `json:"onu_id"`
+	PersIntfID     uint32          `json:"intf_id"`
+	PersSnr        string          `json:"serial_number"`
+	PersAdminState string          `json:"admin_state"`
+	PersOperState  string          `json:"oper_state"`
+	PersUniConfig  []uniPersConfig `json:"uni_config"`
+}
+
 // OnuDeviceEntry - ONU device info and FSM events.
 type OnuDeviceEntry struct {
-	deviceID           string
-	baseDeviceHandler  *deviceHandler
-	coreProxy          adapterif.CoreProxy
-	adapterProxy       adapterif.AdapterProxy
-	started            bool
-	PDevOmciCC         *omciCC
-	pOnuDB             *onuDeviceDB
-	mibTemplateKVStore *db.Backend
-	vendorID           string
-	serialNumber       string
-	equipmentID        string
-	swImages           [secondSwImageMeID + 1]swImages
-	activeSwVersion    string
-	macAddress         string
+	deviceID              string
+	baseDeviceHandler     *deviceHandler
+	coreProxy             adapterif.CoreProxy
+	adapterProxy          adapterif.AdapterProxy
+	started               bool
+	PDevOmciCC            *omciCC
+	pOnuDB                *onuDeviceDB
+	mibTemplateKVStore    *db.Backend
+	sOnuPersistentData    onuPersistentData
+	onuKVStoreMutex       sync.RWMutex
+	onuKVStore            *db.Backend
+	onuKVStorePath        string
+	onuKVStoreprocResult  error //error indication of processing
+	chOnuKvProcessingStep chan uint8
+	vendorID              string
+	serialNumber          string
+	equipmentID           string
+	swImages              [secondSwImageMeID + 1]swImages
+	activeSwVersion       string
+	macAddress            string
 	//lockDeviceEntries           sync.RWMutex
 	mibDbClass    func() error
 	supportedFsms OmciDeviceFsms
@@ -235,6 +270,8 @@
 	onuDeviceEntry.coreProxy = coreProxy
 	onuDeviceEntry.adapterProxy = adapterProxy
 	onuDeviceEntry.devState = DeviceStatusInit
+	onuDeviceEntry.sOnuPersistentData.PersUniConfig = make([]uniPersConfig, 0)
+	onuDeviceEntry.chOnuKvProcessingStep = make(chan uint8)
 	onuDeviceEntry.omciRebootMessageReceivedChannel = make(chan Message, 2048)
 	//openomciagent.lockDeviceHandlersMap = sync.RWMutex{}
 	//OMCI related databases are on a per-agent basis. State machines and tasks
@@ -379,7 +416,15 @@
 
 	onuDeviceEntry.mibTemplateKVStore = onuDeviceEntry.baseDeviceHandler.setBackend(cBasePathMibTemplateKvStore)
 	if onuDeviceEntry.mibTemplateKVStore == nil {
-		logger.Errorw("Failed to setup mibTemplateKVStore", log.Fields{"device-id": deviceID})
+		logger.Errorw("Can't access mibTemplateKVStore - no backend connection to service",
+			log.Fields{"device-id": deviceID, "service": cBasePathMibTemplateKvStore})
+	}
+
+	onuDeviceEntry.onuKVStorePath = onuDeviceEntry.deviceID
+	onuDeviceEntry.onuKVStore = onuDeviceEntry.baseDeviceHandler.setBackend(cBasePathOnuKVStore)
+	if onuDeviceEntry.onuKVStore == nil {
+		logger.Errorw("Can't access onuKVStore - no backend connection to service",
+			log.Fields{"device-id": deviceID, "service": cBasePathOnuKVStore})
 	}
 
 	// Alarm Synchronization Database
@@ -479,3 +524,217 @@
 		logger.Warnw("device-event not yet handled", log.Fields{"state": devEvent})
 	}
 }
+
+func (oo *OnuDeviceEntry) restoreDataFromOnuKvStore(ctx context.Context) error {
+	if oo.onuKVStore == nil {
+		logger.Debugw("onuKVStore not set - abort", log.Fields{"device-id": oo.deviceID})
+		return fmt.Errorf(fmt.Sprintf("onuKVStore-not-set-abort-%s", oo.deviceID))
+	}
+	oo.sOnuPersistentData = onuPersistentData{0, 0, "", "", "", make([]uniPersConfig, 0)}
+	Value, err := oo.onuKVStore.Get(ctx, oo.onuKVStorePath)
+	if err == nil {
+		if Value != nil {
+			logger.Debugw("ONU-data read",
+				log.Fields{"Key": Value.Key, "device-id": oo.deviceID})
+			tmpBytes, _ := kvstore.ToByte(Value.Value)
+
+			if err = json.Unmarshal(tmpBytes, &oo.sOnuPersistentData); err != nil {
+				logger.Errorw("unable to unmarshal ONU-data", log.Fields{"error": err, "device-id": oo.deviceID})
+				return fmt.Errorf(fmt.Sprintf("unable-to-unmarshal-ONU-data-%s", oo.deviceID))
+			}
+			logger.Debugw("ONU-data", log.Fields{"sOnuPersistentData": oo.sOnuPersistentData,
+				"device-id": oo.deviceID})
+		} else {
+			logger.Errorw("no ONU-data found", log.Fields{"path": oo.onuKVStorePath, "device-id": oo.deviceID})
+			return fmt.Errorf(fmt.Sprintf("no-ONU-data-found-%s", oo.deviceID))
+		}
+	} else {
+		logger.Errorw("unable to read from KVstore", log.Fields{"device-id": oo.deviceID})
+		return fmt.Errorf(fmt.Sprintf("unable-to-read-from-KVstore-%s", oo.deviceID))
+	}
+	return nil
+}
+
+func (oo *OnuDeviceEntry) deleteDataFromOnuKvStore(ctx context.Context, wg *sync.WaitGroup) {
+	defer wg.Done()
+
+	if oo.onuKVStore == nil {
+		logger.Debugw("onuKVStore not set - abort", log.Fields{"device-id": oo.deviceID})
+		oo.onuKVStoreprocResult = errors.New("onu-data delete aborted: onuKVStore not set")
+		return
+	}
+	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("ONU-data not deleted - abort", log.Fields{"device-id": oo.deviceID})
+		oo.onuKVStoreprocResult = errors.New("onu-data delete aborted: during kv-access")
+		return
+	}
+}
+
+func (oo *OnuDeviceEntry) deletePersistentData(ctx context.Context, aProcessingStep uint8) {
+
+	logger.Debugw("delete ONU-data from KVStore", log.Fields{"device-id": oo.deviceID})
+	err := oo.onuKVStore.Delete(ctx, oo.onuKVStorePath)
+	if err != nil {
+		logger.Errorw("unable to delete in KVstore", log.Fields{"device-id": oo.deviceID, "err": err})
+		oo.chOnuKvProcessingStep <- 0 //error indication
+		return
+	}
+	oo.chOnuKvProcessingStep <- aProcessingStep //done
+}
+
+func (oo *OnuDeviceEntry) updateOnuKvStore(ctx context.Context, wg *sync.WaitGroup) {
+	defer wg.Done()
+
+	if oo.onuKVStore == nil {
+		logger.Debugw("onuKVStore not set - abort", log.Fields{"device-id": oo.deviceID})
+		oo.onuKVStoreprocResult = errors.New("onu-data update aborted: onuKVStore not set")
+		return
+	}
+	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("ONU-data not written - abort", log.Fields{"device-id": oo.deviceID})
+		oo.onuKVStoreprocResult = errors.New("onu-data update aborted: during writing process")
+		return
+	}
+}
+
+func (oo *OnuDeviceEntry) storeDataInOnuKvStore(ctx context.Context, aProcessingStep uint8) {
+
+	//assign values which are not already present when newOnuDeviceEntry() is called
+	oo.sOnuPersistentData.PersOnuID = oo.baseDeviceHandler.pOnuIndication.OnuId
+	oo.sOnuPersistentData.PersIntfID = oo.baseDeviceHandler.pOnuIndication.IntfId
+	oo.sOnuPersistentData.PersSnr = oo.baseDeviceHandler.pOnuOmciDevice.serialNumber
+	//TODO: verify usage of these values during restart UC
+	oo.sOnuPersistentData.PersAdminState = "up"
+	oo.sOnuPersistentData.PersOperState = "active"
+
+	logger.Debugw("Update ONU-data in KVStore", log.Fields{"device-id": oo.deviceID, "sOnuPersistentData": oo.sOnuPersistentData})
+
+	Value, err := json.Marshal(oo.sOnuPersistentData)
+	if err != nil {
+		logger.Errorw("unable to marshal ONU-data", log.Fields{"sOnuPersistentData": oo.sOnuPersistentData,
+			"device-id": oo.deviceID, "err": err})
+		oo.chOnuKvProcessingStep <- 0 //error indication
+		return
+	}
+	err = oo.onuKVStore.Put(ctx, oo.onuKVStorePath, Value)
+	if err != nil {
+		logger.Errorw("unable to write ONU-data into KVstore", log.Fields{"device-id": oo.deviceID, "err": err})
+		oo.chOnuKvProcessingStep <- 0 //error indication
+		return
+	}
+	oo.chOnuKvProcessingStep <- aProcessingStep //done
+}
+
+func (oo *OnuDeviceEntry) updateOnuUniTpPath(aUniID uint8, aPathString string) bool {
+	/* within some specific InterAdapter processing request write/read access to data is ensured to be sequentially,
+	   as also the complete sequence is ensured to 'run to completion' before some new request is accepted
+	   no specific concurrency protection to sOnuPersistentData is required here
+	*/
+	for k, v := range oo.sOnuPersistentData.PersUniConfig {
+		if v.PersUniID == aUniID {
+			logger.Debugw("PersUniConfig-entry already exists", log.Fields{"device-id": oo.deviceID, "uniID": aUniID})
+			existingPath := oo.sOnuPersistentData.PersUniConfig[k].PersTpPath
+			if existingPath != aPathString {
+				if aPathString == "" {
+					//existing entry to be deleted
+					logger.Debugw("UniTp delete path value", log.Fields{"device-id": oo.deviceID, "uniID": aUniID, "path": aPathString})
+					oo.sOnuPersistentData.PersUniConfig[k].PersTpPath = ""
+				} else {
+					//existing entry to be modified
+					logger.Debugw("UniTp modify path value", log.Fields{"device-id": oo.deviceID, "uniID": aUniID, "path": aPathString})
+					oo.sOnuPersistentData.PersUniConfig[k].PersTpPath = aPathString
+				}
+				return true
+			}
+			//entry already exists
+			logger.Debugw("UniTp path already exists", log.Fields{"device-id": oo.deviceID, "uniID": aUniID, "path": aPathString})
+			return false
+		}
+	}
+	//no entry exists for uniId
+
+	if aPathString == "" {
+		//delete request in non-existing state , accept as no change
+		logger.Debugw("UniTp path already removed", log.Fields{"device-id": oo.deviceID, "uniID": aUniID})
+		return false
+	}
+	//new entry to be created
+	logger.Debugw("New UniTp path set", log.Fields{"device-id": oo.deviceID, "uniID": aUniID, "path": aPathString})
+	oo.sOnuPersistentData.PersUniConfig =
+		append(oo.sOnuPersistentData.PersUniConfig, uniPersConfig{PersUniID: aUniID, PersTpPath: aPathString, PersFlowParams: make([]uniVlanFlowParams, 0)})
+	return true
+}
+
+// deleteTpResource removes Resources from the ONU's specified Uni
+func (oo *OnuDeviceEntry) deleteTpResource(ctx context.Context,
+	aUniID uint8, aPathString string, aResource resourceEntry, aEntryID uint32,
+	wg *sync.WaitGroup) {
+	defer wg.Done()
+	logger.Debugw("this would remove TP resources from ONU's UNI", log.Fields{
+		"device-id": oo.deviceID, "uniID": aUniID, "path": aPathString, "Resource": aResource})
+	//TODO!!!
+	//delete the given resource from ONU OMCI config and data base - as background routine
+	/*
+		var processingStep uint8 = 1 // used to synchronize the different processing steps with chTpConfigProcessingStep
+		go onuTp.deleteAniResource(ctx, processingStep)
+		if !onuTP.waitForTimeoutOrCompletion(ctx, chTpConfigProcessingStep, processingStep) {
+			//timeout or error detected
+			return
+		}
+	*/
+}
+
+func (oo *OnuDeviceEntry) updateOnuUniFlowConfig(aUniID uint8, aUniVlanFlowParams *[]uniVlanFlowParams) {
+
+	for k, v := range oo.sOnuPersistentData.PersUniConfig {
+		if v.PersUniID == aUniID {
+			oo.sOnuPersistentData.PersUniConfig[k].PersFlowParams = make([]uniVlanFlowParams, len(*aUniVlanFlowParams))
+			copy(oo.sOnuPersistentData.PersUniConfig[k].PersFlowParams, *aUniVlanFlowParams)
+			return
+		}
+	}
+	//flow update was faster than tp-config - create PersUniConfig-entry
+	tmpConfig := uniPersConfig{PersUniID: aUniID, PersTpPath: "", PersFlowParams: make([]uniVlanFlowParams, len(*aUniVlanFlowParams))}
+	copy(tmpConfig.PersFlowParams, *aUniVlanFlowParams)
+	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("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("Invalid processing step received: abort!",
+			log.Fields{"device-id": oo.deviceID,
+				"wantedStep": aProcessingStep, "haveStep": rxStep})
+		return false
+	}
+}
+
+func (oo *OnuDeviceEntry) resetKvProcessingErrorIndication() {
+	oo.onuKVStoreprocResult = nil
+}
+func (oo *OnuDeviceEntry) getKvProcessingErrorIndication() error {
+	return oo.onuKVStoreprocResult
+}
+
+func (oo *OnuDeviceEntry) lockOnuKVStoreMutex() {
+	oo.onuKVStoreMutex.Lock()
+}
+
+func (oo *OnuDeviceEntry) unlockOnuKVStoreMutex() {
+	oo.onuKVStoreMutex.Unlock()
+}
diff --git a/internal/pkg/onuadaptercore/onu_uni_tp.go b/internal/pkg/onuadaptercore/onu_uni_tp.go
index 4f452a7..f47025b 100644
--- a/internal/pkg/onuadaptercore/onu_uni_tp.go
+++ b/internal/pkg/onuadaptercore/onu_uni_tp.go
@@ -21,7 +21,6 @@
 	"context"
 	"encoding/json"
 	"errors"
-	"fmt"
 	"strconv"
 	"strings"
 	"sync"
@@ -33,7 +32,6 @@
 )
 
 const cBasePathTechProfileKVStore = "service/voltha/technology_profiles"
-const cBasePathOnuKVStore = "service/voltha/openonu"
 
 //definitions for TechProfileProcessing - copied from OltAdapter:openolt_flowmgr.go
 //  could perhaps be defined more globally
@@ -51,20 +49,6 @@
 	cResourceTcont   resourceEntry = 2
 )
 
-type uniPersData struct {
-	PersUniID  uint32 `json:"uni_id"`
-	PersTpPath string `json:"tp_path"`
-}
-
-type onuPersistentData struct {
-	PersOnuID      uint32        `json:"onu_id"`
-	PersIntfID     uint32        `json:"intf_id"`
-	PersSnr        string        `json:"serial_number"`
-	PersAdminState string        `json:"admin_state"`
-	PersOperState  string        `json:"oper_state"`
-	PersUniTpPath  []uniPersData `json:"uni_config"`
-}
-
 type tTechProfileIndication struct {
 	techProfileType       string
 	techProfileID         uint16
@@ -103,13 +87,8 @@
 	deviceID                 string
 	baseDeviceHandler        *deviceHandler
 	tpProcMutex              sync.RWMutex
-	mapUniTpPath             map[uint32]string
-	sOnuPersistentData       onuPersistentData
 	techProfileKVStore       *db.Backend
-	onuKVStore               *db.Backend
-	onuKVStorePath           string
 	chTpConfigProcessingStep chan uint8
-	chTpKvProcessingStep     chan uint8
 	mapUniTpIndication       map[uint8]*tTechProfileIndication //use pointer values to ease assignments to the map
 	mapPonAniConfig          map[uint8]*tMapPonAniConfig       //per UNI: use pointer values to ease assignments to the map
 	pAniConfigFsm            *uniPonAniConfigFsm
@@ -125,10 +104,7 @@
 	onuTP.deviceID = aDeviceID
 	onuTP.baseDeviceHandler = aDeviceHandler
 	onuTP.tpProcMutex = sync.RWMutex{}
-	onuTP.mapUniTpPath = make(map[uint32]string)
-	onuTP.sOnuPersistentData.PersUniTpPath = make([]uniPersData, 1)
 	onuTP.chTpConfigProcessingStep = make(chan uint8)
-	onuTP.chTpKvProcessingStep = make(chan uint8)
 	onuTP.mapUniTpIndication = make(map[uint8]*tTechProfileIndication)
 	onuTP.mapPonAniConfig = make(map[uint8]*tMapPonAniConfig)
 	onuTP.procResult = nil //default assumption processing done with success
@@ -139,12 +115,6 @@
 			log.Fields{"device-id": aDeviceID, "service": cBasePathTechProfileKVStore})
 	}
 
-	onuTP.onuKVStorePath = onuTP.deviceID
-	onuTP.onuKVStore = aDeviceHandler.setBackend(cBasePathOnuKVStore)
-	if onuTP.onuKVStore == nil {
-		logger.Errorw("Can't access onuKVStore - no backend connection to service",
-			log.Fields{"device-id": aDeviceID, "service": cBasePathOnuKVStore})
-	}
 	return &onuTP
 }
 
@@ -158,59 +128,13 @@
 	onuTP.tpProcMutex.Unlock()
 }
 
-// resetProcessingErrorIndication resets the internal error indication
+// resetTpProcessingErrorIndication resets the internal error indication
 // need to be called before evaluation of any subsequent processing (given by waitForTpCompletion())
-func (onuTP *onuUniTechProf) resetProcessingErrorIndication() {
+func (onuTP *onuUniTechProf) resetTpProcessingErrorIndication() {
 	onuTP.procResult = nil
 }
 
-// updateOnuUniTpPath verifies and updates changes in the kvStore onuUniTpPath
-func (onuTP *onuUniTechProf) updateOnuUniTpPath(aUniID uint32, aPathString string) bool {
-	/* within some specific InterAdapter processing request write/read access to data is ensured to be sequentially,
-	   as also the complete sequence is ensured to 'run to  completion' before some new request is accepted
-	   no specific concurrency protection to sOnuPersistentData is required here
-	*/
-	if existingPath, present := onuTP.mapUniTpPath[aUniID]; present {
-		// uni entry already exists
-		//logger.Debugw(" already exists", log.Fields{"for InstanceId": a_uniInstNo})
-		if existingPath != aPathString {
-			if aPathString == "" {
-				//existing entry to be deleted
-				logger.Debugw("UniTp path delete", log.Fields{
-					"device-id": onuTP.deviceID, "uniID": aUniID, "path": aPathString})
-				delete(onuTP.mapUniTpPath, aUniID)
-			} else {
-				//existing entry to be modified
-				logger.Debugw("UniTp path modify", log.Fields{
-					"device-id": onuTP.deviceID, "uniID": aUniID, "path": aPathString})
-				onuTP.mapUniTpPath[aUniID] = aPathString
-			}
-			return true
-		}
-		//entry already exists
-		logger.Debugw("UniTp path already exists", log.Fields{
-			"device-id": onuTP.deviceID, "uniID": aUniID, "path": aPathString})
-		return false
-	}
-	//uni entry does not exist
-	if aPathString == "" {
-		//delete request in non-existing state , accept as no change
-		logger.Debugw("UniTp path already removed", log.Fields{
-			"device-id": onuTP.deviceID, "uniID": aUniID})
-		return false
-	}
-	//new entry to be set
-	logger.Debugw("New UniTp path set", log.Fields{
-		"device-id": onuTP.deviceID, "uniID": aUniID, "path": aPathString})
-	onuTP.mapUniTpPath[aUniID] = aPathString
-	return true
-}
-
-func (onuTP *onuUniTechProf) waitForTpCompletion(cancel context.CancelFunc, wg *sync.WaitGroup) error {
-	defer cancel() //ensure termination of context (may be pro forma)
-	wg.Wait()
-	logger.Debug("some TechProfile Processing completed")
-	onuTP.tpProcMutex.Unlock() //allow further TP related processing
+func (onuTP *onuUniTechProf) getTpProcessingErrorIndication() error {
 	return onuTP.procResult
 }
 
@@ -306,148 +230,8 @@
 	}
 }
 
-func (onuTP *onuUniTechProf) updateOnuTpPathKvStore(ctx context.Context, wg *sync.WaitGroup) {
-	defer wg.Done()
-
-	if onuTP.onuKVStore == nil {
-		logger.Debugw("onuKVStore not set - abort", log.Fields{"device-id": onuTP.deviceID})
-		onuTP.procResult = errors.New("onu/tp-data update aborted: onuKVStore not set")
-		return
-	}
-	var processingStep uint8 = 1 // used to synchronize the different processing steps with chTpKvProcessingStep
-	go onuTP.storePersistentData(ctx, processingStep)
-	if !onuTP.waitForTimeoutOrCompletion(ctx, onuTP.chTpKvProcessingStep, processingStep) {
-		//timeout or error detected
-		logger.Debugw("ONU/TP-data not written - abort", log.Fields{"device-id": onuTP.deviceID})
-		onuTP.procResult = errors.New("onu/tp-data update aborted: during writing process")
-		return
-	}
-}
-
-func (onuTP *onuUniTechProf) restoreFromOnuTpPathKvStore(ctx context.Context) error {
-	if onuTP.onuKVStore == nil {
-		logger.Debugw("onuKVStore not set - abort", log.Fields{"device-id": onuTP.deviceID})
-		return fmt.Errorf(fmt.Sprintf("onuKVStore-not-set-abort-%s", onuTP.deviceID))
-	}
-	if err := onuTP.restorePersistentData(ctx); err != nil {
-		logger.Debugw("ONU/TP-data not read - abort", log.Fields{"device-id": onuTP.deviceID})
-		return err
-	}
-	return nil
-}
-
-func (onuTP *onuUniTechProf) deleteOnuTpPathKvStore(ctx context.Context) error {
-	if onuTP.onuKVStore == nil {
-		logger.Debugw("onuKVStore not set - abort", log.Fields{"device-id": onuTP.deviceID})
-		return fmt.Errorf(fmt.Sprintf("onuKVStore-not-set-abort-%s", onuTP.deviceID))
-	}
-	if err := onuTP.deletePersistentData(ctx); err != nil {
-		logger.Debugw("ONU/TP-data not read - abort", log.Fields{"device-id": onuTP.deviceID})
-		return err
-	}
-	return nil
-}
-
-// deleteTpResource removes Resources from the ONU's specified Uni
-func (onuTP *onuUniTechProf) deleteTpResource(ctx context.Context,
-	aUniID uint32, aPathString string, aResource resourceEntry, aEntryID uint32,
-	wg *sync.WaitGroup) {
-	defer wg.Done()
-	logger.Debugw("this would remove TP resources from ONU's UNI", log.Fields{
-		"device-id": onuTP.deviceID, "uniID": aUniID, "path": aPathString, "Resource": aResource})
-	//TODO!!!
-	//delete the given resource from ONU OMCI config and data base - as background routine
-	/*
-		var processingStep uint8 = 1 // used to synchronize the different processing steps with chTpConfigProcessingStep
-		go onuTp.deleteAniResource(ctx, processingStep)
-		if !onuTP.waitForTimeoutOrCompletion(ctx, chTpConfigProcessingStep, processingStep) {
-			//timeout or error detected
-			return
-		}
-	*/
-}
-
 /* internal methods *********************/
 
-func (onuTP *onuUniTechProf) storePersistentData(ctx context.Context, aProcessingStep uint8) {
-
-	onuTP.sOnuPersistentData.PersOnuID = onuTP.baseDeviceHandler.pOnuIndication.OnuId
-	onuTP.sOnuPersistentData.PersIntfID = onuTP.baseDeviceHandler.pOnuIndication.IntfId
-	onuTP.sOnuPersistentData.PersSnr = onuTP.baseDeviceHandler.pOnuOmciDevice.serialNumber
-	//TODO: verify usage of these values during restart UC
-	onuTP.sOnuPersistentData.PersAdminState = "up"
-	onuTP.sOnuPersistentData.PersOperState = "active"
-
-	onuTP.sOnuPersistentData.PersUniTpPath = onuTP.sOnuPersistentData.PersUniTpPath[:0]
-
-	for k, v := range onuTP.mapUniTpPath {
-		onuTP.sOnuPersistentData.PersUniTpPath =
-			append(onuTP.sOnuPersistentData.PersUniTpPath, uniPersData{PersUniID: k, PersTpPath: v})
-	}
-	logger.Debugw("Update ONU/TP-data in KVStore", log.Fields{"device-id": onuTP.deviceID, "onuTP.sOnuPersistentData": onuTP.sOnuPersistentData})
-
-	Value, err := json.Marshal(onuTP.sOnuPersistentData)
-	if err != nil {
-		logger.Errorw("unable to marshal ONU/TP-data", log.Fields{"onuTP.sOnuPersistentData": onuTP.sOnuPersistentData,
-			"device-id": onuTP.deviceID, "err": err})
-		onuTP.chTpKvProcessingStep <- 0 //error indication
-		return
-	}
-	err = onuTP.onuKVStore.Put(ctx, onuTP.onuKVStorePath, Value)
-	if err != nil {
-		logger.Errorw("unable to write ONU/TP-data into KVstore", log.Fields{"device-id": onuTP.deviceID, "err": err})
-		onuTP.chTpKvProcessingStep <- 0 //error indication
-		return
-	}
-	onuTP.chTpKvProcessingStep <- aProcessingStep //done
-}
-
-func (onuTP *onuUniTechProf) restorePersistentData(ctx context.Context) error {
-
-	onuTP.mapUniTpPath = make(map[uint32]string)
-	onuTP.sOnuPersistentData = onuPersistentData{0, 0, "", "", "", make([]uniPersData, 0)}
-
-	Value, err := onuTP.onuKVStore.Get(ctx, onuTP.onuKVStorePath)
-	if err == nil {
-		if Value != nil {
-			logger.Debugw("ONU/TP-data read",
-				log.Fields{"Key": Value.Key, "device-id": onuTP.deviceID})
-			tpTmpBytes, _ := kvstore.ToByte(Value.Value)
-
-			if err = json.Unmarshal(tpTmpBytes, &onuTP.sOnuPersistentData); err != nil {
-				logger.Errorw("unable to unmarshal ONU/TP-data", log.Fields{"error": err, "device-id": onuTP.deviceID})
-				return fmt.Errorf(fmt.Sprintf("unable-to-unmarshal-ONU/TP-data-%s", onuTP.deviceID))
-			}
-			logger.Debugw("ONU/TP-data", log.Fields{"onuTP.sOnuPersistentData": onuTP.sOnuPersistentData,
-				"device-id": onuTP.deviceID})
-
-			for _, uniData := range onuTP.sOnuPersistentData.PersUniTpPath {
-				onuTP.mapUniTpPath[uniData.PersUniID] = uniData.PersTpPath
-			}
-			logger.Debugw("TpPath map", log.Fields{"onuTP.mapUniTpPath": onuTP.mapUniTpPath,
-				"device-id": onuTP.deviceID})
-		} else {
-			logger.Errorw("no ONU/TP-data found", log.Fields{"path": onuTP.onuKVStorePath, "device-id": onuTP.deviceID})
-			return fmt.Errorf(fmt.Sprintf("no-ONU/TP-data-found-%s", onuTP.deviceID))
-		}
-	} else {
-		logger.Errorw("unable to read from KVstore", log.Fields{"device-id": onuTP.deviceID})
-		return fmt.Errorf(fmt.Sprintf("unable-to-read-from-KVstore-%s", onuTP.deviceID))
-	}
-	return nil
-}
-
-func (onuTP *onuUniTechProf) deletePersistentData(ctx context.Context) error {
-
-	logger.Debugw("delete ONU/TP-data in KVStore", log.Fields{"device-id": onuTP.deviceID})
-	err := onuTP.onuKVStore.Delete(ctx, onuTP.onuKVStorePath)
-	if err != nil {
-		logger.Errorw("unable to delete in KVstore", log.Fields{"device-id": onuTP.deviceID, "err": err})
-		return fmt.Errorf(fmt.Sprintf("unable-delete-in-KVstore-%s", onuTP.deviceID))
-	}
-	return nil
-}
-
 func (onuTP *onuUniTechProf) readAniSideConfigFromTechProfile(
 	ctx context.Context, aUniID uint8, aPathString string, aProcessingStep uint8) {
 	var tpInst tp.TechProfile
diff --git a/internal/pkg/onuadaptercore/platform.go b/internal/pkg/onuadaptercore/platform.go
index 3430247..cd4c923 100644
--- a/internal/pkg/onuadaptercore/platform.go
+++ b/internal/pkg/onuadaptercore/platform.go
@@ -128,7 +128,7 @@
 var controllerPorts = []uint32{0xfffd, 0x7ffffffd, 0xfffffffd}
 */
 
-//mkUniPortNum returns new UNIportNum based on intfID, inuID and uniID
+//mkUniPortNum returns new UNIportNum based on intfID, onuID and uniID
 func mkUniPortNum(intfID, onuID, uniID uint32) uint32 {
 	//extended for checks available in the python onu adapter:!!
 	var limit = int(intfID)
