diff --git a/VERSION b/VERSION
index 05471f1..385281e 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.7-dev
+0.1.9-dev
diff --git a/internal/pkg/onuadaptercore/device_handler.go b/internal/pkg/onuadaptercore/device_handler.go
index 1744406..e3f74e9 100644
--- a/internal/pkg/onuadaptercore/device_handler.go
+++ b/internal/pkg/onuadaptercore/device_handler.go
@@ -30,6 +30,7 @@
 	"github.com/gogo/protobuf/proto"
 	"github.com/golang/protobuf/ptypes"
 	"github.com/looplab/fsm"
+	me "github.com/opencord/omci-lib-go/generated"
 	"github.com/opencord/voltha-lib-go/v3/pkg/adapters/adapterif"
 	"github.com/opencord/voltha-lib-go/v3/pkg/log"
 	vc "github.com/opencord/voltha-protos/v3/go/common"
@@ -730,53 +731,57 @@
 	// PM related heartbeat??? !!!TODO....
 	//self._heartbeat.enabled = True
 
-	//example how to call FSM - transition up to state "uploading"
-	if dh.GetOnuDeviceEntry().MibSyncFsm.Is("disabled") {
-
-		if err := dh.GetOnuDeviceEntry().MibSyncFsm.Event("start"); err != nil {
-			logger.Errorw("MibSyncFsm: Can't go to state starting", log.Fields{"err": err})
-			return errors.New("Can't go to state starting")
-		} else {
-			logger.Debug("MibSyncFsm", log.Fields{"state": string(dh.GetOnuDeviceEntry().MibSyncFsm.Current())})
-			//Determine ONU status and start/re-start MIB Synchronization tasks
-			//Determine if this ONU has ever synchronized
-			if true { //TODO: insert valid check
-				if err := dh.GetOnuDeviceEntry().MibSyncFsm.Event("load_mib_template"); err != nil {
-					logger.Errorw("MibSyncFsm: Can't go to state loading_mib_template", log.Fields{"err": err})
-					return errors.New("Can't go to state loading_mib_template")
+	//call MibUploadFSM - transition up to state "in_sync"
+	pMibUlFsm := dh.GetOnuDeviceEntry().pMibUploadFsm.pFsm
+	if pMibUlFsm != nil {
+		if pMibUlFsm.Is("disabled") {
+			if err := pMibUlFsm.Event("start"); err != nil {
+				logger.Errorw("MibSyncFsm: Can't go to state starting", log.Fields{"err": err})
+				return errors.New("Can't go to state starting")
+			} else {
+				logger.Debug("MibSyncFsm", log.Fields{"state": string(pMibUlFsm.Current())})
+				//Determine ONU status and start/re-start MIB Synchronization tasks
+				//Determine if this ONU has ever synchronized
+				if true { //TODO: insert valid check
+					if err := pMibUlFsm.Event("load_mib_template"); err != nil {
+						logger.Errorw("MibSyncFsm: Can't go to state loading_mib_template", log.Fields{"err": err})
+						return errors.New("Can't go to state loading_mib_template")
+					} else {
+						logger.Debug("MibSyncFsm", log.Fields{"state": string(pMibUlFsm.Current())})
+						//Find and load a mib template. If not found proceed with mib_upload
+						// callbacks to be handled:
+						// Event("success")
+						// Event("timeout")
+						//no mib template found
+						if true { //TODO: insert valid check
+							if err := pMibUlFsm.Event("upload_mib"); err != nil {
+								logger.Errorw("MibSyncFsm: Can't go to state uploading", log.Fields{"err": err})
+								return errors.New("Can't go to state uploading")
+							} else {
+								logger.Debug("state of MibSyncFsm", log.Fields{"state": string(pMibUlFsm.Current())})
+								//Begin full MIB data upload, starting with a MIB RESET
+								// callbacks to be handled:
+								// success: e.Event("success")
+								// failure: e.Event("timeout")
+							}
+						}
+					}
 				} else {
-					logger.Debug("MibSyncFsm", log.Fields{"state": string(dh.GetOnuDeviceEntry().MibSyncFsm.Current())})
-					//Find and load a mib template. If not found proceed with mib_upload
+					pMibUlFsm.Event("examine_mds")
+					logger.Debug("state of MibSyncFsm", log.Fields{"state": string(pMibUlFsm.Current())})
+					//Examine the MIB Data Sync
 					// callbacks to be handled:
 					// Event("success")
 					// Event("timeout")
-					//no mib template found
-					if true { //TODO: insert valid check
-						if err := dh.GetOnuDeviceEntry().MibSyncFsm.Event("upload_mib"); err != nil {
-							logger.Errorw("MibSyncFsm: Can't go to state uploading", log.Fields{"err": err})
-							return errors.New("Can't go to state uploading")
-						} else {
-							logger.Debug("state of MibSyncFsm", log.Fields{"state": string(dh.GetOnuDeviceEntry().MibSyncFsm.Current())})
-							//Begin full MIB data upload, starting with a MIB RESET
-							// callbacks to be handled:
-							// success: e.Event("success")
-							// failure: e.Event("timeout")
-						}
-					}
+					// Event("mismatch")
 				}
-			} else {
-				dh.GetOnuDeviceEntry().MibSyncFsm.Event("examine_mds")
-				logger.Debug("state of MibSyncFsm", log.Fields{"state": string(dh.GetOnuDeviceEntry().MibSyncFsm.Current())})
-				//Examine the MIB Data Sync
-				// callbacks to be handled:
-				// Event("success")
-				// Event("timeout")
-				// Event("mismatch")
 			}
+		} else {
+			logger.Errorw("wrong state of MibSyncFsm - want: disabled", log.Fields{"have": string(pMibUlFsm.Current())})
+			return errors.New("wrong state of MibSyncFsm")
 		}
 	} else {
-		logger.Errorw("wrong state of MibSyncFsm - want: disabled", log.Fields{"have": string(dh.GetOnuDeviceEntry().MibSyncFsm.Current())})
-		return errors.New("wrong state of MibSyncFsm")
+		logger.Errorw("MibSyncFsm invalid - cannot be executed!!", log.Fields{"deviceID": dh.deviceID})
 	}
 	return nil
 }
@@ -794,44 +799,50 @@
 			logger.Errorw("error-DeviceReasonUpdate to 'mibsync-complete'", log.Fields{"deviceID": dh.deviceID, "error": err})
 		}
 
-		for i := uint16(0); i < dh.GetOnuDeviceEntry().pOnuDB.unigMeCount; i++ {
-			mgmtEntityId, _ := dh.GetOnuDeviceEntry().pOnuDB.unigMe[i].GetAttribute("ManagedEntityId")
-			logger.Debugw("Add UNI port for stored UniG instance:", log.Fields{"deviceId": dh.GetOnuDeviceEntry().deviceID, "UnigMe EntityID": mgmtEntityId})
-			dh.addUniPort(mgmtEntityId.(uint16), i, UniPPTP)
-		}
-
-		// fixed assumption about PPTP/UNI-G ONU-config
-		// to be replaced by DB parsing of MibUpload data TODO!!!
-		// parameters are: InstanceNo, running UniNo, type
-		// dh.addUniPort(257, 0, UniPPTP)
-		// dh.addUniPort(258, 1, UniPPTP)
-		// dh.addUniPort(259, 2, UniPPTP)
-		// dh.addUniPort(260, 3, UniPPTP)
-
-		// start the MibDownload (assumed here to be done via some FSM again - open //TODO!!!)
-		/* the mib-download code may look something like that:
-		if err := dh.GetOnuDeviceEntry().MibDownloadFsm.Event("start"); err != nil {
-			logger.Errorw("MibDownloadFsm: Can't go to state starting", log.Fields{"err": err})
-			return errors.New("Can't go to state starting")
-		} else {
-			logger.Debug("MibDownloadFsm", log.Fields{"state": string(dh.GetOnuDeviceEntry().MibDownloadFsm.Current())})
-			//Determine ONU status and start/re-start MIB MibDownloadFsm
-			//Determine if this ONU has ever synchronized
-			if true { //TODO: insert valid check
-				if err := dh.GetOnuDeviceEntry().MibSyncFsm.Event("download_mib"); err != nil {
-					logger.Errorw("MibDownloadFsm: Can't go to state 'download_mib'", log.Fields{"err": err})
-					return errors.New("Can't go to state 'download_mib'")
-				} else {
-					//some further processing ???
-					logger.Debug("state of MibDownloadFsm", log.Fields{"state": string(dh.GetOnuDeviceEntry().MibDownloadFsm.Current())})
-					//some further processing ???
-				}
+		unigMap, ok := dh.GetOnuDeviceEntry().pOnuDB.meDb[me.UniGClassID]
+		unigInstKeys := dh.GetOnuDeviceEntry().pOnuDB.GetSortedInstKeys(unigMap)
+		if ok {
+			i := uint16(0)
+			for _, mgmtEntityId := range unigInstKeys {
+				logger.Debugw("Add UNI port for stored UniG instance:", log.Fields{"deviceId": dh.GetOnuDeviceEntry().deviceID, "UnigMe EntityID": mgmtEntityId})
+				dh.addUniPort(mgmtEntityId, i, UniPPTP)
+				i++
 			}
+		} else {
+			logger.Warnw("No UniG instances found!", log.Fields{"deviceId": dh.GetOnuDeviceEntry().deviceID})
 		}
-		but by now we shortcut the download here and immediately fake the ONU-active state to get the state indication on ONUS!!!:
-		*/
-		//shortcut code to fake download-done!!!:
+
+		/*  real Mib download procedure could look somthing like this:
+		 ***** but for the moment the FSM is still limited (sending no OMCI)  *****
+		 ***** thus never reaches 'downloaded' state                          *****
+		 */
+		pMibDlFsm := dh.GetOnuDeviceEntry().pMibDownloadFsm.pFsm
+		if pMibDlFsm != nil {
+			if pMibDlFsm.Is("disabled") {
+				if err := pMibDlFsm.Event("start"); err != nil {
+					logger.Errorw("MibDownloadFsm: Can't go to state starting", log.Fields{"err": err})
+					// maybe try a FSM restart and then again ... - TODO!!!
+				} else {
+					logger.Debug("MibDownloadFsm", log.Fields{"state": string(pMibDlFsm.Current())})
+					// maybe use more specific states here for the specific download steps ...
+					if err := pMibDlFsm.Event("download_mib"); err != nil {
+						logger.Errorw("MibDownloadFsm: Can't go to state downloading", log.Fields{"err": err})
+					} else {
+						logger.Debug("state of MibDownloadFsm", log.Fields{"state": string(pMibDlFsm.Current())})
+						//Begin MIB data download
+					}
+				}
+			} else {
+				logger.Errorw("wrong state of MibDownloadFsm - want: disabled", log.Fields{"have": string(pMibDlFsm.Current())})
+			}
+			/***** Mib download started */
+		} else {
+			logger.Errorw("MibDownloadFsm invalid - cannot be executed!!", log.Fields{"deviceID": dh.deviceID})
+		}
+
+		//shortcut code to fake download-done!!!:  TODO!!! to be removed with complete DL FSM
 		go dh.GetOnuDeviceEntry().transferSystemEvent(MibDownloadDone)
+
 	} else if dev_Event == MibDownloadDone {
 		logger.Debugw("MibDownloadDone event: update dev state to 'Oper.Active'", log.Fields{"deviceID": dh.deviceID})
 		//initiate DevStateUpdate
diff --git a/internal/pkg/onuadaptercore/mib_download.go b/internal/pkg/onuadaptercore/mib_download.go
new file mode 100644
index 0000000..1a83136
--- /dev/null
+++ b/internal/pkg/onuadaptercore/mib_download.go
@@ -0,0 +1,149 @@
+/*
+ * Copyright 2020-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 adaptercoreonu provides the utility for onu devices, flows and statistics
+package adaptercoreonu
+
+import (
+	"github.com/looplab/fsm"
+
+	//"sync"
+	//"time"
+
+	//"github.com/opencord/voltha-lib-go/v3/pkg/kafka"
+
+	"github.com/opencord/voltha-lib-go/v3/pkg/log"
+	//ic "github.com/opencord/voltha-protos/v3/go/inter_container"
+	//"github.com/opencord/voltha-protos/v3/go/openflow_13"
+	//"github.com/opencord/voltha-protos/v3/go/voltha"
+)
+
+func (onuDeviceEntry *OnuDeviceEntry) enterDLStartingState(e *fsm.Event) {
+	logger.Debugw("MibDownload FSM", log.Fields{"Start downloading OMCI MIB in State": e.FSM.Current(), "device-id": onuDeviceEntry.deviceID})
+
+	// start go routine for processing of MibDownload messages
+	go onuDeviceEntry.ProcessMibDownloadMessages()
+}
+
+func (onuDeviceEntry *OnuDeviceEntry) enterDownloadingState(e *fsm.Event) {
+	logger.Debugw("MibDownload FSM", log.Fields{"GAL Ethernet Profile set in State": e.FSM.Current(), "device-id": onuDeviceEntry.deviceID})
+	//onuDeviceEntry.PDevOmciCC.sendGalEthernetProfileSet(context.TODO(), ConstDefaultOmciTimeout, true)
+}
+
+func (onuDeviceEntry *OnuDeviceEntry) enterDownloadedState(e *fsm.Event) {
+	logger.Debugw("MibDownload FSM", log.Fields{"send notification to core in State": e.FSM.Current(), "device-id": onuDeviceEntry.deviceID})
+	onuDeviceEntry.transferSystemEvent(MibDownloadDone)
+}
+
+func (onuDeviceEntry *OnuDeviceEntry) ProcessMibDownloadMessages( /*ctx context.Context*/ ) {
+	logger.Debugw("MibDownload Msg", log.Fields{"Start routine to process OMCI-messages for device-id": onuDeviceEntry.deviceID})
+loop:
+	for {
+		select {
+		// case <-ctx.Done():
+		// 	logger.Info("MibSync Msg", log.Fields{"Message handling canceled via context for device-id": onuDeviceEntry.deviceID})
+		// 	break loop
+		case message, ok := <-onuDeviceEntry.pMibDownloadFsm.commChan:
+			if !ok {
+				logger.Info("MibDownload Msg", log.Fields{"Message couldn't be read from channel for device-id": onuDeviceEntry.deviceID})
+				break loop
+			}
+			logger.Debugw("MibDownload Msg", log.Fields{"Received OMCI message for device-id": onuDeviceEntry.deviceID})
+
+			if message.Type != OMCI {
+				logger.Warn("MibDownload Msg", log.Fields{"Unknown message type received for device-id": onuDeviceEntry.deviceID,
+					"message.Type": message.Type})
+			} else {
+				msg, _ := message.Data.(OmciMessage)
+				onuDeviceEntry.handleOmciMibDownloadMessage(msg)
+			}
+		}
+	}
+	logger.Info("MibDownload Msg", log.Fields{"Stop receiving messages for device-id": onuDeviceEntry.deviceID})
+	// TODO: only this action?
+	onuDeviceEntry.pMibDownloadFsm.pFsm.Event("restart")
+}
+
+func (onuDeviceEntry *OnuDeviceEntry) handleOmciMibDownloadMessage(msg OmciMessage) {
+
+	logger.Debugw("Rx OMCI MibDownload Msg", log.Fields{"device-id": onuDeviceEntry.deviceID,
+		"msgType": msg.OmciMsg.MessageType})
+
+	//further analysis could be done here based on msg.OmciMsg.Payload, e.g. verification of error code ...
+	/*
+		switch msg.OmciMsg.MessageType {
+		case omci.MibResetResponseType:
+			msgLayer := (*msg.OmciPacket).Layer(omci.LayerTypeMibResetResponse)
+			if msgLayer == nil {
+				logger.Error("Omci Msg layer could not be detected")
+				return
+			}
+			msgObj, msgOk := msgLayer.(*omci.MibResetResponse)
+			if !msgOk {
+				logger.Error("Omci Msg layer could not be assigned")
+				return
+			}
+			logger.Debugw("MibResetResponse Data", log.Fields{"data-fields": msgObj})
+			if msgObj.Result != me.Success {
+				logger.Errorw("Omci MibResetResponse Error - strange - what to do?", log.Fields{"Error": msgObj.Result})
+				return
+			}
+			onuDeviceEntry.PDevOmciCC.sendMibUpload(context.TODO(), ConstDefaultOmciTimeout, true)
+		case omci.MibUploadResponseType:
+			msgLayer := (*msg.OmciPacket).Layer(omci.LayerTypeMibUploadResponse)
+			if msgLayer == nil {
+				logger.Error("Omci Msg layer could not be detected")
+				return
+			}
+			msgObj, msgOk := msgLayer.(*omci.MibUploadResponse)
+			if !msgOk {
+				logger.Error("Omci Msg layer could not be assigned")
+				return
+			}
+			logger.Debugw("MibUploadResponse Data for:", log.Fields{"deviceId": onuDeviceEntry.deviceID, "data-fields": msgObj})
+			// to be verified / reworked !!!
+			onuDeviceEntry.PDevOmciCC.uploadNoOfCmds = msgObj.NumberOfCommands
+			if onuDeviceEntry.PDevOmciCC.uploadSequNo < onuDeviceEntry.PDevOmciCC.uploadNoOfCmds {
+				onuDeviceEntry.PDevOmciCC.sendMibUploadNext(context.TODO(), ConstDefaultOmciTimeout, true)
+			} else {
+				logger.Error("Invalid number of commands received for:", log.Fields{"deviceId": onuDeviceEntry.deviceID, "uploadNoOfCmds": onuDeviceEntry.PDevOmciCC.uploadNoOfCmds})
+				//TODO right action?
+				onuDeviceEntry.MibSyncFsm.Event("timeout")
+			}
+		case omci.MibUploadNextResponseType:
+			msgLayer := (*msg.OmciPacket).Layer(omci.LayerTypeMibUploadNextResponse)
+			if msgLayer == nil {
+				logger.Error("Omci Msg layer could not be detected")
+				return
+			}
+			msgObj, msgOk := msgLayer.(*omci.MibUploadNextResponse)
+			if !msgOk {
+				logger.Error("Omci Msg layer could not be assigned")
+				return
+			}
+			logger.Debugw("MibUploadNextResponse Data for:", log.Fields{"deviceId": onuDeviceEntry.deviceID, "data-fields": msgObj})
+
+			onuDeviceEntry.pOnuDB.StoreMe(msgObj)
+
+			if onuDeviceEntry.PDevOmciCC.uploadSequNo < onuDeviceEntry.PDevOmciCC.uploadNoOfCmds {
+				onuDeviceEntry.PDevOmciCC.sendMibUploadNext(context.TODO(), ConstDefaultOmciTimeout, true)
+			} else {
+				//TODO
+				onuDeviceEntry.MibSyncFsm.Event("success")
+			}
+		}
+	*/
+}
diff --git a/internal/pkg/onuadaptercore/mib_sync.go b/internal/pkg/onuadaptercore/mib_sync.go
index ba4c429..d15ae03 100644
--- a/internal/pkg/onuadaptercore/mib_sync.go
+++ b/internal/pkg/onuadaptercore/mib_sync.go
@@ -35,17 +35,11 @@
 	//"github.com/opencord/voltha-protos/v3/go/voltha"
 )
 
-func (onuDeviceEntry *OnuDeviceEntry) logStateChange(e *fsm.Event) {
-	logger.Debugw("MibSync FSM", log.Fields{"event name": string(e.Event), "src state": string(e.Src), "dst state": string(e.Dst), "device-id": onuDeviceEntry.deviceID})
-}
-
 func (onuDeviceEntry *OnuDeviceEntry) enterStartingState(e *fsm.Event) {
 	logger.Debugw("MibSync FSM", log.Fields{"Start processing MibSync-msgs in State": e.FSM.Current(), "device-id": onuDeviceEntry.deviceID})
 
 	onuDeviceEntry.pOnuDB = NewOnuDeviceDB(context.TODO(), onuDeviceEntry)
 
-	// create channel and start go routine for processing of MibSync messages
-	onuDeviceEntry.MibSyncChan = make(chan Message, 2048)
 	go onuDeviceEntry.ProcessMibSyncMessages()
 }
 
@@ -92,7 +86,7 @@
 		// case <-ctx.Done():
 		// 	logger.Info("MibSync Msg", log.Fields{"Message handling canceled via context for device-id": onuDeviceEntry.deviceID})
 		// 	break loop
-		case message, ok := <-onuDeviceEntry.MibSyncChan:
+		case message, ok := <-onuDeviceEntry.pMibUploadFsm.commChan:
 			if !ok {
 				logger.Info("MibSync Msg", log.Fields{"Message couldn't be read from channel for device-id": onuDeviceEntry.deviceID})
 				break loop
@@ -113,7 +107,7 @@
 	}
 	logger.Info("MibSync Msg", log.Fields{"Stopped handling of MibSyncChan for device-id": onuDeviceEntry.deviceID})
 	// TODO: only this action?
-	onuDeviceEntry.MibSyncFsm.Event("stop")
+	onuDeviceEntry.pMibUploadFsm.pFsm.Event("stop")
 }
 
 func (onuDeviceEntry *OnuDeviceEntry) handleTestMsg(msg TestMessage) {
@@ -122,8 +116,8 @@
 
 	switch msg.TestMessageVal {
 	case AnyTriggerForMibSyncUploadMib:
-		onuDeviceEntry.MibSyncFsm.Event("upload_mib")
-		logger.Debugw("MibSync Msg", log.Fields{"state": string(onuDeviceEntry.MibSyncFsm.Current())})
+		onuDeviceEntry.pMibUploadFsm.pFsm.Event("upload_mib")
+		logger.Debugw("MibSync Msg", log.Fields{"state": string(onuDeviceEntry.pMibUploadFsm.pFsm.Current())})
 	default:
 		logger.Warn("MibSync Msg", log.Fields{"Unknown message type received for device-id": onuDeviceEntry.deviceID, "msg.TestMessageVal": msg.TestMessageVal})
 	}
@@ -172,7 +166,7 @@
 		} else {
 			logger.Error("Invalid number of commands received for:", log.Fields{"deviceId": onuDeviceEntry.deviceID, "uploadNoOfCmds": onuDeviceEntry.PDevOmciCC.uploadNoOfCmds})
 			//TODO right action?
-			onuDeviceEntry.MibSyncFsm.Event("timeout")
+			onuDeviceEntry.pMibUploadFsm.pFsm.Event("timeout")
 		}
 	case omci.MibUploadNextResponseType:
 		msgLayer := (*msg.OmciPacket).Layer(omci.LayerTypeMibUploadNextResponse)
@@ -193,7 +187,8 @@
 			onuDeviceEntry.PDevOmciCC.sendMibUploadNext(context.TODO(), ConstDefaultOmciTimeout, true)
 		} else {
 			//TODO
-			onuDeviceEntry.MibSyncFsm.Event("success")
+			onuDeviceEntry.pOnuDB.LogMeDb()
+			onuDeviceEntry.pMibUploadFsm.pFsm.Event("success")
 		}
 	}
 }
diff --git a/internal/pkg/onuadaptercore/omci_cc.go b/internal/pkg/onuadaptercore/omci_cc.go
index 0d40873..c712b1d 100644
--- a/internal/pkg/onuadaptercore/omci_cc.go
+++ b/internal/pkg/onuadaptercore/omci_cc.go
@@ -531,7 +531,7 @@
 		},
 	}
 	//logger.Debugw("Message to be sent into channel:", log.Fields{"mibSyncMsg": mibSyncMsg})
-	(*oo.pOnuDeviceEntry).MibSyncChan <- mibSyncMsg
+	(*oo.pOnuDeviceEntry).pMibUploadFsm.commChan <- mibSyncMsg
 
 	return nil
 }
diff --git a/internal/pkg/onuadaptercore/onu_device_db.go b/internal/pkg/onuadaptercore/onu_device_db.go
index 2729747..0b985d6 100644
--- a/internal/pkg/onuadaptercore/onu_device_db.go
+++ b/internal/pkg/onuadaptercore/onu_device_db.go
@@ -19,23 +19,20 @@
 
 import (
 	"context"
-	"errors"
+	"sort"
 
 	"github.com/opencord/omci-lib-go"
 	me "github.com/opencord/omci-lib-go/generated"
 	"github.com/opencord/voltha-lib-go/v3/pkg/log"
 )
 
+type MeDbMap map[me.ClassID]map[uint16]me.AttributeValueMap
+
 //OnuDeviceDB structure holds information about known ME's
 type OnuDeviceDB struct {
-	ctx               context.Context
-	pOnuDeviceEntry   *OnuDeviceEntry
-	unigMeCount       uint16
-	unigMe            []*me.ManagedEntity
-	pptpEthUniMeCount uint16
-	pptpEthUniMe      []*me.ManagedEntity
-	AnigMe            *me.ManagedEntity
-	VeipMe            *me.ManagedEntity
+	ctx             context.Context
+	pOnuDeviceEntry *OnuDeviceEntry
+	meDb            MeDbMap
 }
 
 //OnuDeviceDB returns a new instance for a specific ONU_Device_Entry
@@ -44,91 +41,64 @@
 	var onuDeviceDB OnuDeviceDB
 	onuDeviceDB.ctx = ctx
 	onuDeviceDB.pOnuDeviceEntry = a_pOnuDeviceEntry
-	onuDeviceDB.unigMeCount = 0
-	onuDeviceDB.unigMe = make([]*me.ManagedEntity, 4, MaxUnisPerOnu)
-	onuDeviceDB.pptpEthUniMeCount = 0
-	onuDeviceDB.pptpEthUniMe = make([]*me.ManagedEntity, 4, MaxUnisPerOnu)
-	onuDeviceDB.AnigMe = nil
-	onuDeviceDB.VeipMe = nil
+	onuDeviceDB.meDb = make(MeDbMap)
+
 	return &onuDeviceDB
 }
 
-func (onuDeviceDB *OnuDeviceDB) UnigAdd(meParamData me.ParamData) error {
-	var omciErr me.OmciErrors
-	onuDeviceDB.unigMe[onuDeviceDB.unigMeCount], omciErr = me.NewUniG(meParamData)
-	if omciErr.StatusCode() != me.Success {
-		logger.Errorw("UniG could not be parsed for:", log.Fields{"deviceId": onuDeviceDB.pOnuDeviceEntry.deviceID})
-		return errors.New("UniG could not be parsed")
+func (onuDeviceDB *OnuDeviceDB) StoreMe(a_pMibUpResp *omci.MibUploadNextResponse) {
+
+	meClassId := a_pMibUpResp.ReportedME.GetClassID()
+	meEntityId := a_pMibUpResp.ReportedME.GetEntityID()
+	meAttributes := a_pMibUpResp.ReportedME.GetAttributeValueMap()
+
+	//filter out the OnuData
+	if me.OnuDataClassID == meClassId {
+		return
 	}
-	logger.Debugw("UniG instance stored for:", log.Fields{"deviceId": onuDeviceDB.pOnuDeviceEntry.deviceID,
-		"UnigMe ": onuDeviceDB.unigMe[onuDeviceDB.unigMeCount], "unigMeCount": onuDeviceDB.unigMeCount})
-	if onuDeviceDB.unigMeCount < MaxUnisPerOnu {
-		onuDeviceDB.unigMeCount++
+
+	logger.Debugw("Search for key data :", log.Fields{"deviceId": onuDeviceDB.pOnuDeviceEntry.deviceID, "meClassId": meClassId, "meEntityId": meEntityId})
+	meInstMap, ok := onuDeviceDB.meDb[meClassId]
+	if !ok {
+		logger.Debugw("meClassId not found - add to db :", log.Fields{"deviceId": onuDeviceDB.pOnuDeviceEntry.deviceID})
+		meInstMap = make(map[uint16]me.AttributeValueMap)
+		onuDeviceDB.meDb[meClassId] = meInstMap
+		onuDeviceDB.meDb[meClassId][meEntityId] = meAttributes
 	} else {
-		logger.Errorw("Max number of UniGs exceeded for:", log.Fields{"deviceId": onuDeviceDB.pOnuDeviceEntry.deviceID})
-		return errors.New("Max number of UniGs exceeded")
+		meAttribs, ok := onuDeviceDB.meDb[meClassId][meEntityId]
+		if !ok {
+			logger.Debugw("meEntityId not found - add to db :", log.Fields{"deviceId": onuDeviceDB.pOnuDeviceEntry.deviceID})
+			onuDeviceDB.meDb[meClassId][meEntityId] = meAttributes
+		} else {
+			logger.Debugw("ME-Instance exists already: merge attribute data :", log.Fields{"deviceId": onuDeviceDB.pOnuDeviceEntry.deviceID, "meAttribs": meAttribs})
+
+			for k, v := range meAttributes {
+				meAttribs[k] = v
+			}
+			onuDeviceDB.meDb[meClassId][meEntityId] = meAttribs
+			logger.Debugw("ME-Instance updated :", log.Fields{"deviceId": onuDeviceDB.pOnuDeviceEntry.deviceID, "meAttribs": meAttribs})
+		}
 	}
-	return nil
 }
 
-func (onuDeviceDB *OnuDeviceDB) PptpEthUniAdd(meParamData me.ParamData) error {
-	var omciErr me.OmciErrors
-	onuDeviceDB.pptpEthUniMe[onuDeviceDB.pptpEthUniMeCount], omciErr = me.NewPhysicalPathTerminationPointEthernetUni(meParamData)
-	if omciErr.StatusCode() != me.Success {
-		logger.Errorw("pptpEthUni could not be parsed for:", log.Fields{"deviceId": onuDeviceDB.pOnuDeviceEntry.deviceID})
-		return errors.New("pptpEthUni could not be parsed")
+func (onuDeviceDB *OnuDeviceDB) GetSortedInstKeys(meInstMap map[uint16]me.AttributeValueMap) []uint16 {
+
+	var meInstKeys []uint16
+
+	for k := range meInstMap {
+		meInstKeys = append(meInstKeys, k)
 	}
-	logger.Debugw("pptpEthUni instance stored for:", log.Fields{"deviceId": onuDeviceDB.pOnuDeviceEntry.deviceID,
-		"pptpEthUniMe ": onuDeviceDB.pptpEthUniMe[onuDeviceDB.pptpEthUniMeCount], "pptpEthUniMeCount": onuDeviceDB.pptpEthUniMeCount})
-	if onuDeviceDB.pptpEthUniMeCount < MaxUnisPerOnu {
-		onuDeviceDB.pptpEthUniMeCount++
-	} else {
-		logger.Errorw("Max number of pptpEthUnis exceeded for:", log.Fields{"deviceId": onuDeviceDB.pOnuDeviceEntry.deviceID})
-		return errors.New("Max number of pptpEthUnis exceeded")
-	}
-	return nil
+	logger.Debugw("meInstKeys - input order :", log.Fields{"meInstKeys": meInstKeys}) //TODO: delete the line after test phase!
+	sort.Slice(meInstKeys, func(i, j int) bool { return meInstKeys[i] < meInstKeys[j] })
+	logger.Debugw("meInstKeys - output order :", log.Fields{"meInstKeys": meInstKeys}) //TODO: delete the line after test phase!
+	return meInstKeys
 }
 
-func (onuDeviceDB *OnuDeviceDB) AnigAdd(meParamData me.ParamData) error {
-	var omciErr me.OmciErrors
-	onuDeviceDB.AnigMe, omciErr = me.NewAniG(meParamData)
-	if omciErr.StatusCode() != me.Success {
-		logger.Errorw("AniG could not be parsed for:", log.Fields{"deviceId": onuDeviceDB.pOnuDeviceEntry.deviceID})
-		return errors.New("AniG could not be parsed")
+func (onuDeviceDB *OnuDeviceDB) LogMeDb() {
+	logger.Debugw("ME instances stored for :", log.Fields{"deviceId": onuDeviceDB.pOnuDeviceEntry.deviceID})
+	for meClassId, meInstMap := range onuDeviceDB.meDb {
+		for meEntityId, meAttribs := range meInstMap {
+			logger.Debugw("ME instance: ", log.Fields{"meClassId": meClassId, "meEntityId": meEntityId, "meAttribs": meAttribs, "deviceId": onuDeviceDB.pOnuDeviceEntry.deviceID})
+		}
 	}
-	logger.Debugw("AniG instance stored for:", log.Fields{"deviceId": onuDeviceDB.pOnuDeviceEntry.deviceID, "AnigMe ": onuDeviceDB.AnigMe})
-	return nil
-}
-
-func (onuDeviceDB *OnuDeviceDB) VeipAdd(meParamData me.ParamData) error {
-	var omciErr me.OmciErrors
-	onuDeviceDB.VeipMe, omciErr = me.NewVirtualEthernetInterfacePoint(meParamData)
-	if omciErr.StatusCode() != me.Success {
-		logger.Errorw("VEIP could not be parsed for:", log.Fields{"deviceId": onuDeviceDB.pOnuDeviceEntry.deviceID})
-		return errors.New("VEIP could not be parsed")
-	}
-	logger.Debugw("VEIP instance stored for:", log.Fields{"deviceId": onuDeviceDB.pOnuDeviceEntry.deviceID, "VeipMe ": onuDeviceDB.VeipMe})
-	return nil
-}
-
-func (onuDeviceDB *OnuDeviceDB) StoreMe(a_pMibUpResp *omci.MibUploadNextResponse) error {
-
-	meParamData := me.ParamData{
-		EntityID:   a_pMibUpResp.ReportedME.GetEntityID(),
-		Attributes: a_pMibUpResp.ReportedME.GetAttributeValueMap(),
-	}
-
-	switch a_pMibUpResp.ReportedME.GetClassID() {
-	case me.UniGClassID:
-		onuDeviceDB.UnigAdd(meParamData)
-	case me.PhysicalPathTerminationPointEthernetUniClassID:
-		onuDeviceDB.PptpEthUniAdd(meParamData)
-	case me.AniGClassID:
-		onuDeviceDB.AnigAdd(meParamData)
-	case me.VirtualEthernetInterfacePointClassID:
-		onuDeviceDB.VeipAdd(meParamData)
-	default:
-		//ME won't be stored currently
-	}
-	return nil
 }
diff --git a/internal/pkg/onuadaptercore/onu_device_entry.go b/internal/pkg/onuadaptercore/onu_device_entry.go
index 25c7c20..62b86c0 100644
--- a/internal/pkg/onuadaptercore/onu_device_entry.go
+++ b/internal/pkg/onuadaptercore/onu_device_entry.go
@@ -54,6 +54,28 @@
 }
 type OmciDeviceFsms map[string]activityDescr
 
+type AdapterFsm struct {
+	fsmName  string
+	deviceID string
+	commChan chan Message
+	pFsm     *fsm.FSM
+}
+
+func NewAdapterFsm(a_name string, a_deviceID string, a_commChannel chan Message) *AdapterFsm {
+	aFsm := &AdapterFsm{
+		fsmName:  a_name,
+		deviceID: a_deviceID,
+		commChan: a_commChannel,
+	}
+	return aFsm
+}
+
+//Start starts (logs) the omci agent
+func (oo *AdapterFsm) logFsmStateChange(e *fsm.Event) {
+	logger.Debugw("FSM state change", log.Fields{"device-id": oo.deviceID, "FSM name": oo.fsmName,
+		"event name": string(e.Event), "src state": string(e.Src), "dst state": string(e.Dst)})
+}
+
 //OntDeviceEntry structure holds information about the attached FSM'as and their communication
 type OnuDeviceEntry struct {
 	deviceID          string
@@ -66,10 +88,18 @@
 	//lockDeviceEntries           sync.RWMutex
 	mibDbClass    func() error
 	supportedFsms OmciDeviceFsms
-	MibSyncFsm    *fsm.FSM
-	MibSyncChan   chan Message
 	devState      OnuDeviceEvent
+	// for mibUpload
 	mibAuditDelay uint16
+	//MibSyncFsm    *fsm.FSM
+	//MibSyncChan   chan Message
+	pMibUploadFsm *AdapterFsm //could be handled dynamically and more general as pAdapterFsm - perhaps later
+	// for mibDownload
+	//MibDownloadFsm  *fsm.FSM
+	//MibDownloadChan chan Message
+	pMibDownloadFsm *AdapterFsm //could be handled dynamically and more general as pAdapterFsm - perhaps later
+	//remark: general usage of pAdapterFsm would require generalization of commChan  usage and internal event setting
+	//  within the FSM event procedures
 }
 
 //OnuDeviceEntry returns a new instance of a OnuDeviceEntry
@@ -119,8 +149,10 @@
 	onuDeviceEntry.mibAuditDelay = onuDeviceEntry.supportedFsms["mib-synchronizer"].auditDelay
 	logger.Debugw("MibAudit is set to", log.Fields{"Delay": onuDeviceEntry.mibAuditDelay})
 
-	// Omci related Mib sync state machine
-	onuDeviceEntry.MibSyncFsm = fsm.NewFSM(
+	// Omci related Mib upload sync state machine
+	mibUploadChan := make(chan Message, 2048)
+	onuDeviceEntry.pMibUploadFsm = NewAdapterFsm("MibUpload", device_id, mibUploadChan)
+	onuDeviceEntry.pMibUploadFsm.pFsm = fsm.NewFSM(
 		"disabled",
 		fsm.Events{
 
@@ -154,7 +186,7 @@
 		},
 
 		fsm.Callbacks{
-			"enter_state":                func(e *fsm.Event) { onuDeviceEntry.logStateChange(e) },
+			"enter_state":                func(e *fsm.Event) { onuDeviceEntry.pMibDownloadFsm.logFsmStateChange(e) },
 			"enter_starting":             func(e *fsm.Event) { onuDeviceEntry.enterStartingState(e) },
 			"enter_loading_mib_template": func(e *fsm.Event) { onuDeviceEntry.enterLoadingMibTemplateState(e) },
 			"enter_uploading":            func(e *fsm.Event) { onuDeviceEntry.enterUploadingState(e) },
@@ -165,6 +197,35 @@
 			"enter_in_sync":              func(e *fsm.Event) { onuDeviceEntry.enterInSyncState(e) },
 		},
 	)
+	// Omci related Mib download state machine
+	mibDownloadChan := make(chan Message, 2048)
+	onuDeviceEntry.pMibDownloadFsm = NewAdapterFsm("MibDownload", device_id, mibDownloadChan)
+	onuDeviceEntry.pMibDownloadFsm.pFsm = fsm.NewFSM(
+		"disabled",
+		fsm.Events{
+
+			{Name: "start", Src: []string{"disabled"}, Dst: "starting"},
+
+			{Name: "download_mib", Src: []string{"starting"}, Dst: "downloading"},
+
+			{Name: "success", Src: []string{"downloading"}, Dst: "downloaded"},
+
+			{Name: "timeout", Src: []string{"downloading"}, Dst: "starting"},
+
+			{Name: "restart", Src: []string{"starting", "downloading", "downloaded"}, Dst: "disabled"},
+		},
+
+		fsm.Callbacks{
+			"enter_state":       func(e *fsm.Event) { onuDeviceEntry.pMibDownloadFsm.logFsmStateChange(e) },
+			"enter_starting":    func(e *fsm.Event) { onuDeviceEntry.enterDLStartingState(e) },
+			"enter_downloading": func(e *fsm.Event) { onuDeviceEntry.enterDownloadingState(e) },
+			"enter_downloaded":  func(e *fsm.Event) { onuDeviceEntry.enterDownloadedState(e) },
+		},
+	)
+	if onuDeviceEntry.pMibDownloadFsm == nil || onuDeviceEntry.pMibDownloadFsm.pFsm == nil {
+		logger.Error("MibDownloadFsm could not be instantiated!!")
+		// some specifc error treatment - or waiting for crash ???
+	}
 
 	// Alarm Synchronization Database
 	//self._alarm_db = None
