diff --git a/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/Dhcp6HandlerImpl.java b/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/Dhcp6HandlerImpl.java
index fd33ab8..8d81727 100644
--- a/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/Dhcp6HandlerImpl.java
+++ b/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/Dhcp6HandlerImpl.java
@@ -698,7 +698,6 @@
         }
 
         // get dhcp6 header.
-
         IPv6 clientIpv6 = (IPv6) clientPacket.getPayload();
         UDP clientUdp = (UDP) clientIpv6.getPayload();
         DHCP6 clientDhcp6 = (DHCP6) clientUdp.getPayload();
@@ -722,12 +721,10 @@
         if ((directConnFlag && this.dhcpConnectMac == null)  ||
                 !directConnFlag && this.indirectDhcpConnectMac == null && this.dhcpConnectMac == null)   {
             log.warn("Packet received from {} connected client.", directConnFlag ? "directly" : "indirectly");
-            log.warn("DHCP6 {} not yet resolved .. Aborting DHCP "
-                             + "packet processing from client on port: {}",
+            log.warn("DHCP6 {} not yet resolved .. Aborting DHCP packet processing from client on port: {}",
                      (this.dhcpGatewayIp == null) ? "server IP " + this.dhcpServerIp
                              : "gateway IP " + this.dhcpGatewayIp,
                      clientInterfaces.iterator().next().connectPoint());
-
             return null;
         }
 
@@ -744,7 +741,6 @@
         Ip6Address peerAddress = null;
         if (directConnFlag) {
             peerAddress = Ip6Address.valueOf(ipv6Packet.getSourceAddress());
-
         } else {
             MacAddress gwOrClientMac = MacAddress.valueOf(clientPacket.getSourceMACAddress());
             VlanId vlanId = VlanId.vlanId(clientPacket.getVlanID());
@@ -756,18 +752,15 @@
                 return null;
             }
             // pick out the first gloabl ip address
-            peerAddress = gwOrClientHost.ipAddresses()
-                    .stream()
-                    .filter(IpAddress::isIp6)
-                    .filter(ip6 -> !ip6.isLinkLocal())
-                    .map(IpAddress::getIp6Address)
-                    .findFirst()
-                    .orElse(null);
+            peerAddress = gwOrClientHost.ipAddresses().stream()
+                    .filter(IpAddress::isIp6).filter(ip6 -> !ip6.isLinkLocal())
+                    .map(IpAddress::getIp6Address).findFirst().orElse(null);
 
             if (peerAddress == null) {
                 log.warn("Can't find client gateway/server for mac {} ip {}", gwOrClientMac,
                         HexString.toHexString(ipv6Packet.getSourceAddress()));
-                log.warn("Can't find IP address of client gateway/ClienHost address {} for peerAddress", gwOrClientHost);
+                log.warn("Can't find IP address of client gateway/ClienHost address {} for peerAddress",
+                        gwOrClientHost);
                 return null;
             }
         }
@@ -784,10 +777,8 @@
         ConnectPoint clientConnectionPoint = context.inPacket().receivedFrom();
         VlanId vlanIdInUse = VlanId.vlanId(clientPacket.getVlanID());
         Interface clientInterface = interfaceService.getInterfacesByPort(clientConnectionPoint)
-                .stream()
-                .filter(iface -> interfaceContainsVlan(iface, vlanIdInUse))
-                .findFirst()
-                .orElse(null);
+                .stream().filter(iface -> interfaceContainsVlan(iface, vlanIdInUse))
+                .findFirst().orElse(null);
 
         removeHostOrRoute(directConnFlag, dhcp6Packet, clientPacket, clientIpv6, clientInterface);
 
@@ -824,7 +815,6 @@
                 dhcp6Relay.setLinkAddress(relayAgentIp.toOctets());
                 log.warn("indirect connection: relayAgentIp NOT availale from config file! Use dynamic. {}",
                          HexString.toHexString(relayAgentIp.toOctets(), ":"));
-
             } else {
                 dhcp6Relay.setLinkAddress(this.indirectRelayAgentIpFromCfg.toOctets());
                 log.debug("indirect connection: relayAgentIp from config file is available! {}",
