added javadocs and comments
diff --git a/src/main/java/org.onosproject.xran/controller/Controller.java b/src/main/java/org.onosproject.xran/controller/Controller.java
index 2191f5b..946a1bd 100644
--- a/src/main/java/org.onosproject.xran/controller/Controller.java
+++ b/src/main/java/org.onosproject.xran/controller/Controller.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-present Open Networking Laboratory
+ * Copyright 2015-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.
@@ -42,6 +42,9 @@
     private int port = 8007;
     private boolean isRunning = false;
 
+    /**
+     * Run SCTP server.
+     */
     public void run() {
         final Controller ctrl = this;
         try {
@@ -62,6 +65,11 @@
         }
     }
 
+    /**
+     * Create bootstrap for server.
+     *
+     * @return server bootstrap
+     */
     private ServerBootstrap createServerBootStrap() {
         bossGroup = new NioEventLoopGroup(1);
         workerGroup = new NioEventLoopGroup();
@@ -73,6 +81,14 @@
         return b;
     }
 
+    /**
+     * Initialize controller and start SCTP server.
+     *
+     * @param deviceAgent device agent
+     * @param hostAgent   host agent
+     * @param packetAgent packet agent
+     * @param port        port of server
+     */
     public void start(XranDeviceAgent deviceAgent, XranHostAgent hostAgent, XranPacketProcessor packetAgent, int port) {
         if (isRunning && this.port != port) {
             stop();
@@ -91,7 +107,9 @@
         }
     }
 
-
+    /**
+     * Stop SCTP server.
+     */
     public void stop() {
         if (isRunning) {
             channel.channel().close();
diff --git a/src/main/java/org.onosproject.xran/controller/XranChannelHandler.java b/src/main/java/org.onosproject.xran/controller/XranChannelHandler.java
index 764f55c..d429602 100644
--- a/src/main/java/org.onosproject.xran/controller/XranChannelHandler.java
+++ b/src/main/java/org.onosproject.xran/controller/XranChannelHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-present Open Networking Laboratory
+ * Copyright 2016-present Open Networking Foundation
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -36,9 +36,8 @@
 import java.net.URISyntaxException;
 
 /**
- * Created by dimitris on 7/20/17.
+ * Xran channel handler.
  */
-
 @Sharable
 public class XranChannelHandler extends ChannelInboundHandlerAdapter {
 
@@ -51,6 +50,13 @@
         this.controller = controller;
     }
 
+    /**
+     * Given PDU construct an SCTP message.
+     *
+     * @param pdu PDU packet
+     * @return SCTP message
+     * @throws IOException IO exception
+     */
     public static SctpMessage getSctpMessage(XrancPdu pdu) throws IOException {
         BerByteArrayOutputStream os = new BerByteArrayOutputStream(4096);
 
@@ -90,13 +96,13 @@
         byte[] bytes = new byte[byteBuf.readableBytes()];
         byteBuf.readBytes(bytes);
 
-        XrancPdu recv_pdu = new XrancPdu();
+        XrancPdu recvPdu = new XrancPdu();
 
         InputStream inputStream = new ByteArrayInputStream(bytes);
 
-        recv_pdu.decode(inputStream);
+        recvPdu.decode(inputStream);
 
-        controller.packetAgent.handlePacket(recv_pdu, ctx);
+        controller.packetAgent.handlePacket(recvPdu, ctx);
     }
 
     @Override
diff --git a/src/main/java/org.onosproject.xran/controller/XranController.java b/src/main/java/org.onosproject.xran/controller/XranController.java
index 0ab91ef..b08c714 100644
--- a/src/main/java/org.onosproject.xran/controller/XranController.java
+++ b/src/main/java/org.onosproject.xran/controller/XranController.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-present Open Networking Laboratory
+ * Copyright 2015-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.
@@ -28,23 +28,73 @@
  */
 public interface XranController {
 
+    /**
+     * Send a HandOff request from one link to another.
+     *
+     * @param newLink target LINK entity
+     * @param oldLink source LINK entity
+     * @return blocking queue for RESPONSE
+     * @throws InterruptedException interrupted exception
+     */
     SynchronousQueue<String> sendHORequest(RnibLink newLink, RnibLink oldLink) throws InterruptedException;
 
+    /**
+     * Add a device listener for CELL connections.
+     *
+     * @param listener listener
+     */
     void addListener(XranDeviceListener listener);
 
+    /**
+     * Add a host listener for UE connections.
+     *
+     * @param listener listener
+     */
     void addListener(XranHostListener listener);
 
+    /**
+     * Remove a CELL device listener.
+     *
+     * @param listener listener
+     */
     void removeListener(XranDeviceListener listener);
 
+    /**
+     * Remove a UE host listener.
+     *
+     * @param listener listener
+     */
     void removeListener(XranHostListener listener);
 
-    SynchronousQueue<String> sendModifiedRRMConf(RRMConfig rrmConfig, boolean xICIC);
+    /**
+     * Send modified RRM configuration or xICICConfing.
+     *
+     * @param rrmConfig configuration fields to send
+     * @param xicic     if true sends xicic else it sends RRM
+     * @return blocking queue for RESPONSE
+     */
+    SynchronousQueue<String> sendmodifiedrrmconf(RRMConfig rrmConfig, boolean xicic);
 
+    /**
+     * Send scell add packet for specified LINK.
+     *
+     * @param link LINK entity
+     * @return blocking queue for RESPONSE
+     */
     SynchronousQueue<String> sendScellAdd(RnibLink link);
 
+    /**
+     * Send scell delete for specified LINK.
+     *
+     * @param link LINK entity
+     * @return true if sent correctly
+     */
     boolean sendScellDelete(RnibLink link);
 
-    int getNorthbound_timeout();
-
-    void setNorthbound_timeout(int northbound_timeout);
+    /**
+     * Get northbound timeout.
+     *
+     * @return interval in milliseconds
+     */
+    int getNorthboundTimeout();
 }
diff --git a/src/main/java/org.onosproject.xran/controller/XranControllerImpl.java b/src/main/java/org.onosproject.xran/controller/XranControllerImpl.java
index 99e79a7..8040cea 100644
--- a/src/main/java/org.onosproject.xran/controller/XranControllerImpl.java
+++ b/src/main/java/org.onosproject.xran/controller/XranControllerImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-present Open Networking Laboratory
+ * Copyright 2015-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.
@@ -20,10 +20,21 @@
 import io.netty.channel.ChannelHandlerContext;
 import io.netty.channel.sctp.SctpMessage;
 import org.apache.commons.lang.exception.ExceptionUtils;
-import org.apache.felix.scr.annotations.*;
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.apache.felix.scr.annotations.Service;
+import org.onlab.packet.IpAddress;
 import org.onosproject.core.ApplicationId;
 import org.onosproject.core.CoreService;
-import org.onosproject.net.config.*;
+import org.onosproject.net.config.Config;
+import org.onosproject.net.config.ConfigFactory;
+import org.onosproject.net.config.NetworkConfigEvent;
+import org.onosproject.net.config.NetworkConfigListener;
+import org.onosproject.net.config.NetworkConfigRegistry;
+import org.onosproject.net.config.NetworkConfigService;
 import org.onosproject.net.config.basics.SubjectFactories;
 import org.onosproject.net.device.DeviceEvent;
 import org.onosproject.net.device.DeviceListener;
@@ -32,15 +43,59 @@
 import org.onosproject.net.host.HostListener;
 import org.onosproject.net.host.HostService;
 import org.onosproject.xran.XranStore;
-import org.onosproject.xran.codecs.api.*;
+import org.onosproject.xran.codecs.api.CRNTI;
+import org.onosproject.xran.codecs.api.ECGI;
+import org.onosproject.xran.codecs.api.ERABID;
+import org.onosproject.xran.codecs.api.ERABParams;
+import org.onosproject.xran.codecs.api.ERABParamsItem;
+import org.onosproject.xran.codecs.api.PCIARFCN;
+import org.onosproject.xran.codecs.api.PropScell;
+import org.onosproject.xran.codecs.api.RSRPRange;
+import org.onosproject.xran.codecs.api.RSRQRange;
+import org.onosproject.xran.codecs.api.RXSigReport;
+import org.onosproject.xran.codecs.api.RadioRepPerServCell;
+import org.onosproject.xran.codecs.api.SchedMeasRepPerServCell;
+import org.onosproject.xran.codecs.api.TrafficSplitPercentage;
 import org.onosproject.xran.codecs.ber.types.BerInteger;
-import org.onosproject.xran.codecs.pdu.*;
+import org.onosproject.xran.codecs.pdu.BearerAdmissionRequest;
+import org.onosproject.xran.codecs.pdu.BearerAdmissionResponse;
+import org.onosproject.xran.codecs.pdu.BearerAdmissionStatus;
+import org.onosproject.xran.codecs.pdu.BearerReleaseInd;
+import org.onosproject.xran.codecs.pdu.CellConfigReport;
+import org.onosproject.xran.codecs.pdu.CellConfigRequest;
+import org.onosproject.xran.codecs.pdu.HOComplete;
+import org.onosproject.xran.codecs.pdu.HOFailure;
+import org.onosproject.xran.codecs.pdu.HORequest;
+import org.onosproject.xran.codecs.pdu.L2MeasConfig;
+import org.onosproject.xran.codecs.pdu.PDCPMeasReportPerUe;
+import org.onosproject.xran.codecs.pdu.RRMConfig;
+import org.onosproject.xran.codecs.pdu.RRMConfigStatus;
+import org.onosproject.xran.codecs.pdu.RXSigMeasConfig;
+import org.onosproject.xran.codecs.pdu.RXSigMeasReport;
+import org.onosproject.xran.codecs.pdu.RadioMeasReportPerCell;
+import org.onosproject.xran.codecs.pdu.RadioMeasReportPerUE;
+import org.onosproject.xran.codecs.pdu.ScellAdd;
+import org.onosproject.xran.codecs.pdu.ScellAddStatus;
+import org.onosproject.xran.codecs.pdu.ScellDelete;
+import org.onosproject.xran.codecs.pdu.SchedMeasReportPerCell;
+import org.onosproject.xran.codecs.pdu.SchedMeasReportPerUE;
+import org.onosproject.xran.codecs.pdu.TrafficSplitConfig;
+import org.onosproject.xran.codecs.pdu.UEAdmissionRequest;
+import org.onosproject.xran.codecs.pdu.UEAdmissionResponse;
+import org.onosproject.xran.codecs.pdu.UEAdmissionStatus;
+import org.onosproject.xran.codecs.pdu.UECapabilityEnquiry;
+import org.onosproject.xran.codecs.pdu.UECapabilityInfo;
+import org.onosproject.xran.codecs.pdu.UEContextUpdate;
+import org.onosproject.xran.codecs.pdu.UEReconfigInd;
+import org.onosproject.xran.codecs.pdu.UEReleaseInd;
+import org.onosproject.xran.codecs.pdu.XICICConfig;
+import org.onosproject.xran.codecs.pdu.XrancPdu;
 import org.onosproject.xran.entities.RnibCell;
 import org.onosproject.xran.entities.RnibLink;
 import org.onosproject.xran.entities.RnibUe;
+import org.onosproject.xran.identifiers.ContextUpdateHandler;
 import org.onosproject.xran.identifiers.EcgiCrntiPair;
 import org.onosproject.xran.identifiers.LinkId;
-import org.onosproject.xran.identifiers.contextUpdateHandler;
 import org.onosproject.xran.impl.XranConfig;
 import org.onosproject.xran.providers.XranDeviceListener;
 import org.onosproject.xran.providers.XranHostListener;
@@ -51,8 +106,18 @@
 import org.slf4j.LoggerFactory;
 
 import java.io.IOException;
-import java.util.*;
-import java.util.concurrent.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
+import java.util.Set;
+import java.util.Timer;
+import java.util.TimerTask;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.CopyOnWriteArraySet;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.SynchronousQueue;
 import java.util.stream.Collectors;
 
 import static org.onosproject.net.DeviceId.deviceId;
@@ -79,7 +144,7 @@
     private final Controller controller = new Controller();
     private XranConfig xranConfig;
     private ApplicationId appId;
-    private int northbound_timeout;
+    private int northboundTimeout;
     /* Services */
     @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
     private DeviceService deviceService;
@@ -106,11 +171,11 @@
     private UeMap ueMap;
     private LinkMap linkMap;
     /* MAPS */
-    private ConcurrentMap<String, ECGI> legitCells = new ConcurrentHashMap<>();
+    private ConcurrentMap<IpAddress, ECGI> legitCells = new ConcurrentHashMap<>();
     private ConcurrentMap<ECGI, SynchronousQueue<String>> hoMap = new ConcurrentHashMap<>();
-    private ConcurrentMap<ECGI, SynchronousQueue<String>> RRMCellMap = new ConcurrentHashMap<>();
+    private ConcurrentMap<ECGI, SynchronousQueue<String>> rrmcellMap = new ConcurrentHashMap<>();
     private ConcurrentMap<CRNTI, SynchronousQueue<String>> scellAddMap = new ConcurrentHashMap<>();
-    private ConcurrentMap<EcgiCrntiPair, contextUpdateHandler> contextUpdateMap = new ConcurrentHashMap<>();
+    private ConcurrentMap<EcgiCrntiPair, ContextUpdateHandler> contextUpdateMap = new ConcurrentHashMap<>();
     /* QUEUE */
     private BlockingQueue<Long> ueIdQueue = new LinkedBlockingQueue<>();
     /* AGENTS */
@@ -120,8 +185,8 @@
     /* LISTENERS */
     private Set<XranDeviceListener> xranDeviceListeners = new CopyOnWriteArraySet<>();
     private Set<XranHostListener> xranHostListeners = new CopyOnWriteArraySet<>();
-    private InternalDeviceListener device_listener = new InternalDeviceListener();
-    private InternalHostListener host_listener = new InternalHostListener();
+    private InternalDeviceListener deviceListener = new InternalDeviceListener();
+    private InternalHostListener hostListener = new InternalHostListener();
 
     @Activate
     public void activate() {
@@ -129,8 +194,8 @@
 
         configService.addListener(configListener);
         registry.registerConfigFactory(xranConfigFactory);
-        deviceService.addListener(device_listener);
-        hostService.addListener(host_listener);
+        deviceService.addListener(deviceListener);
+        hostService.addListener(hostListener);
 
         cellMap = new CellMap(xranStore);
         ueMap = new UeMap(xranStore);
@@ -145,8 +210,8 @@
     public void deactivate() {
         controller.stop();
 
-        deviceService.removeListener(device_listener);
-        hostService.removeListener(host_listener);
+        deviceService.removeListener(deviceListener);
+        hostService.removeListener(hostListener);
 
         legitCells.clear();
 
@@ -157,29 +222,30 @@
     }
 
     @Override
-    public SynchronousQueue<String> sendHORequest(RnibLink link_t, RnibLink link_s) throws InterruptedException {
-        ECGI ecgi_t = link_t.getLinkId().getEcgi(),
-                ecgi_s = link_s.getLinkId().getEcgi();
+    public SynchronousQueue<String> sendHORequest(RnibLink linkT, RnibLink linkS) throws InterruptedException {
+        ECGI ecgiT = linkT.getLinkId().getEcgi(),
+                ecgiS = linkS.getLinkId().getEcgi();
 
-        CRNTI crnti = linkMap.getCrnti(link_t.getLinkId().getUeId());
-        ChannelHandlerContext ctx_t = cellMap.getCtx(ecgi_t),
-                ctx_s = cellMap.getCtx(ecgi_s);
-
+        CRNTI crnti = linkMap.getCrnti(linkT.getLinkId().getUeId());
+        ChannelHandlerContext ctxT = cellMap.getCtx(ecgiT),
+                ctxS = cellMap.getCtx(ecgiS);
 
         SynchronousQueue<String> queue = new SynchronousQueue<>();
         try {
-            XrancPdu xrancPdu = HORequest.constructPacket(crnti, ecgi_s, ecgi_t);
+            XrancPdu xrancPdu = HORequest.constructPacket(crnti, ecgiS, ecgiT);
 
-            hoMap.put(ecgi_s, queue);
+            // temporary map that has ECGI source of a handoff to a queue waiting for REST response.
+            hoMap.put(ecgiS, queue);
 
-            ctx_t.writeAndFlush(getSctpMessage(xrancPdu));
-            ctx_s.writeAndFlush(getSctpMessage(xrancPdu));
+            ctxT.writeAndFlush(getSctpMessage(xrancPdu));
+            ctxS.writeAndFlush(getSctpMessage(xrancPdu));
+
+            // FIXME: only works for one HO at a time.
+            ueIdQueue.put(linkT.getLinkId().getUeId());
         } catch (IOException e) {
             e.printStackTrace();
         }
 
-        ueIdQueue.put(link_t.getLinkId().getUeId());
-
         return queue;
     }
 
@@ -204,23 +270,18 @@
     }
 
     @Override
-    public int getNorthbound_timeout() {
-        return northbound_timeout;
+    public int getNorthboundTimeout() {
+        return northboundTimeout;
     }
 
     @Override
-    public void setNorthbound_timeout(int northbound_timeout) {
-        this.northbound_timeout = northbound_timeout;
-    }
-
-    @Override
-    public SynchronousQueue<String> sendModifiedRRMConf(RRMConfig rrmConfig, boolean xICIC) {
+    public SynchronousQueue<String> sendmodifiedrrmconf(RRMConfig rrmConfig, boolean xicic) {
         ECGI ecgi = rrmConfig.getEcgi();
         ChannelHandlerContext ctx = cellMap.getCtx(ecgi);
         try {
             XrancPdu pdu;
 
-            if (xICIC) {
+            if (xicic) {
                 CellConfigReport cellConfigReport = cellMap.get(ecgi).getConf();
                 if (cellConfigReport != null) {
                     pdu = XICICConfig.constructPacket(rrmConfig, cellConfigReport);
@@ -230,7 +291,7 @@
                 pdu = RRMConfig.constructPacket(rrmConfig);
                 ctx.writeAndFlush(getSctpMessage(pdu));
                 SynchronousQueue<String> queue = new SynchronousQueue<>();
-                RRMCellMap.put(ecgi, queue);
+                rrmcellMap.put(ecgi, queue);
                 return queue;
             }
         } catch (IOException e) {
@@ -304,6 +365,11 @@
         return false;
     }
 
+    /**
+     * Timer to delete UE after being IDLE.
+     *
+     * @param ue UE entity
+     */
     private void restartTimer(RnibUe ue) {
         Timer timer = new Timer();
         ue.setTimer(timer);
@@ -320,6 +386,11 @@
         }, xranConfig.getIdleUeRemoval());
     }
 
+    /**
+     * Timer to delete LINK after not receiving measurements.
+     *
+     * @param link LINK entity
+     */
     private void restartTimer(RnibLink link) {
         Timer timer = new Timer();
         link.setTimer(timer);
@@ -328,12 +399,49 @@
             public void run() {
                 LinkId linkId = link.getLinkId();
                 xranStore.removeLink(linkId);
-                log.info("Link is removed after not receiving Meas Reports for {} ms", xranConfig.getNoMeasLinkRemoval());
+                log.info("Link is removed after not receiving Meas Reports for {} ms",
+                        xranConfig.getNoMeasLinkRemoval());
             }
         }, xranConfig.getNoMeasLinkRemoval());
 
     }
 
+    /**
+     * Request measurement configuration field of specified UE.
+     *
+     * @param primary primary CELL
+     * @param ue      UE entity
+     */
+    private void populateMeasConfig(RnibCell primary, RnibUe ue) {
+        try {
+            ChannelHandlerContext ctx = cellMap.getCtx(primary.getEcgi());
+            RXSigMeasConfig.MeasCells measCells = new RXSigMeasConfig.MeasCells();
+            xranStore.getcellnodes().forEach(cell -> {
+                CellConfigReport cellReport = ((RnibCell) cell).getConf();
+                if (cellReport != null) {
+                    PCIARFCN pciarfcn = new PCIARFCN();
+                    pciarfcn.setPci(cellReport.getPci());
+                    pciarfcn.setEarfcnDl(cellReport.getEarfcnDl());
+                    measCells.setPCIARFCN(pciarfcn);
+                }
+            });
+            XrancPdu xrancPdu = RXSigMeasConfig.constructPacket(
+                    primary.getEcgi(),
+                    ue.getCrnti(),
+                    measCells,
+                    xranConfig.getRxSignalInterval()
+            );
+            ue.setMeasConfig(xrancPdu.getBody().getRXSigMeasConfig());
+            ctx.writeAndFlush(getSctpMessage(xrancPdu));
+        } catch (IOException e) {
+            log.warn(ExceptionUtils.getFullStackTrace(e));
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * Internal device listener.
+     */
     class InternalDeviceListener implements DeviceListener {
 
         @Override
@@ -361,14 +469,15 @@
                                                     e.printStackTrace();
                                                 }
                                             } else {
-                                                List<Object> ueNodes = xranStore.getUeNodes();
+                                                List<Object> ueNodes = xranStore.getuenodes();
                                                 ueNodes.forEach(object -> {
                                                     RnibUe ue = (RnibUe) object;
                                                     try {
-                                                        ECGI primary_ecgi = linkMap.getPrimaryCell(ue).getEcgi();
-                                                        ChannelHandlerContext ctx = cellMap.getCtx(primary_ecgi);
-                                                        RXSigMeasConfig.MeasCells measCells = new RXSigMeasConfig.MeasCells();
-                                                        xranStore.getCellNodes().forEach(cell -> {
+                                                        ECGI primaryEcgi = linkMap.getPrimaryCell(ue).getEcgi();
+                                                        ChannelHandlerContext ctx = cellMap.getCtx(primaryEcgi);
+                                                        RXSigMeasConfig.MeasCells measCells =
+                                                                new RXSigMeasConfig.MeasCells();
+                                                        xranStore.getcellnodes().forEach(cell -> {
                                                             CellConfigReport cellReport = ((RnibCell) cell).getConf();
                                                             if (cellReport != null) {
                                                                 PCIARFCN pciarfcn = new PCIARFCN();
@@ -378,7 +487,7 @@
                                                             }
                                                         });
                                                         XrancPdu xrancPdu = RXSigMeasConfig.constructPacket(
-                                                                primary_ecgi,
+                                                                primaryEcgi,
                                                                 ue.getCrnti(),
                                                                 measCells,
                                                                 xranConfig.getRxSignalInterval()
@@ -393,7 +502,8 @@
 
                                                 try {
                                                     ChannelHandlerContext ctx = cellMap.getCtx(ecgi);
-                                                    XrancPdu xrancPdu = L2MeasConfig.constructPacket(ecgi, xranConfig.getL2MeasInterval());
+                                                    XrancPdu xrancPdu = L2MeasConfig
+                                                            .constructPacket(ecgi, xranConfig.getL2MeasInterval());
                                                     cell.setMeasConfig(xrancPdu.getBody().getL2MeasConfig());
                                                     SctpMessage sctpMessage = getSctpMessage(xrancPdu);
                                                     ctx.writeAndFlush(sctpMessage);
@@ -423,6 +533,9 @@
         }
     }
 
+    /**
+     * Internal host listener.
+     */
     class InternalHostListener implements HostListener {
 
         @Override
@@ -433,8 +546,8 @@
                 case HOST_MOVED: {
                     RnibUe ue = ueMap.get(hostIdtoUEId(event.subject().id()));
                     if (ue != null) {
-                        ECGI ecgi_primary = linkMap.getPrimaryCell(ue).getEcgi();
-                        RnibCell primary = cellMap.get(ecgi_primary);
+                        ECGI ecgiPrimary = linkMap.getPrimaryCell(ue).getEcgi();
+                        RnibCell primary = cellMap.get(ecgiPrimary);
                         ue.setMeasConfig(null);
                         if (primary != null) {
                             Timer timer = new Timer();
@@ -463,30 +576,7 @@
                                     xranConfig.getConfigRequestInterval() * 1000
                             );
                             if (ue.getMeasConfig() == null) {
-                                try {
-                                    ChannelHandlerContext ctx = cellMap.getCtx(primary.getEcgi());
-                                    RXSigMeasConfig.MeasCells measCells = new RXSigMeasConfig.MeasCells();
-                                    xranStore.getCellNodes().forEach(cell -> {
-                                        CellConfigReport cellReport = ((RnibCell) cell).getConf();
-                                        if (cellReport != null) {
-                                            PCIARFCN pciarfcn = new PCIARFCN();
-                                            pciarfcn.setPci(cellReport.getPci());
-                                            pciarfcn.setEarfcnDl(cellReport.getEarfcnDl());
-                                            measCells.setPCIARFCN(pciarfcn);
-                                        }
-                                    });
-                                    XrancPdu xrancPdu = RXSigMeasConfig.constructPacket(
-                                            primary.getEcgi(),
-                                            ue.getCrnti(),
-                                            measCells,
-                                            xranConfig.getRxSignalInterval()
-                                    );
-                                    ue.setMeasConfig(xrancPdu.getBody().getRXSigMeasConfig());
-                                    ctx.writeAndFlush(getSctpMessage(xrancPdu));
-                                } catch (IOException e) {
-                                    log.warn(ExceptionUtils.getFullStackTrace(e));
-                                    e.printStackTrace();
-                                }
+                                populateMeasConfig(primary, ue);
                             }
                         }
                     }
@@ -499,13 +589,16 @@
         }
     }
 
+    /**
+     * Internal xran device agent.
+     */
     public class InternalXranDeviceAgent implements XranDeviceAgent {
 
         private final Logger log = LoggerFactory.getLogger(InternalXranDeviceAgent.class);
 
         @Override
         public boolean addConnectedCell(String host, ChannelHandlerContext ctx) {
-            ECGI ecgi = legitCells.get(host);
+            ECGI ecgi = legitCells.get(IpAddress.valueOf(host));
 
             if (ecgi == null) {
                 log.error("Device is not a legit source; ignoring...");
@@ -531,10 +624,10 @@
 
         @Override
         public boolean removeConnectedCell(String host) {
-            ECGI ecgi = legitCells.get(host);
-            List<RnibLink> linksByECGI = xranStore.getLinksByECGI(ecgi);
+            ECGI ecgi = legitCells.get(IpAddress.valueOf(host));
+            List<RnibLink> linksbyecgi = xranStore.getlinksbyecgi(ecgi);
 
-            linksByECGI.forEach(rnibLink -> xranStore.removeLink(rnibLink.getLinkId()));
+            linksbyecgi.forEach(rnibLink -> xranStore.removeLink(rnibLink.getLinkId()));
 
             if (cellMap.remove(ecgi)) {
                 for (XranDeviceListener l : xranDeviceListeners) {
@@ -546,6 +639,9 @@
         }
     }
 
+    /**
+     * Internal xran host agent.
+     */
     public class InternalXranHostAgent implements XranHostAgent {
 
         @Override
@@ -556,10 +652,11 @@
 
                 Set<ECGI> ecgiSet = Sets.newConcurrentHashSet();
 
-                ecgiSet.add(xranStore.getLinksByUeId(ue.getId())
+                xranStore.getlinksbyueid(ue.getId())
                         .stream()
                         .filter(l -> l.getType().equals(RnibLink.Type.SERVING_PRIMARY))
-                        .findFirst().get().getLinkId().getEcgi());
+                        .findFirst()
+                        .ifPresent(l -> ecgiSet.add(l.getLinkId().getEcgi()));
 
                 for (XranHostListener l : xranHostListeners) {
                     l.hostAdded(ue, ecgiSet);
@@ -581,7 +678,7 @@
 
         @Override
         public boolean removeConnectedHost(RnibUe ue) {
-            List<RnibLink> links = xranStore.getLinksByUeId(ue.getId());
+            List<RnibLink> links = xranStore.getlinksbyueid(ue.getId());
             links.forEach(rnibLink -> xranStore.removeLink(rnibLink.getLinkId()));
             if (ueMap.remove(ue.getId())) {
                 for (XranHostListener l : xranHostListeners) {
@@ -595,465 +692,656 @@
 
     public class InternalXranPacketAgent implements XranPacketProcessor {
         @Override
-        public void handlePacket(XrancPdu recv_pdu, ChannelHandlerContext ctx) throws IOException, InterruptedException {
-            XrancPdu send_pdu;
+        public void handlePacket(XrancPdu recvPdu, ChannelHandlerContext ctx)
+                throws IOException, InterruptedException {
+            XrancPdu sendPdu;
 
-            int apiID = recv_pdu.getHdr().getApiId().intValue();
-            log.debug("Received message: {}", recv_pdu);
+            int apiID = recvPdu.getHdr().getApiId().intValue();
+            log.debug("Received message: {}", recvPdu);
             switch (apiID) {
                 case 1: {
                     // Decode Cell config report.
-                    CellConfigReport report = recv_pdu.getBody().getCellConfigReport();
-
-                    ECGI ecgi = report.getEcgi();
-
-                    RnibCell cell = xranStore.getCell(ecgi);
-                    cell.setVersion(recv_pdu.getHdr().getVer().toString());
-                    cell.setConf(report);
-                    cellMap.putPciArfcn(cell);
+                    CellConfigReport report = recvPdu.getBody().getCellConfigReport();
+                    handleCellconfigreport(report, recvPdu.getHdr().getVer().toString());
                     break;
                 }
                 case 2: {
                     // Decode UE Admission Request.
-                    UEAdmissionRequest ueAdmissionRequest = recv_pdu.getBody().getUEAdmissionRequest();
-
-                    ECGI ecgi = ueAdmissionRequest.getEcgi();
-                    if (xranStore.getCell(ecgi) != null) {
-                        CRNTI crnti = ueAdmissionRequest.getCrnti();
-                        send_pdu = UEAdmissionResponse.constructPacket(ecgi, crnti, xranConfig.admissionFlag());
-                        ctx.writeAndFlush(getSctpMessage(send_pdu));
-                    } else {
-                        log.warn("Could not find ECGI in registered cells: {}", ecgi);
-                    }
+                    UEAdmissionRequest ueAdmissionRequest = recvPdu.getBody().getUEAdmissionRequest();
+                    handleUeadmissionrequest(ueAdmissionRequest, ctx);
                     break;
                 }
                 case 4: {
                     // Decode UE Admission Status.
-                    UEAdmissionStatus ueAdmissionStatus = recv_pdu.getBody().getUEAdmissionStatus();
-
-                    RnibUe ue = ueMap.get(ueAdmissionStatus.getEcgi(), ueAdmissionStatus.getCrnti());
-                    if (ue != null) {
-                        if (ueAdmissionStatus.getAdmEstStatus().value.intValue() == 0) {
-                            ue.setState(RnibUe.State.ACTIVE);
-                        } else {
-                            ue.setState(RnibUe.State.IDLE);
-                        }
-                    }
-
-                    if (ueAdmissionStatus.getAdmEstStatus().value.intValue() == 0) {
-                        EcgiCrntiPair ecgiCrntiPair = EcgiCrntiPair.valueOf(ueAdmissionStatus.getEcgi(), ueAdmissionStatus.getCrnti());
-                        contextUpdateMap.compute(ecgiCrntiPair, (k, v) -> {
-                            if (v == null) {
-                                v = new contextUpdateHandler();
-                            }
-                            if (v.setAdmissionStatus(ueAdmissionStatus)) {
-                                handleContextUpdate(v.getContextUpdate(), ctx, false);
-                            }
-                            return v;
-                        });
-                    }
+                    UEAdmissionStatus ueAdmissionStatus = recvPdu.getBody().getUEAdmissionStatus();
+                    handleAdmissionstatus(ueAdmissionStatus, ctx);
                     break;
                 }
                 case 5: {
                     // Decode UE Context Update.
-                    UEContextUpdate ueContextUpdate = recv_pdu.getBody().getUEContextUpdate();
-                    EcgiCrntiPair ecgiCrntiPair = EcgiCrntiPair.valueOf(ueContextUpdate.getEcgi(), ueContextUpdate.getCrnti());
-
-                    contextUpdateMap.compute(ecgiCrntiPair, (k, v) -> {
-                        if (v == null) {
-                            v = new contextUpdateHandler();
-                        }
-                        if (v.setContextUpdate(ueContextUpdate)) {
-                            HOComplete hoComplete = v.getHoComplete();
-                            handleContextUpdate(ueContextUpdate, ctx, hoComplete != null);
-                            if (hoComplete != null) {
-                                try {
-                                    hoMap.get(hoComplete.getEcgiS()).put("Hand Over Completed");
-                                } catch (InterruptedException e) {
-                                    log.error(ExceptionUtils.getFullStackTrace(e));
-                                    e.printStackTrace();
-                                } finally {
-                                    hoMap.remove(hoComplete.getEcgiS());
-                                }
-                            }
-                        }
-                        return v;
-                    });
+                    UEContextUpdate ueContextUpdate = recvPdu.getBody().getUEContextUpdate();
+                    handleUecontextupdate(ueContextUpdate, ctx);
 
                     break;
                 }
                 case 6: {
                     // Decode UE Reconfig_Ind.
-                    UEReconfigInd ueReconfigInd = recv_pdu.getBody().getUEReconfigInd();
-                    RnibUe ue = ueMap.get(ueReconfigInd.getEcgi(), ueReconfigInd.getCrntiOld());
-
-                    if (ue != null) {
-                        ue.setCrnti(ueReconfigInd.getCrntiNew());
-                    } else {
-                        log.warn("Could not find UE with this CRNTI: {}", ueReconfigInd.getCrntiOld());
-                    }
+                    UEReconfigInd ueReconfigInd = recvPdu.getBody().getUEReconfigInd();
+                    handleUereconfigind(ueReconfigInd);
                     break;
                 }
                 case 7: {
                     // If xRANc wants to deactivate UE, we pass UEReleaseInd from xRANc to eNB.
                     // Decode UE Release_Ind.
-                    UEReleaseInd ueReleaseInd = recv_pdu.getBody().getUEReleaseInd();
-                    RnibUe ue = ueMap.get(ueReleaseInd.getEcgi(), ueReleaseInd.getCrnti());
-                    if (ue != null) {
-                        ue.setState(RnibUe.State.IDLE);
-                        restartTimer(ue);
-                    }
+                    UEReleaseInd ueReleaseInd = recvPdu.getBody().getUEReleaseInd();
+                    handleUereleaseind(ueReleaseInd);
                     break;
                 }
                 case 8: {
                     // Decode Bearer Adm Request
-                    BearerAdmissionRequest bearerAdmissionRequest = recv_pdu.getBody().getBearerAdmissionRequest();
-
-                    ECGI ecgi = bearerAdmissionRequest.getEcgi();
-                    CRNTI crnti = bearerAdmissionRequest.getCrnti();
-                    ERABParams erabParams = bearerAdmissionRequest.getErabParams();
-                    RnibLink link = linkMap.get(ecgi, crnti);
-                    if (link != null) {
-                        link.setBearerParameters(erabParams);
-                    } else {
-                        log.warn("Could not find link between {}-{}", ecgi, crnti);
-                    }
-
-                    BerInteger numErabs = bearerAdmissionRequest.getNumErabs();
-                    // Encode and send Bearer Admission Response
-                    send_pdu = BearerAdmissionResponse.constructPacket(ecgi, crnti, erabParams, numErabs, xranConfig.bearerFlag());
-                    ctx.writeAndFlush(getSctpMessage(send_pdu));
+                    BearerAdmissionRequest bearerAdmissionRequest = recvPdu.getBody().getBearerAdmissionRequest();
+                    handleBeareradmissionrequest(bearerAdmissionRequest, ctx);
                     break;
                 }
                 case 10: {
                     //Decode Bearer Admission Status
-                    BearerAdmissionStatus bearerAdmissionStatus = recv_pdu.getBody().getBearerAdmissionStatus();
+                    BearerAdmissionStatus bearerAdmissionStatus = recvPdu.getBody().getBearerAdmissionStatus();
                     break;
-//                    ECGI ecgi = bearerAdmissionStatus.getEcgi();
-//                    CRNTI crnti = bearerAdmissionStatus.getCrnti();
-//
-//                    RnibLink link = linkMap.get(ecgi, crnti);
                 }
                 case 11: {
                     //Decode Bearer Release Ind
-                    BearerReleaseInd bearerReleaseInd = recv_pdu.getBody().getBearerReleaseInd();
-
-                    ECGI ecgi = bearerReleaseInd.getEcgi();
-                    CRNTI crnti = bearerReleaseInd.getCrnti();
-                    RnibLink link = linkMap.get(ecgi, crnti);
-
-                    List<ERABID> erabidsRelease = bearerReleaseInd.getErabIds().getERABID();
-                    List<ERABParamsItem> erabParamsItem = link.getBearerParameters().getERABParamsItem();
-
-                    List<ERABParamsItem> unreleased = erabParamsItem
-                            .stream()
-                            .filter(item -> {
-                                Optional<ERABID> any = erabidsRelease.stream().filter(id -> id.equals(item.getId())).findAny();
-                                return !any.isPresent();
-                            }).collect(Collectors.toList());
-
-                    link.getBearerParameters().setERABParamsItem(new ArrayList<>(unreleased));
+                    BearerReleaseInd bearerReleaseInd = recvPdu.getBody().getBearerReleaseInd();
+                    handleBearerreleaseind(bearerReleaseInd);
                     break;
                 }
                 case 13: {
-                    HOFailure hoFailure = recv_pdu.getBody().getHOFailure();
-
-                    try {
-                        hoMap.get(hoFailure.getEcgi())
-                                .put("Hand Over Failed with cause: " + hoFailure.getCause());
-                    } catch (InterruptedException e) {
-                        log.error(ExceptionUtils.getFullStackTrace(e));
-                        e.printStackTrace();
-                    } finally {
-                        hoMap.remove(hoFailure.getEcgi());
-                        ueIdQueue.take();
-                    }
+                    HOFailure hoFailure = recvPdu.getBody().getHOFailure();
+                    handleHofailure(hoFailure);
                     break;
 
                 }
                 case 14: {
-                    HOComplete hoComplete = recv_pdu.getBody().getHOComplete();
-
-                    EcgiCrntiPair ecgiCrntiPair = EcgiCrntiPair.valueOf(hoComplete.getEcgiT(), hoComplete.getCrntiNew());
-                    contextUpdateMap.compute(ecgiCrntiPair, (k, v) -> {
-                        if (v == null) {
-                            v = new contextUpdateHandler();
-                        }
-                        if (v.setHoComplete(hoComplete)) {
-                            handleContextUpdate(v.getContextUpdate(), ctx, true);
-
-                            try {
-                                hoMap.get(hoComplete.getEcgiS()).put("Hand Over Completed");
-                            } catch (InterruptedException e) {
-                                log.error(ExceptionUtils.getFullStackTrace(e));
-                                e.printStackTrace();
-                            } finally {
-                                hoMap.remove(hoComplete.getEcgiS());
-                            }
-                        }
-                        return v;
-                    });
-
+                    HOComplete hoComplete = recvPdu.getBody().getHOComplete();
+                    handleHocomplete(hoComplete, ctx);
                     break;
                 }
 
                 case 16: {
-                    // Decode RX Sig Meas Report.
-                    RXSigMeasReport rxSigMeasReport = recv_pdu.getBody().getRXSigMeasReport();
-                    List<RXSigReport> rxSigReportList = rxSigMeasReport.getCellMeasReports().getRXSigReport();
-
-                    RnibUe ue = ueMap.get(rxSigMeasReport.getEcgi(), rxSigMeasReport.getCrnti());
-                    if (ue != null) {
-                        Long ueId = ue.getId();
-
-                        if (!rxSigReportList.isEmpty()) {
-                            rxSigReportList.forEach(rxSigReport -> {
-                                RnibCell cell = cellMap.get(rxSigReport.getPciArfcn());
-                                if (cell != null) {
-                                    ECGI ecgi = cell.getEcgi();
-
-                                    RnibLink link = linkMap.get(ecgi, ueId);
-                                    if (link == null) {
-                                        log.warn("Could not find link between: {}-{} | Creating non-serving link..", ecgi, ueId);
-                                        link = linkMap.putNonServingLink(cell, ueId);
-                                    }
-
-                                    if (link != null) {
-                                        if (link.getType().equals(RnibLink.Type.NON_SERVING)) {
-                                            restartTimer(link);
-                                        }
-
-                                        RSRQRange rsrq = rxSigReport.getRsrq();
-                                        RSRPRange rsrp = rxSigReport.getRsrp();
-
-                                        RnibLink.LinkQuality quality = link.getQuality();
-                                        quality.setRX(new RnibLink.LinkQuality.RX(
-                                                rsrp.value.intValue() - 140,
-                                                (rsrq.value.intValue() * 0.5) - 19.5
-                                        ));
-                                    }
-                                } else {
-                                    log.warn("case 16: Could not find cell with PCI-ARFCN: {}", rxSigReport.getPciArfcn());
-                                }
-                            });
-                        }
-                    }
+                    // Decode Rx Sig Meas Report.
+                    RXSigMeasReport rxSigMeasReport = recvPdu.getBody().getRXSigMeasReport();
+                    handleRxsigmeasreport(rxSigMeasReport);
                     break;
                 }
                 case 18: {
-                    RadioMeasReportPerUE radioMeasReportPerUE = recv_pdu.getBody().getRadioMeasReportPerUE();
-
-                    RnibUe ue = ueMap.get(radioMeasReportPerUE.getEcgi(), radioMeasReportPerUE.getCrnti());
-                    if (ue != null) {
-                        Long ueId = ue.getId();
-                        List<RadioRepPerServCell> servCells = radioMeasReportPerUE.getRadioReportServCells().getRadioRepPerServCell();
-
-                        servCells.forEach(servCell -> {
-                            RnibCell cell = cellMap.get(servCell.getPciArfcn());
-                            if (cell != null) {
-                                RnibLink link = linkMap.get(cell.getEcgi(), ueId);
-                                if (link != null) {
-                                    RadioRepPerServCell.CqiHist cqiHist = servCell.getCqiHist();
-                                    RnibLink.LinkQuality quality = link.getQuality();
-
-                                    final double[] values = {0, 0, 0};
-                                    final int[] i = {1};
-                                    cqiHist.getBerInteger().forEach(value -> {
-                                        values[0] = Math.max(values[0], value.intValue());
-                                        values[1] += i[0] * value.intValue();
-                                        values[2] += value.intValue();
-                                        i[0]++;
-                                    });
-
-                                    quality.setCQI(new RnibLink.LinkQuality.CQI(
-                                            cqiHist,
-                                            values[0],
-                                            values[1] / values[0]
-                                    ));
-
-                                } else {
-                                    log.warn("Could not find link between: {}-{}", cell.getEcgi(), ueId);
-                                }
-                            } else {
-                                log.warn("case 18: Could not find cell with PCI-ARFCN: {}", servCell.getPciArfcn());
-                            }
-                        });
-                    }
+                    RadioMeasReportPerUE radioMeasReportPerUE = recvPdu.getBody().getRadioMeasReportPerUE();
+                    handleRadionmeasreportperue(radioMeasReportPerUE);
                     break;
                 }
                 case 19: {
-                    RadioMeasReportPerCell radioMeasReportPerCell = recv_pdu.getBody().getRadioMeasReportPerCell();
+                    RadioMeasReportPerCell radioMeasReportPerCell = recvPdu.getBody().getRadioMeasReportPerCell();
                     break;
                 }
                 case 20: {
-                    SchedMeasReportPerUE schedMeasReportPerUE = recv_pdu.getBody().getSchedMeasReportPerUE();
-
-                    RnibUe ue = ueMap.get(schedMeasReportPerUE.getEcgi(), schedMeasReportPerUE.getCrnti());
-                    if (ue != null) {
-                        Long ueId = ue.getId();
-
-                        List<SchedMeasRepPerServCell> servCells = schedMeasReportPerUE.getSchedReportServCells()
-                                .getSchedMeasRepPerServCell();
-
-                        servCells.forEach(servCell -> {
-                            RnibCell cell = cellMap.get(servCell.getPciArfcn());
-                            if (cell != null) {
-                                RnibLink link = linkMap.get(cell.getEcgi(), ueId);
-                                if (link != null) {
-                                    link.getQuality().setMCS(new RnibLink.LinkQuality.MCS(
-                                            servCell.getMcsDl(),
-                                            servCell.getMcsUl()
-                                    ));
-
-                                    link.setResourceUsage(new RnibLink.ResourceUsage(
-                                            servCell.getPrbUsage().getPrbUsageDl(),
-                                            servCell.getPrbUsage().getPrbUsageUl()
-                                    ));
-                                } else {
-                                    log.warn("Could not find link between: {}-{}", cell.getEcgi(), ueId);
-                                }
-                            } else {
-                                log.warn("case 20: Could not find cell with PCI-ARFCN: {}", servCell.getPciArfcn());
-                            }
-                        });
-                    }
+                    SchedMeasReportPerUE schedMeasReportPerUE = recvPdu.getBody().getSchedMeasReportPerUE();
+                    handleSchedmeasreportperue(schedMeasReportPerUE);
                     break;
                 }
                 case 21: {
-                    SchedMeasReportPerCell schedMeasReportPerCell = recv_pdu.getBody().getSchedMeasReportPerCell();
-                    RnibCell cell = cellMap.get(schedMeasReportPerCell.getEcgi());
-                    if (cell != null) {
-                        cell.setPrbUsage(new RnibCell.PrbUsageContainer(
-                                schedMeasReportPerCell.getPrbUsagePcell(),
-                                schedMeasReportPerCell.getPrbUsageScell()
-                        ));
-
-                        cell.setQci(schedMeasReportPerCell.getQciVals());
-                    } else {
-                        log.warn("Could not find cell with ECGI: {}", schedMeasReportPerCell.getEcgi());
-                    }
+                    SchedMeasReportPerCell schedMeasReportPerCell = recvPdu.getBody().getSchedMeasReportPerCell();
+                    handleSchedmeasreportpercell(schedMeasReportPerCell);
                     break;
                 }
                 case 22: {
-                    PDCPMeasReportPerUe pdcpMeasReportPerUe = recv_pdu.getBody().getPDCPMeasReportPerUe();
-
-                    RnibUe ue = ueMap.get(pdcpMeasReportPerUe.getEcgi(), pdcpMeasReportPerUe.getCrnti());
-                    if (ue != null) {
-                        Long ueId = ue.getId();
-                        RnibLink link = linkMap.get(pdcpMeasReportPerUe.getEcgi(), ueId);
-                        if (link != null) {
-                            link.setPdcpThroughput(new RnibLink.PDCPThroughput(
-                                    pdcpMeasReportPerUe.getThroughputDl(),
-                                    pdcpMeasReportPerUe.getThroughputUl()
-                            ));
-
-                            link.setPdcpPackDelay(new RnibLink.PDCPPacketDelay(
-                                    pdcpMeasReportPerUe.getPktDelayDl(),
-                                    pdcpMeasReportPerUe.getPktDelayUl()
-                            ));
-                        } else {
-                            log.warn("Could not find link between: {}-{}", pdcpMeasReportPerUe.getEcgi(), ueId);
-                        }
-                    }
+                    PDCPMeasReportPerUe pdcpMeasReportPerUe = recvPdu.getBody().getPDCPMeasReportPerUe();
+                    handlePdcpmeasreportperue(pdcpMeasReportPerUe);
                     break;
                 }
                 case 24: {
                     // Decode UE Capability Info
-                    UECapabilityInfo capabilityInfo = recv_pdu.getBody().getUECapabilityInfo();
-
-                    RnibUe ue = ueMap.get(capabilityInfo.getEcgi(), capabilityInfo.getCrnti());
-                    if (ue != null) {
-                        ue.setCapability(capabilityInfo);
-                    } else {
-                        log.warn("Could not find UE with this CRNTI: {}", capabilityInfo.getCrnti());
-                    }
+                    UECapabilityInfo capabilityInfo = recvPdu.getBody().getUECapabilityInfo();
+                    handleCapabilityinfo(capabilityInfo);
                     break;
                 }
                 case 25: {
                     // Don't know what will invoke sending UE CAPABILITY ENQUIRY
                     // Encode and send UE CAPABILITY ENQUIRY
-                    UECapabilityEnquiry ueCapabilityEnquiry = recv_pdu.getBody().getUECapabilityEnquiry();
-                    XrancPdu xrancPdu = UECapabilityEnquiry.constructPacket(ueCapabilityEnquiry.getEcgi(), ueCapabilityEnquiry.getCrnti());
-                    ctx.writeAndFlush(getSctpMessage(xrancPdu));
+                    UECapabilityEnquiry ueCapabilityEnquiry = recvPdu.getBody().getUECapabilityEnquiry();
+                    handleUecapabilityenquiry(ueCapabilityEnquiry, ctx);
                     break;
                 }
                 case 27: {
                     //Decode ScellAddStatus
-                    ScellAddStatus scellAddStatus = recv_pdu.getBody().getScellAddStatus();
-                    RnibUe ue = ueMap.get(scellAddStatus.getEcgi(), scellAddStatus.getCrnti());
-                    if (ue != null) {
-                        Long ueId = ue.getId();
-                        try {
-                            scellAddMap.get(scellAddStatus.getCrnti()).put("Scell's status: " + scellAddStatus.getStatus());
-                            if (scellAddStatus.getStatus().getBerEnum().get(0).value.intValue() == 0) {
-
-                                scellAddStatus.getScellsInd().getPCIARFCN().forEach(
-                                        pciarfcn -> {
-                                            RnibCell cell = cellMap.get(pciarfcn);
-                                            RnibLink link = linkMap.get(cell.getEcgi(), ueId);
-                                            link.setType(RnibLink.Type.SERVING_SECONDARY_CA);
-                                        }
-                                );
-                            } else {
-                                log.error("Scell addition failed.");
-                            }
-                        } catch (InterruptedException e) {
-                            log.error(ExceptionUtils.getFullStackTrace(e));
-                            e.printStackTrace();
-                        } finally {
-                            scellAddMap.remove(scellAddStatus.getCrnti());
-                        }
-                    }
+                    ScellAddStatus scellAddStatus = recvPdu.getBody().getScellAddStatus();
+                    handleScelladdstatus(scellAddStatus);
                     break;
                 }
-                // TODO: 28: ScellDelete
                 case 30: {
                     // Decode RRMConfig Status
-                    RRMConfigStatus rrmConfigStatus = recv_pdu.getBody().getRRMConfigStatus();
-                    try {
-                        RRMCellMap.get(rrmConfigStatus.getEcgi())
-                                .put("RRM Config's status: " + rrmConfigStatus.getStatus());
-                    } catch (InterruptedException e) {
-                        log.error(ExceptionUtils.getFullStackTrace(e));
-                        e.printStackTrace();
-                    } finally {
-                        RRMCellMap.remove(rrmConfigStatus.getEcgi());
-                    }
+                    RRMConfigStatus rrmConfigStatus = recvPdu.getBody().getRRMConfigStatus();
+                    handleRrmconfigstatus(rrmConfigStatus);
                     break;
                 }
                 //TODO Case 31: SeNBAdd 32: SeNBAddStatus 33: SeNBDelete
                 case 34: {
-                    TrafficSplitConfig trafficSplitConfig = recv_pdu.getBody().getTrafficSplitConfig();
-
-                    RnibUe ue = ueMap.get(trafficSplitConfig.getEcgi(), trafficSplitConfig.getCrnti());
-                    if (ue != null) {
-                        Long ueId = ue.getId();
-                        List<TrafficSplitPercentage> splitPercentages = trafficSplitConfig.getTrafficSplitPercent().getTrafficSplitPercentage();
-
-                        splitPercentages.forEach(trafficSplitPercentage -> {
-                            RnibCell cell = cellMap.get(trafficSplitPercentage.getEcgi());
-                            if (cell != null) {
-                                RnibLink link = linkMap.get(cell.getEcgi(), ueId);
-                                if (link != null) {
-                                    link.setTrafficPercent(trafficSplitPercentage);
-                                } else {
-                                    log.warn("Could not find link between: {}-{}", cell.getEcgi(), ueId);
-                                }
-                            } else {
-                                log.warn("Could not find cell with ECGI: {}", trafficSplitConfig.getEcgi());
-                            }
-                        });
-                    }
+                    TrafficSplitConfig trafficSplitConfig = recvPdu.getBody().getTrafficSplitConfig();
+                    handleTrafficSplitConfig(trafficSplitConfig);
                     break;
                 }
                 default: {
-                    log.warn("Wrong API ID: {}", recv_pdu);
+                    log.warn("Wrong API ID: {}", recvPdu);
                     break;
                 }
             }
 
         }
 
+        /**
+         * Handle Cellconfigreport.
+         * @param report CellConfigReport
+         * @param version String version ID
+         */
+        private void handleCellconfigreport(CellConfigReport report, String version) {
+            ECGI ecgi = report.getEcgi();
+
+            RnibCell cell = xranStore.getCell(ecgi);
+            cell.setVersion(version);
+            cell.setConf(report);
+            cellMap.putPciArfcn(cell);
+        }
+
+        /**
+         * Handle Ueadmissionrequest.
+         * @param ueAdmissionRequest UEAdmissionRequest
+         * @param ctx ChannelHandlerContext
+         * @throws IOException IO Exception
+         */
+        private void handleUeadmissionrequest(UEAdmissionRequest ueAdmissionRequest, ChannelHandlerContext ctx)
+                throws IOException {
+            ECGI ecgi = ueAdmissionRequest.getEcgi();
+            if (xranStore.getCell(ecgi) != null) {
+                CRNTI crnti = ueAdmissionRequest.getCrnti();
+                XrancPdu sendPdu = UEAdmissionResponse.constructPacket(ecgi, crnti, xranConfig.admissionFlag());
+                ctx.writeAndFlush(getSctpMessage(sendPdu));
+            } else {
+                log.warn("Could not find ECGI in registered cells: {}", ecgi);
+            }
+        }
+
+        /**
+         * Handle UEAdmissionStatus.
+         * @param ueAdmissionStatus UEAdmissionStatus
+         * @param ctx ChannelHandlerContext
+         */
+        private void handleAdmissionstatus(UEAdmissionStatus ueAdmissionStatus, ChannelHandlerContext ctx) {
+            RnibUe ue = ueMap.get(ueAdmissionStatus.getEcgi(), ueAdmissionStatus.getCrnti());
+            if (ue != null) {
+                if (ueAdmissionStatus.getAdmEstStatus().value.intValue() == 0) {
+                    ue.setState(RnibUe.State.ACTIVE);
+                } else {
+                    ue.setState(RnibUe.State.IDLE);
+                }
+            }
+
+            if (ueAdmissionStatus.getAdmEstStatus().value.intValue() == 0) {
+                EcgiCrntiPair ecgiCrntiPair = EcgiCrntiPair
+                        .valueOf(ueAdmissionStatus.getEcgi(), ueAdmissionStatus.getCrnti());
+                contextUpdateMap.compute(ecgiCrntiPair, (k, v) -> {
+                    if (v == null) {
+                        v = new ContextUpdateHandler();
+                    }
+                    if (v.setAdmissionStatus(ueAdmissionStatus)) {
+                        handleContextUpdate(v.getContextUpdate(), ctx, false);
+                    }
+                    return v;
+                });
+            }
+        }
+
+        /**
+         * Handle UEContextUpdate.
+         * @param ueContextUpdate UEContextUpdate
+         * @param ctx ChannelHandlerContext
+         */
+        private void handleUecontextupdate(UEContextUpdate ueContextUpdate, ChannelHandlerContext ctx) {
+            EcgiCrntiPair ecgiCrntiPair = EcgiCrntiPair
+                    .valueOf(ueContextUpdate.getEcgi(), ueContextUpdate.getCrnti());
+
+            contextUpdateMap.compute(ecgiCrntiPair, (k, v) -> {
+                if (v == null) {
+                    v = new ContextUpdateHandler();
+                }
+                if (v.setContextUpdate(ueContextUpdate)) {
+                    HOComplete hoComplete = v.getHoComplete();
+                    handleContextUpdate(ueContextUpdate, ctx, hoComplete != null);
+                    if (hoComplete != null) {
+                        try {
+                            hoMap.get(hoComplete.getEcgiS()).put("Hand Over Completed");
+                        } catch (InterruptedException e) {
+                            log.error(ExceptionUtils.getFullStackTrace(e));
+                            e.printStackTrace();
+                        } finally {
+                            hoMap.remove(hoComplete.getEcgiS());
+                        }
+                    }
+                }
+                return v;
+            });
+        }
+
+        /**
+         * Handle UEReconfigInd.
+         * @param ueReconfigInd UEReconfigInd
+         */
+        private void handleUereconfigind(UEReconfigInd ueReconfigInd) {
+            RnibUe ue = ueMap.get(ueReconfigInd.getEcgi(), ueReconfigInd.getCrntiOld());
+            RnibCell cell = cellMap.get(ueReconfigInd.getEcgi());
+
+            if (ue != null && cell != null) {
+                ue.setCrnti(ueReconfigInd.getCrntiNew());
+                ueMap.putCrnti(cell, ue);
+            } else {
+                log.warn("Could not find UE with this CRNTI: {}", ueReconfigInd.getCrntiOld());
+            }
+        }
+
+        /**
+         * Handle UEReleaseInd.
+         * @param ueReleaseInd UEReleaseInd
+         */
+        private void handleUereleaseind(UEReleaseInd ueReleaseInd) {
+            ECGI ecgi = ueReleaseInd.getEcgi();
+            CRNTI crnti = ueReleaseInd.getCrnti();
+            RnibUe ue = ueMap.get(ecgi, crnti);
+
+            // Check if there is an ongoing handoff and only remove if ue is not part of the handoff.
+            Long peek = ueIdQueue.peek();
+            if (peek != null) {
+                EcgiCrntiPair ecgiCrntiPair = ueMap.getCrntUe().inverse().get(peek);
+                if (ecgiCrntiPair != null && ecgiCrntiPair.equals(EcgiCrntiPair.valueOf(ecgi, crnti))) {
+                    return;
+                }
+            }
+
+            if (ue != null) {
+                ue.setState(RnibUe.State.IDLE);
+                restartTimer(ue);
+            } else {
+                log.warn("Cannot release UE from non primary link.");
+            }
+        }
+
+        /**
+         * Handle BearerAdmissionRequest.
+         * @param bearerAdmissionRequest BearerAdmissionRequest
+         * @param ctx ChannelHandlerContext
+         * @throws IOException IO Exception
+         */
+        private void handleBeareradmissionrequest(BearerAdmissionRequest bearerAdmissionRequest,
+                                                  ChannelHandlerContext ctx) throws IOException {
+            ECGI ecgi = bearerAdmissionRequest.getEcgi();
+            CRNTI crnti = bearerAdmissionRequest.getCrnti();
+            ERABParams erabParams = bearerAdmissionRequest.getErabParams();
+            RnibLink link = linkMap.get(ecgi, crnti);
+            if (link != null) {
+                link.setBearerParameters(erabParams);
+            } else {
+                log.warn("Could not find link between {}-{}", ecgi, crnti);
+            }
+
+            BerInteger numErabs = bearerAdmissionRequest.getNumErabs();
+            // Encode and send Bearer Admission Response
+            XrancPdu sendPdu = BearerAdmissionResponse
+                    .constructPacket(ecgi, crnti, erabParams, numErabs, xranConfig.bearerFlag());
+            ctx.writeAndFlush(getSctpMessage(sendPdu));
+        }
+
+        /**
+         * Handle BearerReleaseInd.
+         * @param bearerReleaseInd
+         */
+        private void handleBearerreleaseind(BearerReleaseInd bearerReleaseInd) {
+            ECGI ecgi = bearerReleaseInd.getEcgi();
+            CRNTI crnti = bearerReleaseInd.getCrnti();
+            RnibLink link = linkMap.get(ecgi, crnti);
+
+            List<ERABID> erabidsRelease = bearerReleaseInd.getErabIds().getERABID();
+            List<ERABParamsItem> erabParamsItem = link.getBearerParameters().getERABParamsItem();
+
+            List<ERABParamsItem> unreleased = erabParamsItem
+                    .stream()
+                    .filter(item -> {
+                        Optional<ERABID> any = erabidsRelease.stream()
+                                .filter(id -> id.equals(item.getId())).findAny();
+                        return !any.isPresent();
+                    }).collect(Collectors.toList());
+
+            link.getBearerParameters().setERABParamsItem(new ArrayList<>(unreleased));
+        }
+
+        /**
+         * Handle HOFailure.
+         * @param hoFailure HOFailure
+         * @throws InterruptedException ueIdQueue interruption
+         */
+        private void handleHofailure(HOFailure hoFailure) throws InterruptedException {
+            try {
+                hoMap.get(hoFailure.getEcgi())
+                        .put("Hand Over Failed with cause: " + hoFailure.getCause());
+            } catch (InterruptedException e) {
+                log.error(ExceptionUtils.getFullStackTrace(e));
+                e.printStackTrace();
+            } finally {
+                hoMap.remove(hoFailure.getEcgi());
+                ueIdQueue.take();
+            }
+        }
+
+        /**
+         * Handle HOComplete.
+         * @param hoComplete HOComplete
+         * @param ctx ChannelHandlerContext
+         */
+        private void handleHocomplete(HOComplete hoComplete, ChannelHandlerContext ctx) {
+            EcgiCrntiPair ecgiCrntiPair = EcgiCrntiPair.valueOf(hoComplete.getEcgiT(),
+                    hoComplete.getCrntiNew());
+            contextUpdateMap.compute(ecgiCrntiPair, (k, v) -> {
+                if (v == null) {
+                    v = new ContextUpdateHandler();
+                }
+                if (v.setHoComplete(hoComplete)) {
+                    handleContextUpdate(v.getContextUpdate(), ctx, true);
+
+                    try {
+                        hoMap.get(hoComplete.getEcgiS()).put("Hand Over Completed");
+                    } catch (InterruptedException e) {
+                        log.error(ExceptionUtils.getFullStackTrace(e));
+                        e.printStackTrace();
+                    } finally {
+                        hoMap.remove(hoComplete.getEcgiS());
+                    }
+                }
+                return v;
+            });
+        }
+
+        /**
+         * Handle RXSigMeasReport.
+         * @param rxSigMeasReport RXSigMeasReport
+         */
+        private void handleRxsigmeasreport(RXSigMeasReport rxSigMeasReport) {
+            List<RXSigReport> rxSigReportList = rxSigMeasReport.getCellMeasReports().getRXSigReport();
+
+            RnibUe ue = ueMap.get(rxSigMeasReport.getEcgi(), rxSigMeasReport.getCrnti());
+            if (ue != null) {
+                Long ueId = ue.getId();
+
+                if (!rxSigReportList.isEmpty()) {
+                    rxSigReportList.forEach(rxSigReport -> {
+                        RnibCell cell = cellMap.get(rxSigReport.getPciArfcn());
+                        if (cell != null) {
+                            ECGI ecgi = cell.getEcgi();
+
+                            RnibLink link = linkMap.get(ecgi, ueId);
+                            if (link == null) {
+                                log.warn("Could not find link between: {}-{} | Creating non-serving link..",
+                                        ecgi, ueId);
+                                link = linkMap.putNonServingLink(cell, ueId);
+                            }
+
+                            if (link != null) {
+                                if (link.getType().equals(RnibLink.Type.NON_SERVING)) {
+                                    restartTimer(link);
+                                }
+
+                                RSRQRange rsrq = rxSigReport.getRsrq();
+                                RSRPRange rsrp = rxSigReport.getRsrp();
+
+                                RnibLink.LinkQuality quality = link.getQuality();
+                                quality.setRx(new RnibLink.LinkQuality.Rx(
+                                        rsrp.value.intValue() - 140,
+                                        (rsrq.value.intValue() * 0.5) - 19.5
+                                ));
+                            }
+                        } else {
+                            log.warn("case 16: Could not find cell with PCI-ARFCN: {}",
+                                    rxSigReport.getPciArfcn());
+                        }
+                    });
+                }
+            }
+        }
+
+        /**
+         * Handle RadioMeasReportPerUE.
+         * @param radioMeasReportPerUE RadioMeasReportPerUE
+         */
+        private void handleRadionmeasreportperue(RadioMeasReportPerUE radioMeasReportPerUE) {
+            RnibUe ue = ueMap.get(radioMeasReportPerUE.getEcgi(), radioMeasReportPerUE.getCrnti());
+            if (ue != null) {
+                Long ueId = ue.getId();
+                List<RadioRepPerServCell> servCells = radioMeasReportPerUE.getRadioReportServCells()
+                        .getRadioRepPerServCell();
+
+                servCells.forEach(servCell -> {
+                    RnibCell cell = cellMap.get(servCell.getPciArfcn());
+                    if (cell != null) {
+                        RnibLink link = linkMap.get(cell.getEcgi(), ueId);
+                        if (link != null) {
+                            RadioRepPerServCell.CqiHist cqiHist = servCell.getCqiHist();
+                            RnibLink.LinkQuality quality = link.getQuality();
+
+                            final double[] values = {0, 0, 0};
+                            final int[] i = {1};
+                            cqiHist.getBerInteger().forEach(value -> {
+                                values[0] = Math.max(values[0], value.intValue());
+                                values[1] += i[0] * value.intValue();
+                                values[2] += value.intValue();
+                                i[0]++;
+                            });
+
+                            quality.setCqi(new RnibLink.LinkQuality.Cqi(
+                                    cqiHist,
+                                    values[0],
+                                    values[1] / values[0]
+                            ));
+
+                        } else {
+                            log.warn("Could not find link between: {}-{}", cell.getEcgi(), ueId);
+                        }
+                    } else {
+                        log.warn("case 18: Could not find cell with PCI-ARFCN: {}", servCell.getPciArfcn());
+                    }
+                });
+            }
+        }
+
+        /**
+         * Handle SchedMeasReportPerUE.
+         * @param schedMeasReportPerUE SchedMeasReportPerUE
+         */
+        private void handleSchedmeasreportperue(SchedMeasReportPerUE schedMeasReportPerUE) {
+            RnibUe ue = ueMap.get(schedMeasReportPerUE.getEcgi(), schedMeasReportPerUE.getCrnti());
+            if (ue != null) {
+                Long ueId = ue.getId();
+
+                List<SchedMeasRepPerServCell> servCells = schedMeasReportPerUE.getSchedReportServCells()
+                        .getSchedMeasRepPerServCell();
+
+                servCells.forEach(servCell -> {
+                    RnibCell cell = cellMap.get(servCell.getPciArfcn());
+                    if (cell != null) {
+                        RnibLink link = linkMap.get(cell.getEcgi(), ueId);
+                        if (link != null) {
+                            link.getQuality().setMcs(new RnibLink.LinkQuality.Mcs(
+                                    servCell.getMcsDl(),
+                                    servCell.getMcsUl()
+                            ));
+
+                            link.setResourceUsage(new RnibLink.ResourceUsage(
+                                    servCell.getPrbUsage().getPrbUsageDl(),
+                                    servCell.getPrbUsage().getPrbUsageUl()
+                            ));
+                        } else {
+                            log.warn("Could not find link between: {}-{}", cell.getEcgi(), ueId);
+                        }
+                    } else {
+                        log.warn("case 20: Could not find cell with PCI-ARFCN: {}", servCell.getPciArfcn());
+                    }
+                });
+            }
+        }
+
+        /**
+         * Handle SchedMeasReportPerCell.
+         * @param schedMeasReportPerCell SchedMeasReportPerCell
+         */
+        private void handleSchedmeasreportpercell(SchedMeasReportPerCell schedMeasReportPerCell) {
+            RnibCell cell = cellMap.get(schedMeasReportPerCell.getEcgi());
+            if (cell != null) {
+                cell.setPrbUsage(new RnibCell.PrbUsageContainer(
+                        schedMeasReportPerCell.getPrbUsagePcell(),
+                        schedMeasReportPerCell.getPrbUsageScell()
+                ));
+
+                cell.setQci(schedMeasReportPerCell.getQciVals());
+            } else {
+                log.warn("Could not find cell with ECGI: {}", schedMeasReportPerCell.getEcgi());
+            }
+        }
+
+        /**
+         * Handle PDCPMeasReportPerUe.
+         * @param pdcpMeasReportPerUe PDCPMeasReportPerUe
+         */
+        private void handlePdcpmeasreportperue(PDCPMeasReportPerUe pdcpMeasReportPerUe) {
+            RnibUe ue = ueMap.get(pdcpMeasReportPerUe.getEcgi(), pdcpMeasReportPerUe.getCrnti());
+            if (ue != null) {
+                Long ueId = ue.getId();
+                RnibLink link = linkMap.get(pdcpMeasReportPerUe.getEcgi(), ueId);
+                if (link != null) {
+                    link.setPdcpThroughput(new RnibLink.PdcpThroughput(
+                            pdcpMeasReportPerUe.getThroughputDl(),
+                            pdcpMeasReportPerUe.getThroughputUl()
+                    ));
+
+                    link.setPdcpPackDelay(new RnibLink.PdcpPacketdelay(
+                            pdcpMeasReportPerUe.getPktDelayDl(),
+                            pdcpMeasReportPerUe.getPktDelayUl()
+                    ));
+                } else {
+                    log.warn("Could not find link between: {}-{}", pdcpMeasReportPerUe.getEcgi(), ueId);
+                }
+            }
+        }
+
+        /**
+         * Handle UECapabilityInfo.
+         * @param capabilityInfo UECapabilityInfo
+         */
+        private void handleCapabilityinfo(UECapabilityInfo capabilityInfo) {
+            RnibUe ue = ueMap.get(capabilityInfo.getEcgi(), capabilityInfo.getCrnti());
+            if (ue != null) {
+                ue.setCapability(capabilityInfo);
+            } else {
+                log.warn("Could not find UE with this CRNTI: {}", capabilityInfo.getCrnti());
+            }
+        }
+
+        /**
+         * Handle UECapabilityEnquiry.
+         * @param ueCapabilityEnquiry UECapabilityEnquiry
+         * @param ctx ChannelHandlerContext
+         * @throws IOException IO Exception
+         */
+        private void handleUecapabilityenquiry(UECapabilityEnquiry ueCapabilityEnquiry, ChannelHandlerContext ctx)
+                throws IOException {
+            XrancPdu xrancPdu = UECapabilityEnquiry.constructPacket(ueCapabilityEnquiry.getEcgi(),
+                    ueCapabilityEnquiry.getCrnti());
+            ctx.writeAndFlush(getSctpMessage(xrancPdu));
+        }
+
+        /**
+         * Handle ScellAddStatus.
+         * @param scellAddStatus ScellAddStatus
+         */
+        private void handleScelladdstatus(ScellAddStatus scellAddStatus) {
+            RnibUe ue = ueMap.get(scellAddStatus.getEcgi(), scellAddStatus.getCrnti());
+            if (ue != null) {
+                Long ueId = ue.getId();
+                try {
+                    scellAddMap.get(scellAddStatus.getCrnti()).put("Scell's status: " +
+                            scellAddStatus.getStatus());
+                    final int[] i = {0};
+                    scellAddStatus.getScellsInd().getPCIARFCN().forEach(
+                            pciarfcn -> {
+                                if (scellAddStatus.getStatus().getBerEnum().get(i[0]).value.intValue() == 0) {
+                                    RnibCell cell = cellMap.get(pciarfcn);
+                                    RnibLink link = linkMap.get(cell.getEcgi(), ueId);
+                                    link.setType(RnibLink.Type.SERVING_SECONDARY_CA);
+                                }
+                                i[0]++;
+                            }
+                    );
+
+                } catch (InterruptedException e) {
+                    log.error(ExceptionUtils.getFullStackTrace(e));
+                    e.printStackTrace();
+                } finally {
+                    scellAddMap.remove(scellAddStatus.getCrnti());
+                }
+            }
+        }
+
+        /**
+         * Handle RRMConfigStatus.
+         * @param rrmConfigStatus RRMConfigStatus
+         */
+        private void handleRrmconfigstatus(RRMConfigStatus rrmConfigStatus) {
+            try {
+                rrmcellMap.get(rrmConfigStatus.getEcgi())
+                        .put("RRM Config's status: " + rrmConfigStatus.getStatus());
+            } catch (InterruptedException e) {
+                log.error(ExceptionUtils.getFullStackTrace(e));
+                e.printStackTrace();
+            } finally {
+                rrmcellMap.remove(rrmConfigStatus.getEcgi());
+            }
+        }
+
+        /**
+         * Handle TrafficSplitConfig.
+         * @param trafficSplitConfig TrafficSplitConfig
+         */
+        private void handleTrafficSplitConfig(TrafficSplitConfig trafficSplitConfig) {
+            RnibUe ue = ueMap.get(trafficSplitConfig.getEcgi(), trafficSplitConfig.getCrnti());
+            if (ue != null) {
+                Long ueId = ue.getId();
+                List<TrafficSplitPercentage> splitPercentages = trafficSplitConfig
+                        .getTrafficSplitPercent().getTrafficSplitPercentage();
+
+                splitPercentages.forEach(trafficSplitPercentage -> {
+                    RnibCell cell = cellMap.get(trafficSplitPercentage.getEcgi());
+                    if (cell != null) {
+                        RnibLink link = linkMap.get(cell.getEcgi(), ueId);
+                        if (link != null) {
+                            link.setTrafficPercent(trafficSplitPercentage);
+                        } else {
+                            log.warn("Could not find link between: {}-{}", cell.getEcgi(), ueId);
+                        }
+                    } else {
+                        log.warn("Could not find cell with ECGI: {}", trafficSplitConfig.getEcgi());
+                    }
+                });
+            }
+        }
+
+        /**
+         * Handle context update depending if its handoff or not.
+         *
+         * @param contextUpdate context update packet
+         * @param ctx           channel context for the CELL
+         * @param handoff       true if we handle a Hand Off
+         */
         private void handleContextUpdate(UEContextUpdate contextUpdate, ChannelHandlerContext ctx, boolean handoff) {
             RnibUe ue;
             RnibCell cell = xranStore.getCell(contextUpdate.getEcgi());
@@ -1078,6 +1366,9 @@
         }
     }
 
+    /**
+     * Internal class for NetworkConfigListener.
+     */
     class InternalNetworkConfigListener implements NetworkConfigListener {
 
         @Override
@@ -1100,6 +1391,11 @@
             }
         }
 
+        /**
+         * Handle config event.
+         *
+         * @param config
+         */
         private void handleConfigEvent(Optional<Config> config) {
             if (!config.isPresent()) {
                 return;
@@ -1107,7 +1403,7 @@
 
             xranConfig = (XranConfig) config.get();
 
-            northbound_timeout = xranConfig.getNorthBoundTimeout();
+            northboundTimeout = xranConfig.getNorthBoundTimeout();
 
             legitCells.putAll(xranConfig.activeCellSet());
 
diff --git a/src/main/java/org.onosproject.xran/controller/XranDeviceAgent.java b/src/main/java/org.onosproject.xran/controller/XranDeviceAgent.java
index b81a628..a322c47 100644
--- a/src/main/java/org.onosproject.xran/controller/XranDeviceAgent.java
+++ b/src/main/java/org.onosproject.xran/controller/XranDeviceAgent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-present Open Networking Laboratory
+ * Copyright 2015-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.
@@ -19,11 +19,24 @@
 import io.netty.channel.ChannelHandlerContext;
 
 /**
- * Created by dimitris on 7/27/17.
+ * Xran device agent interface.
  */
 public interface XranDeviceAgent {
 
+    /**
+     * Add connected CELL.
+     *
+     * @param host IP of host trying to connect
+     * @param ctx  channel of CELL speaking to
+     * @return true if succeeded
+     */
     boolean addConnectedCell(String host, ChannelHandlerContext ctx);
 
+    /**
+     * Remove disconnected CELL.
+     *
+     * @param host IP of host disconnected
+     * @return true if remove succeeded
+     */
     boolean removeConnectedCell(String host);
 }
diff --git a/src/main/java/org.onosproject.xran/controller/XranHostAgent.java b/src/main/java/org.onosproject.xran/controller/XranHostAgent.java
index 07ab26e..9c335da 100644
--- a/src/main/java/org.onosproject.xran/controller/XranHostAgent.java
+++ b/src/main/java/org.onosproject.xran/controller/XranHostAgent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-present Open Networking Laboratory
+ * Copyright 2015-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.
@@ -21,10 +21,25 @@
 import org.onosproject.xran.entities.RnibUe;
 
 /**
- * Created by dimitris on 7/28/17.
+ * Xran host agent interface.
  */
 public interface XranHostAgent {
+
+    /**
+     * Add connected host.
+     *
+     * @param ue   UE entity
+     * @param cell CELL entity
+     * @param ctx  channel of CELL
+     * @return true if succeeded
+     */
     boolean addConnectedHost(RnibUe ue, RnibCell cell, ChannelHandlerContext ctx);
 
+    /**
+     * Remove disconnected host.
+     *
+     * @param ue UE entity
+     * @return true if remove succeeded
+     */
     boolean removeConnectedHost(RnibUe ue);
 }
diff --git a/src/main/java/org.onosproject.xran/controller/XranPacketProcessor.java b/src/main/java/org.onosproject.xran/controller/XranPacketProcessor.java
index 73cb587..893b21d 100644
--- a/src/main/java/org.onosproject.xran/controller/XranPacketProcessor.java
+++ b/src/main/java/org.onosproject.xran/controller/XranPacketProcessor.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015-present Open Networking Laboratory
+ * Copyright 2015-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.
@@ -17,11 +17,21 @@
 package org.onosproject.xran.controller;
 
 import io.netty.channel.ChannelHandlerContext;
-import org.onosproject.net.DeviceId;
 import org.onosproject.xran.codecs.pdu.XrancPdu;
 
 import java.io.IOException;
 
+/**
+ * Xran packet processor interface.
+ */
 public interface XranPacketProcessor {
+    /**
+     * Handle an incoming packet.
+     *
+     * @param pdu pdu of incoming packet
+     * @param ctx channel received the packet
+     * @throws IOException io exception
+     * @throws InterruptedException interrupted exception
+     */
     void handlePacket(XrancPdu pdu, ChannelHandlerContext ctx) throws IOException, InterruptedException;
 }
diff --git a/src/main/java/org.onosproject.xran/controller/package-info.java b/src/main/java/org.onosproject.xran/controller/package-info.java
index 7f4660f..866c396 100644
--- a/src/main/java/org.onosproject.xran/controller/package-info.java
+++ b/src/main/java/org.onosproject.xran/controller/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-present Open Networking Laboratory
+ * Copyright 2016-present Open Networking Foundation
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.