diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/DefaultInstancePort.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/DefaultInstancePort.java
index 23dc684..f4569d5 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/DefaultInstancePort.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/DefaultInstancePort.java
@@ -82,6 +82,13 @@
         this.oldPortNumber = oldPortNumber;
     }
 
+    /**
+     * A constructor fed by host and state.
+     *
+     * @param host  host object
+     * @param state instance port state
+     * @return instance port
+     */
     public static DefaultInstancePort from(Host host, State state) {
         checkNotNull(host);
         checkArgument(!Strings.isNullOrEmpty(
@@ -94,6 +101,15 @@
         return new DefaultInstancePort(host, state, null, null);
     }
 
+    /**
+     * A constructor fed by host, state, device ID and port number.
+     *
+     * @param host  host object
+     * @param state instance port state
+     * @param oldDeviceId device identifier
+     * @param oldPortNumber port number
+     * @return instance port
+     */
     public static DefaultInstancePort from(Host host,
                                            State state,
                                            DeviceId oldDeviceId,
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/DistributedInstancePortStore.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/DistributedInstancePortStore.java
index 3ad00b5..e34ddbe 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/DistributedInstancePortStore.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/DistributedInstancePortStore.java
@@ -160,24 +160,13 @@
         public void event(MapEvent<String, InstancePort> event) {
             switch (event.type()) {
                 case INSERT:
-                    log.debug("Instance port created");
-                    eventExecutor.execute(() ->
-                            notifyDelegate(new InstancePortEvent(
-                                    OPENSTACK_INSTANCE_PORT_DETECTED,
-                                    event.newValue().value()))
-                    );
+                    eventExecutor.execute(() -> processInstancePortMapInsertion(event));
                     break;
                 case UPDATE:
-                    log.debug("Instance port updated");
-                    eventExecutor.execute(() -> processInstancePortUpdate(event));
+                    eventExecutor.execute(() -> processInstancePortMapUpdate(event));
                     break;
                 case REMOVE:
-                    log.debug("Instance port removed");
-                    eventExecutor.execute(() ->
-                            notifyDelegate(new InstancePortEvent(
-                                    OPENSTACK_INSTANCE_PORT_VANISHED,
-                                    event.oldValue().value()))
-                    );
+                    eventExecutor.execute(() -> processInstancePortMapRemoval(event));
                     break;
                 default:
                     log.error("Unsupported instance port event type");
@@ -185,6 +174,25 @@
             }
         }
 
+        private void processInstancePortMapUpdate(MapEvent<String, InstancePort> event) {
+            log.debug("Instance port updated");
+            processInstancePortUpdate(event);
+        }
+
+        private void processInstancePortMapInsertion(MapEvent<String, InstancePort> event) {
+            log.debug("Instance port created");
+            notifyDelegate(new InstancePortEvent(
+                    OPENSTACK_INSTANCE_PORT_DETECTED,
+                    event.newValue().value()));
+        }
+
+        private void processInstancePortMapRemoval(MapEvent<String, InstancePort> event) {
+            log.debug("Instance port removed");
+            notifyDelegate(new InstancePortEvent(
+                    OPENSTACK_INSTANCE_PORT_VANISHED,
+                    event.oldValue().value()));
+        }
+
         private void processInstancePortUpdate(MapEvent<String, InstancePort> event) {
             InstancePort.State oldState = event.oldValue().value().state();
             InstancePort.State newState = event.newValue().value().state();
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/DistributedOpenstackNetworkStore.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/DistributedOpenstackNetworkStore.java
index fba1599..fe91af1 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/DistributedOpenstackNetworkStore.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/DistributedOpenstackNetworkStore.java
@@ -282,34 +282,40 @@
         public void event(MapEvent<String, Network> event) {
             switch (event.type()) {
                 case UPDATE:
-                    log.debug("OpenStack network updated");
-                    eventExecutor.execute(() ->
-                        notifyDelegate(new OpenstackNetworkEvent(
-                                OPENSTACK_NETWORK_UPDATED,
-                                event.newValue().value()))
-                    );
+                    eventExecutor.execute(() -> processNetworkMapUpdate(event));
                     break;
                 case INSERT:
-                    log.debug("OpenStack network created");
-                    eventExecutor.execute(() ->
-                        notifyDelegate(new OpenstackNetworkEvent(
-                                OPENSTACK_NETWORK_CREATED,
-                                event.newValue().value()))
-                    );
+                    eventExecutor.execute(() -> processNetworkMapInsertion(event));
                     break;
                 case REMOVE:
-                    log.debug("OpenStack network removed");
-                    eventExecutor.execute(() ->
-                        notifyDelegate(new OpenstackNetworkEvent(
-                                OPENSTACK_NETWORK_REMOVED,
-                                event.oldValue().value()))
-                    );
+                    eventExecutor.execute(() -> processNetworkMapRemoval(event));
                     break;
                 default:
                     log.error("Unsupported openstack network event type");
                     break;
             }
         }
+
+        private void processNetworkMapUpdate(MapEvent<String, Network> event) {
+            log.debug("OpenStack network updated");
+            notifyDelegate(new OpenstackNetworkEvent(
+                    OPENSTACK_NETWORK_UPDATED,
+                    event.newValue().value()));
+        }
+
+        private void processNetworkMapInsertion(MapEvent<String, Network> event) {
+            log.debug("OpenStack network created");
+            notifyDelegate(new OpenstackNetworkEvent(
+                    OPENSTACK_NETWORK_CREATED,
+                    event.newValue().value()));
+        }
+
+        private void processNetworkMapRemoval(MapEvent<String, Network> event) {
+            log.debug("OpenStack network removed");
+            notifyDelegate(new OpenstackNetworkEvent(
+                    OPENSTACK_NETWORK_REMOVED,
+                    event.oldValue().value()));
+        }
     }
 
     private class OpenstackSubnetMapListener implements MapEventListener<String, Subnet> {
@@ -318,37 +324,43 @@
         public void event(MapEvent<String, Subnet> event) {
             switch (event.type()) {
                 case UPDATE:
-                    log.debug("OpenStack subnet updated");
-                    eventExecutor.execute(() ->
-                        notifyDelegate(new OpenstackNetworkEvent(
-                                OPENSTACK_SUBNET_UPDATED,
-                                network(event.newValue().value().getNetworkId()),
-                                event.newValue().value()))
-                    );
+                    eventExecutor.execute(() -> processSubnetMapUpdate(event));
                     break;
                 case INSERT:
-                    log.debug("OpenStack subnet created");
-                    eventExecutor.execute(() ->
-                        notifyDelegate(new OpenstackNetworkEvent(
-                                OPENSTACK_SUBNET_CREATED,
-                                network(event.newValue().value().getNetworkId()),
-                                event.newValue().value()))
-                    );
+                    eventExecutor.execute(() -> processSubnetMapInsertion(event));
                     break;
                 case REMOVE:
-                    log.debug("OpenStack subnet removed");
-                    eventExecutor.execute(() ->
-                        notifyDelegate(new OpenstackNetworkEvent(
-                                OPENSTACK_SUBNET_REMOVED,
-                                network(event.oldValue().value().getNetworkId()),
-                                event.oldValue().value()))
-                    );
+                    eventExecutor.execute(() -> processSubnetMapRemoval(event));
                     break;
                 default:
                     log.error("Unsupported openstack subnet event type");
                     break;
             }
         }
+
+        private void processSubnetMapUpdate(MapEvent<String, Subnet> event) {
+            log.debug("OpenStack subnet updated");
+            notifyDelegate(new OpenstackNetworkEvent(
+                    OPENSTACK_SUBNET_UPDATED,
+                    network(event.newValue().value().getNetworkId()),
+                    event.newValue().value()));
+        }
+
+        private void processSubnetMapInsertion(MapEvent<String, Subnet> event) {
+            log.debug("OpenStack subnet created");
+            notifyDelegate(new OpenstackNetworkEvent(
+                    OPENSTACK_SUBNET_CREATED,
+                    network(event.newValue().value().getNetworkId()),
+                    event.newValue().value()));
+        }
+
+        private void processSubnetMapRemoval(MapEvent<String, Subnet> event) {
+            log.debug("OpenStack subnet removed");
+            notifyDelegate(new OpenstackNetworkEvent(
+                    OPENSTACK_SUBNET_REMOVED,
+                    network(event.oldValue().value().getNetworkId()),
+                    event.oldValue().value()));
+        }
     }
 
     private class OpenstackPortMapListener implements MapEventListener<String, Port> {
@@ -357,40 +369,13 @@
         public void event(MapEvent<String, Port> event) {
             switch (event.type()) {
                 case UPDATE:
-                    eventExecutor.execute(() -> {
-                        Port oldPort = event.oldValue().value();
-                        Port newPort = event.newValue().value();
-                        notifyDelegate(new OpenstackNetworkEvent(
-                                OPENSTACK_PORT_UPDATED,
-                                network(event.newValue().value().getNetworkId()), newPort));
-                        processSecurityGroupUpdate(oldPort, newPort);
-                    });
+                    eventExecutor.execute(() -> processPortMapUpdate(event));
                     break;
                 case INSERT:
-                    log.debug("OpenStack port created");
-                    eventExecutor.execute(() ->
-                        notifyDelegate(new OpenstackNetworkEvent(
-                                OPENSTACK_PORT_CREATED,
-                                network(event.newValue().value().getNetworkId()),
-                                event.newValue().value()))
-                    );
+                    eventExecutor.execute(() -> processPortMapInsertion(event));
                     break;
                 case REMOVE:
-                    log.debug("OpenStack port removed");
-
-                    eventExecutor.execute(() ->
-                            notifyDelegate(new OpenstackNetworkEvent(
-                                    OPENSTACK_PORT_PRE_REMOVE,
-                                    network(event.oldValue().value().getNetworkId()),
-                                    event.oldValue().value()))
-                    );
-
-                    eventExecutor.execute(() ->
-                        notifyDelegate(new OpenstackNetworkEvent(
-                                OPENSTACK_PORT_REMOVED,
-                                network(event.oldValue().value().getNetworkId()),
-                                event.oldValue().value()))
-                    );
+                    eventExecutor.execute(() -> processPortMapRemoval(event));
                     break;
                 default:
                     log.error("Unsupported openstack port event type");
@@ -398,6 +383,37 @@
             }
         }
 
+        private void processPortMapUpdate(MapEvent<String, Port> event) {
+            log.debug("OpenStack port updated");
+            Port oldPort = event.oldValue().value();
+            Port newPort = event.newValue().value();
+            notifyDelegate(new OpenstackNetworkEvent(
+                    OPENSTACK_PORT_UPDATED,
+                    network(event.newValue().value().getNetworkId()), newPort));
+            processSecurityGroupUpdate(oldPort, newPort);
+        }
+
+        private void processPortMapInsertion(MapEvent<String, Port> event) {
+            log.debug("OpenStack port created");
+            notifyDelegate(new OpenstackNetworkEvent(
+                    OPENSTACK_PORT_CREATED,
+                    network(event.newValue().value().getNetworkId()),
+                    event.newValue().value()));
+        }
+
+        private void processPortMapRemoval(MapEvent<String, Port> event) {
+            log.debug("OpenStack port removed");
+            notifyDelegate(new OpenstackNetworkEvent(
+                    OPENSTACK_PORT_PRE_REMOVE,
+                    network(event.oldValue().value().getNetworkId()),
+                    event.oldValue().value()));
+
+            notifyDelegate(new OpenstackNetworkEvent(
+                    OPENSTACK_PORT_REMOVED,
+                    network(event.oldValue().value().getNetworkId()),
+                    event.oldValue().value()));
+        }
+
         private void processSecurityGroupUpdate(Port oldPort, Port newPort) {
             List<String> oldSecurityGroups = oldPort.getSecurityGroups() == null ?
                     ImmutableList.of() : oldPort.getSecurityGroups();
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/DistributedOpenstackRouterStore.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/DistributedOpenstackRouterStore.java
index c8bd925..03e86bf 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/DistributedOpenstackRouterStore.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/DistributedOpenstackRouterStore.java
@@ -272,29 +272,13 @@
         public void event(MapEvent<String, Router> event) {
             switch (event.type()) {
                 case UPDATE:
-                    log.debug("OpenStack router updated");
-                    eventExecutor.execute(() -> {
-                        notifyDelegate(new OpenstackRouterEvent(
-                                OPENSTACK_ROUTER_UPDATED,
-                                event.newValue().value()));
-                        processGatewayUpdate(event);
-                    });
+                    eventExecutor.execute(() -> processRouterMapUpdate(event));
                     break;
                 case INSERT:
-                    log.debug("OpenStack router created");
-                    eventExecutor.execute(() ->
-                        notifyDelegate(new OpenstackRouterEvent(
-                                OPENSTACK_ROUTER_CREATED,
-                                event.newValue().value()))
-                    );
+                    eventExecutor.execute(() -> processRouterMapInsertion(event));
                     break;
                 case REMOVE:
-                    log.debug("OpenStack router removed");
-                    eventExecutor.execute(() ->
-                        notifyDelegate(new OpenstackRouterEvent(
-                                OPENSTACK_ROUTER_REMOVED,
-                                event.oldValue().value()))
-                    );
+                    eventExecutor.execute(() -> processRouterMapRemoval(event));
                     break;
                 default:
                     log.error("Unsupported openstack router event type");
@@ -302,6 +286,28 @@
             }
         }
 
+        private void processRouterMapUpdate(MapEvent<String, Router> event) {
+            log.debug("OpenStack router updated");
+            notifyDelegate(new OpenstackRouterEvent(
+                    OPENSTACK_ROUTER_UPDATED,
+                    event.newValue().value()));
+            processGatewayUpdate(event);
+        }
+
+        private void processRouterMapInsertion(MapEvent<String, Router> event) {
+            log.debug("OpenStack router created");
+            notifyDelegate(new OpenstackRouterEvent(
+                    OPENSTACK_ROUTER_CREATED,
+                    event.newValue().value()));
+        }
+
+        private void processRouterMapRemoval(MapEvent<String, Router> event) {
+            log.debug("OpenStack router removed");
+            notifyDelegate(new OpenstackRouterEvent(
+                    OPENSTACK_ROUTER_REMOVED,
+                    event.oldValue().value()));
+        }
+
         private void processGatewayUpdate(MapEvent<String, Router> event) {
             ExternalGateway oldGateway = event.oldValue().value().getExternalGatewayInfo();
             ExternalGateway newGateway = event.newValue().value().getExternalGatewayInfo();
@@ -326,37 +332,43 @@
         public void event(MapEvent<String, RouterInterface> event) {
             switch (event.type()) {
                 case UPDATE:
-                    log.debug("OpenStack router interface updated");
-                    eventExecutor.execute(() ->
-                        notifyDelegate(new OpenstackRouterEvent(
-                                OPENSTACK_ROUTER_INTERFACE_UPDATED,
-                                router(event.newValue().value().getId()),
-                                event.newValue().value()))
-                    );
+                    eventExecutor.execute(() -> processRouterIntfUpdate(event));
                     break;
                 case INSERT:
-                    log.debug("OpenStack router interface created");
-                    eventExecutor.execute(() ->
-                        notifyDelegate(new OpenstackRouterEvent(
-                                OPENSTACK_ROUTER_INTERFACE_ADDED,
-                                router(event.newValue().value().getId()),
-                                event.newValue().value()))
-                    );
+                    eventExecutor.execute(() -> processRouterIntfInsertion(event));
                     break;
                 case REMOVE:
-                    log.debug("OpenStack router interface removed");
-                    eventExecutor.execute(() ->
-                        notifyDelegate(new OpenstackRouterEvent(
-                                OPENSTACK_ROUTER_INTERFACE_REMOVED,
-                                router(event.oldValue().value().getId()),
-                                event.oldValue().value()))
-                    );
+                    eventExecutor.execute(() -> processRouterIntfRemoval(event));
                     break;
                 default:
                     log.error("Unsupported openstack router interface event type");
                     break;
             }
         }
+
+        private void processRouterIntfUpdate(MapEvent<String, RouterInterface> event) {
+            log.debug("OpenStack router interface updated");
+            notifyDelegate(new OpenstackRouterEvent(
+                    OPENSTACK_ROUTER_INTERFACE_UPDATED,
+                    router(event.newValue().value().getId()),
+                    event.newValue().value()));
+        }
+
+        private void processRouterIntfInsertion(MapEvent<String, RouterInterface> event) {
+            log.debug("OpenStack router interface created");
+            notifyDelegate(new OpenstackRouterEvent(
+                    OPENSTACK_ROUTER_INTERFACE_ADDED,
+                    router(event.newValue().value().getId()),
+                    event.newValue().value()));
+        }
+
+        private void processRouterIntfRemoval(MapEvent<String, RouterInterface> event) {
+            log.debug("OpenStack router interface removed");
+            notifyDelegate(new OpenstackRouterEvent(
+                    OPENSTACK_ROUTER_INTERFACE_REMOVED,
+                    router(event.oldValue().value().getId()),
+                    event.oldValue().value()));
+        }
     }
 
     private class OpenstackFloatingIpMapListener
@@ -366,44 +378,13 @@
         public void event(MapEvent<String, NetFloatingIP> event) {
             switch (event.type()) {
                 case UPDATE:
-                    log.debug("OpenStack floating IP updated");
-                    eventExecutor.execute(() -> {
-                        Router osRouter = Strings.isNullOrEmpty(
-                                event.newValue().value().getRouterId()) ?
-                                null :
-                                router(event.newValue().value().getRouterId());
-                        notifyDelegate(new OpenstackRouterEvent(
-                                OPENSTACK_FLOATING_IP_UPDATED,
-                                osRouter,
-                                event.newValue().value()));
-                        processFloatingIpUpdate(event, osRouter);
-                    });
+                    eventExecutor.execute(() -> processFloatingIpMapUpdate(event));
                     break;
                 case INSERT:
-                    log.debug("OpenStack floating IP created");
-                    eventExecutor.execute(() -> {
-                        Router osRouter = Strings.isNullOrEmpty(
-                                event.newValue().value().getRouterId()) ?
-                                null :
-                                router(event.newValue().value().getRouterId());
-                        notifyDelegate(new OpenstackRouterEvent(
-                                OPENSTACK_FLOATING_IP_CREATED,
-                                osRouter,
-                                event.newValue().value()));
-                    });
+                    eventExecutor.execute(() -> processFloatingIpMapInsertion(event));
                     break;
                 case REMOVE:
-                    log.debug("OpenStack floating IP removed");
-                    eventExecutor.execute(() -> {
-                        Router osRouter = Strings.isNullOrEmpty(
-                                event.oldValue().value().getRouterId()) ?
-                                null :
-                                router(event.oldValue().value().getRouterId());
-                        notifyDelegate(new OpenstackRouterEvent(
-                                OPENSTACK_FLOATING_IP_REMOVED,
-                                osRouter,
-                                event.oldValue().value()));
-                    });
+                    eventExecutor.execute(() -> processFloatingIpMapRemoval(event));
                     break;
                 default:
                     log.error("Unsupported openstack floating IP event type");
@@ -411,6 +392,43 @@
             }
         }
 
+        private void processFloatingIpMapUpdate(MapEvent<String, NetFloatingIP> event) {
+            log.debug("OpenStack floating IP updated");
+            Router osRouter = Strings.isNullOrEmpty(
+                    event.newValue().value().getRouterId()) ?
+                    null :
+                    router(event.newValue().value().getRouterId());
+            notifyDelegate(new OpenstackRouterEvent(
+                    OPENSTACK_FLOATING_IP_UPDATED,
+                    osRouter,
+                    event.newValue().value()));
+            processFloatingIpUpdate(event, osRouter);
+        }
+
+        private void processFloatingIpMapInsertion(MapEvent<String, NetFloatingIP> event) {
+            log.debug("OpenStack floating IP created");
+            Router osRouter = Strings.isNullOrEmpty(
+                    event.newValue().value().getRouterId()) ?
+                    null :
+                    router(event.newValue().value().getRouterId());
+            notifyDelegate(new OpenstackRouterEvent(
+                    OPENSTACK_FLOATING_IP_CREATED,
+                    osRouter,
+                    event.newValue().value()));
+        }
+
+        private void processFloatingIpMapRemoval(MapEvent<String, NetFloatingIP> event) {
+            log.debug("OpenStack floating IP removed");
+            Router osRouter = Strings.isNullOrEmpty(
+                    event.oldValue().value().getRouterId()) ?
+                    null :
+                    router(event.oldValue().value().getRouterId());
+            notifyDelegate(new OpenstackRouterEvent(
+                    OPENSTACK_FLOATING_IP_REMOVED,
+                    osRouter,
+                    event.oldValue().value()));
+        }
+
         private void processFloatingIpUpdate(MapEvent<String, NetFloatingIP> event,
                                              Router osRouter) {
             String oldPortId = event.oldValue().value().getPortId();
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackMetadataProxyHandler.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackMetadataProxyHandler.java
index 66250e0..011768d 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackMetadataProxyHandler.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackMetadataProxyHandler.java
@@ -634,6 +634,9 @@
      */
     protected static class Http extends BasePacket {
 
+        /**
+         * HTTP packet type.
+         */
         public enum Type {
 
             /**
@@ -650,6 +653,9 @@
         private Type type;
         private HttpMessage message;
 
+        Http() {
+        }
+
         /**
          * Obtains the Http type.
          *
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackSwitchingDhcpHandler.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackSwitchingDhcpHandler.java
index 6111395..4e3dbbb 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackSwitchingDhcpHandler.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackSwitchingDhcpHandler.java
@@ -120,6 +120,11 @@
     private static final int V4_CIDR_UPPER_BOUND = 33;
     private static final int PADDING_SIZE = 4;
 
+    private static final byte HARDWARE_ADDR_LENGTH = (byte) 6;
+    private static final byte DHCP_OPTION_DATA_LENGTH = (byte) 4;
+    private static final int DHCP_OPTION_DNS_LENGTH = 8;
+    private static final int DHCP_OPTION_MTU_LENGTH = 2;
+
     @Reference(cardinality = ReferenceCardinality.MANDATORY)
     protected CoreService coreService;
 
@@ -361,7 +366,7 @@
             DHCP dhcpReply = new DHCP();
             dhcpReply.setOpCode(DHCP.OPCODE_REPLY);
             dhcpReply.setHardwareType(DHCP.HWTYPE_ETHERNET);
-            dhcpReply.setHardwareAddressLength((byte) 6);
+            dhcpReply.setHardwareAddressLength(HARDWARE_ADDR_LENGTH);
             dhcpReply.setTransactionId(request.getTransactionId());
             dhcpReply.setFlags(request.getFlags());
             dhcpReply.setYourIPAddress(yourIp.toInt());
@@ -422,7 +427,7 @@
         private DhcpOption doServerId(IpAddress gatewayIp) {
             DhcpOption option = new DhcpOption();
             option.setCode(OptionCode_DHCPServerIp.getValue());
-            option.setLength((byte) 4);
+            option.setLength(DHCP_OPTION_DATA_LENGTH);
             option.setData(gatewayIp.toOctets());
             return option;
         }
@@ -430,7 +435,7 @@
         private DhcpOption doLeaseTime() {
             DhcpOption option = new DhcpOption();
             option.setCode(OptionCode_LeaseTime.getValue());
-            option.setLength((byte) 4);
+            option.setLength(DHCP_OPTION_DATA_LENGTH);
             option.setData(DHCP_DATA_LEASE_INFINITE);
             return option;
         }
@@ -439,7 +444,7 @@
             Ip4Address subnetMask = Ip4Address.makeMaskPrefix(subnetPrefixLen);
             DhcpOption option = new DhcpOption();
             option.setCode(OptionCode_SubnetMask.getValue());
-            option.setLength((byte) 4);
+            option.setLength(DHCP_OPTION_DATA_LENGTH);
             option.setData(subnetMask.toOctets());
             return option;
         }
@@ -448,7 +453,7 @@
             Ip4Address broadcast = Ip4Address.makeMaskedAddress(yourIp, subnetPrefixLen);
             DhcpOption option = new DhcpOption();
             option.setCode(OptionCode_BroadcastAddress.getValue());
-            option.setLength((byte) 4);
+            option.setLength(DHCP_OPTION_DATA_LENGTH);
             option.setData(broadcast.toOctets());
             return option;
         }
@@ -460,8 +465,8 @@
             option.setCode(OptionCode_DomainServer.getValue());
 
             if (dnsServers.isEmpty()) {
-                option.setLength((byte) 8);
-                ByteBuffer dnsByteBuf = ByteBuffer.allocate(8);
+                option.setLength((byte) DHCP_OPTION_DNS_LENGTH);
+                ByteBuffer dnsByteBuf = ByteBuffer.allocate(DHCP_OPTION_DNS_LENGTH);
                 dnsByteBuf.put(DEFAULT_PRIMARY_DNS.toOctets());
                 dnsByteBuf.put(DEFAULT_SECONDARY_DNS.toOctets());
 
@@ -471,7 +476,7 @@
 
                 option.setLength((byte) dnsLength);
 
-                ByteBuffer dnsByteBuf = ByteBuffer.allocate(8);
+                ByteBuffer dnsByteBuf = ByteBuffer.allocate(DHCP_OPTION_DNS_LENGTH);
 
                 for (String dnsServer : dnsServers) {
                     dnsByteBuf.put(IpAddress.valueOf(dnsServer).toOctets());
@@ -485,12 +490,13 @@
         private DhcpOption doMtu(Subnet osSubnet) {
             DhcpOption option = new DhcpOption();
             option.setCode(DHCP_OPTION_MTU);
-            option.setLength((byte) 2);
+            option.setLength((byte) DHCP_OPTION_MTU_LENGTH);
             Network osNetwork = osNetworkService.network(osSubnet.getNetworkId());
             checkNotNull(osNetwork);
             checkNotNull(osNetwork.getMTU());
 
-            option.setData(ByteBuffer.allocate(2).putShort(osNetwork.getMTU().shortValue()).array());
+            option.setData(ByteBuffer.allocate(DHCP_OPTION_MTU_LENGTH)
+                            .putShort(osNetwork.getMTU().shortValue()).array());
 
             return option;
         }
@@ -526,7 +532,7 @@
         private DhcpOption doRouterAddr(Subnet osSubnet) {
             DhcpOption option = new DhcpOption();
             option.setCode(OptionCode_RouterAddress.getValue());
-            option.setLength((byte) 4);
+            option.setLength(DHCP_OPTION_DATA_LENGTH);
             option.setData(Ip4Address.valueOf(osSubnet.getGateway()).toOctets());
             return option;
         }
