Index: applications/editors/josm/plugins/routing/build.xml
===================================================================
--- applications/editors/josm/plugins/routing/build.xml	(revision 36084)
+++ applications/editors/josm/plugins/routing/build.xml	(revision 36085)
@@ -12,5 +12,4 @@
     <property name="plugin.icon" value="images/preferences/routing.png"/>
     <property name="plugin.link" value="https://wiki.openstreetmap.org/index.php/JOSM/Plugins/Routing"/>
-    <property name="plugin.requires" value="log4j"/>
 
     <!--
Index: applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/core/RoutingGraph.java
===================================================================
--- applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/core/RoutingGraph.java	(revision 36084)
+++ applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/core/RoutingGraph.java	(revision 36085)
@@ -5,8 +5,8 @@
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
 import org.jgrapht.Graph;
 import org.jgrapht.alg.BellmanFordShortestPath;
@@ -21,4 +21,6 @@
 import com.innovant.josm.plugin.routing.RoutingLayer;
 import com.innovant.josm.plugin.routing.RoutingModel;
+import org.openstreetmap.josm.gui.layer.Layer;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -61,13 +63,6 @@
     private final DataSet data;
 
-    /**
-     * Logger.
-     */
-    static Logger logger = Logger.getLogger(RoutingGraph.class);
-
-    private static Collection<String> excludedHighwayValues = Arrays.asList(new String[]{
-            "bus_stop", "traffic_signals", "street_lamp", "stop", "construction",
-            "platform", "give_way", "proposed", "milestone", "speed_camera", "abandoned"
-    });
+    private static final Collection<String> excludedHighwayValues = Arrays.asList("bus_stop", "traffic_signals", "street_lamp", "stop",
+            "construction", "platform", "give_way", "proposed", "milestone", "speed_camera", "abandoned");
 
     /**
@@ -84,6 +79,5 @@
     //  private WeightedMultigraph<Node, OsmEdge> graph;
     private Graph<Node, OsmEdge> graph;
-    private RoutingGraphDelegator rgDelegator = null;
-
+    private RoutingGraphDelegator rgDelegator;
 
     /**
@@ -94,4 +88,5 @@
     }
 
+    @SuppressWarnings("squid:S2234")
     private void addEdgeBidirectional(Way way, Node from, Node to) {
         addEdge(way, from, to);
@@ -99,4 +94,5 @@
     }
 
+    @SuppressWarnings("squid:S2234")
     private void addEdgeReverseOneway(Way way, Node from, Node to) {
         addEdge(way, to, from);
@@ -114,4 +110,5 @@
     /**
      * Default Constructor.
+     * @param data The data to use for the graph
      */
     public RoutingGraph(DataSet data) {
@@ -123,5 +120,5 @@
         routingProfile.setOnewayUse(true); // Don't ignore oneways by default
         this.setWaySpeeds(routingProfile.getWaySpeeds());
-        logger.debug("Created RoutingGraph");
+        Logging.trace("Created RoutingGraph");
     }
 
@@ -130,6 +127,5 @@
      */
     public void createGraph() {
-
-        logger.debug("Creating Graph...");
+        Logging.trace("Creating Graph...");
         graph = new DirectedWeightedMultigraph<>(OsmEdge.class);
         rgDelegator = new RoutingGraphDelegator(graph);
@@ -140,5 +136,5 @@
             // skip way if not suitable for routing.
             if (way == null || way.isDeleted() || !this.isvalidWay(way)
-                    || way.getNodes().size() < 1) continue;
+                    || way.getNodesCount() == 0) continue;
 
             // INIT
@@ -146,5 +142,5 @@
             Node to = null;
             List<Node> nodes = way.getNodes();
-            int nodes_count = nodes.size();
+            int nodesCount = nodes.size();
 
             /*
@@ -166,11 +162,11 @@
              */
 
-            String oneway_val = way.get("oneway");   /*   get (oneway=?) tag for this way.   */
-            String junction_val = way.get("junction");   /*   get (junction=?) tag for this way.   */
+            String onewayVal = way.get("oneway");   /*   get (oneway=?) tag for this way.   */
+            String junctionVal = way.get("junction");   /*   get (junction=?) tag for this way.   */
 
             from = nodes.get(0);                   /*   1st node A  */
             graph.addVertex(from);                 /*   add vertex A */
 
-            for (int i = 1; i < nodes_count; i++) { /*   loop from B until E */
+            for (int i = 1; i < nodesCount; i++) { /*   loop from B until E */
 
                 to = nodes.get(i);                   /*   2nd node B   */
@@ -185,17 +181,17 @@
                         addEdgeBidirectional(way, from, to);
 
-                    } else if (oneway_val == null && junction_val == "roundabout") {
+                    } else if (onewayVal == null && "roundabout".equals(junctionVal)) {
                         //Case (roundabout): oneway=implicit yes
                         addEdgeNormalOneway(way, from, to);
 
-                    } else if (oneway_val == null || oneway_val == "false" || oneway_val == "no" || oneway_val == "0") {
+                    } else if (onewayVal == null || Arrays.asList("false", "no", "0").contains(onewayVal)) {
                         //Case (bi-way): oneway=false OR oneway=unset OR oneway=0 OR oneway=no
                         addEdgeBidirectional(way, from, to);
 
-                    } else if (oneway_val == "-1") {
+                    } else if ("-1".equals(onewayVal)) {
                         //Case (oneway reverse): oneway=-1
                         addEdgeReverseOneway(way, from, to);
 
-                    } else if (oneway_val == "1" || oneway_val == "yes" || oneway_val == "true") {
+                    } else if (Arrays.asList("1", "yes", "true").contains(onewayVal)) {
                         //Case (oneway normal): oneway=yes OR 1 OR true
                         addEdgeNormalOneway(way, from, to);
@@ -209,7 +205,7 @@
         } // end of looping thru ways
 
-        logger.debug("End Create Graph");
-        logger.debug("Vertex: "+graph.vertexSet().size());
-        logger.debug("Edges: "+graph.edgeSet().size());
+        Logging.trace("End Create Graph");
+        Logging.trace("Vertex: {0}", graph.vertexSet().size());
+        Logging.trace("Edges: {0}", graph.edgeSet().size());
     }
 
@@ -229,7 +225,5 @@
         double weight = getWeight(way, length);
         setWeight(edge, length);
-        logger.debug("edge for way " + way.getId()
-        + "(from node " + from.getId() + " to node "
-        + to.getId() + ") has weight: " + weight);
+        Logging.trace("edge for way {0} (from node {1} to node {2}) has weight: {3}", way.getId(), from.getId(), to.getId(), weight);
         ((DirectedWeightedMultigraph<Node, OsmEdge>) graph).setEdgeWeight(edge, weight);
     }
@@ -240,5 +234,5 @@
      * in routing.
      *
-     * @param way
+     * @param osmedge
      *            the way.
      */
@@ -273,5 +267,5 @@
             if (this.waySpeeds.containsKey(way.get("highway")))
                 speed = this.waySpeeds.get(way.get("highway"));
-            logger.debug("Speed="+speed);
+            Logging.trace("Speed={0}", speed);
             break;
         default:
@@ -315,15 +309,20 @@
         Graph<Node, OsmEdge> g;
         double totalWeight = 0;
-        RoutingLayer layer = (RoutingLayer) MainApplication.getLayerManager().getActiveLayer();
+        final Layer editLayer = MainApplication.getLayerManager().getEditLayer();
+        final RoutingLayer layer = MainApplication.getLayerManager().getLayersOfType(RoutingLayer.class)
+                .stream().filter(rLayer -> rLayer.getDataLayer() == editLayer).findFirst().orElse(null);
+        if (layer == null) {
+            return Collections.emptyList();
+        }
         RoutingModel routingModel = layer.getRoutingModel();
 
         if (graph == null || routingModel.getOnewayChanged())
             this.createGraph();
-        logger.debug("apply algorithm between nodes ");
+        Logging.trace("apply algorithm between nodes ");
 
         for (Node node : nodes) {
-            logger.debug(node.getId());
+            Logging.trace(Long.toString(node.getId()));
         }
-        logger.debug("-----------------------------------");
+        Logging.trace("-----------------------------------");
 
         // Assign the graph to g
@@ -332,5 +331,5 @@
         switch (algorithm) {
         case ROUTING_ALG_DIJKSTRA:
-            logger.debug("Using Dijkstra algorithm");
+            Logging.trace("Using Dijkstra algorithm");
             DijkstraShortestPath<Node, OsmEdge> routingk = null;
             for (int index = 1; index < nodes.size(); ++index) {
@@ -338,5 +337,5 @@
                         .get(index - 1), nodes.get(index));
                 if (routingk.getPathEdgeList() == null) {
-                    logger.debug("no path found!");
+                    Logging.trace("no path found!");
                     break;
                 }
@@ -346,21 +345,20 @@
             break;
         case ROUTING_ALG_BELLMANFORD:
-            logger.debug("Using Bellman Ford algorithm");
+            Logging.trace("Using Bellman Ford algorithm");
             for (int index = 1; index < nodes.size(); ++index) {
                 path = BellmanFordShortestPath.findPathBetween(rgDelegator, nodes
                         .get(index - 1), nodes.get(index));
-                if (path == null) {
-                    logger.debug("no path found!");
-                    return null;
+                if (path == null || path.isEmpty()) {
+                    Logging.trace("no path found!");
+                    return Collections.emptyList();
                 }
             }
             break;
         default:
-            logger.debug("Wrong algorithm");
+            Logging.trace("Wrong algorithm");
             break;
         }
 
-        logger.debug("shortest path found: " + path + "\nweight: "
-                + totalWeight);
+        Logging.trace("shortest path found: {0}\nweight: {1}", path, totalWeight);
         return path;
     }
@@ -389,7 +387,7 @@
      * @param routeType the routeType to set
      */
-    public void setTypeRoute(RouteType routetype) {
-        this.routeType = routetype;
-        this.rgDelegator.setRouteType(routetype);
+    public void setTypeRoute(RouteType routeType) {
+        this.routeType = routeType;
+        this.rgDelegator.setRouteType(routeType);
     }
 
Index: applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/core/RoutingGraphDelegator.java
===================================================================
--- applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/core/RoutingGraphDelegator.java	(revision 36084)
+++ applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/core/RoutingGraphDelegator.java	(revision 36085)
@@ -2,5 +2,4 @@
 package com.innovant.josm.jrt.core;
 
-import org.apache.log4j.Logger;
 import org.jgrapht.Graph;
 import org.jgrapht.graph.GraphDelegator;
@@ -15,10 +14,4 @@
  */
 public class RoutingGraphDelegator extends GraphDelegator<Node, OsmEdge> {
-
-    /**
-     * Logger.
-     */
-    static Logger logger = Logger.getLogger(RoutingGraphDelegator.class);
-
     /**
      *
Index: applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/core/RoutingProfile.java
===================================================================
--- applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/core/RoutingProfile.java	(revision 36084)
+++ applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/core/RoutingProfile.java	(revision 36085)
@@ -5,7 +5,6 @@
 import java.util.Map;
 
-import org.apache.log4j.Logger;
 import org.openstreetmap.josm.data.Preferences;
-
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -30,8 +29,4 @@
  */
 public class RoutingProfile {
-    /**
-     * logger
-     */
-    static Logger logger = Logger.getLogger(RoutingProfile.class);
     /**
      * True if oneway is used for routing (i.e. for cars).
@@ -74,15 +69,15 @@
      */
     public RoutingProfile(String name) {
-        logger.debug("Init RoutingProfile with name: "+name);
+        Logging.trace("Init RoutingProfile with name: {0}", name);
         this.name = name;
         waySpeeds = new HashMap<>();
         Map<String, String> prefs = Preferences.main().getAllPrefix("routing.profile."+name+".speed");
-        for (String key:prefs.keySet()) {
-            waySpeeds.put((key.split("\\.")[4]), Double.valueOf(prefs.get(key)));
+        for (Map.Entry<String, String> entry : prefs.entrySet()) {
+            waySpeeds.put((entry.getKey().split("\\.")[4]), Double.valueOf(entry.getValue()));
         }
-        for (String key:waySpeeds.keySet()) {
-            logger.debug(key+ "-- speed: "+waySpeeds.get(key));
+        for (Map.Entry<String, Double> entry : waySpeeds.entrySet()) {
+            Logging.trace("{0}-- speed: {1}", entry.getKey(), entry.getValue());
         }
-        logger.debug("End init RoutingProfile with name: "+name);
+        Logging.trace("End init RoutingProfile with name: {0}", name);
     }
 
Index: applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/osm/OsmWayTypes.java
===================================================================
--- applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/osm/OsmWayTypes.java	(revision 36084)
+++ applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/osm/OsmWayTypes.java	(revision 36085)
Index: applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/RoutingLayer.java
===================================================================
--- applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/RoutingLayer.java	(revision 36084)
+++ applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/RoutingLayer.java	(revision 36085)
@@ -20,5 +20,4 @@
 import javax.swing.Icon;
 
-import org.apache.log4j.Logger;
 import org.openstreetmap.josm.actions.RenameLayerAction;
 import org.openstreetmap.josm.data.Bounds;
@@ -39,5 +38,5 @@
 
 import com.innovant.josm.jrt.osm.OsmEdge;
-
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -54,5 +53,5 @@
         KEY_ROUTE_SELECT("routing.route.select");
 
-        public final String key;
+        private final String key;
         PreferencesKeys(String key) {
             this.key = key;
@@ -65,9 +64,4 @@
 
     /**
-     * Logger
-     */
-    static Logger logger = Logger.getLogger(RoutingLayer.class);
-
-    /**
      * Constant
      */
@@ -77,30 +71,32 @@
      * Routing Model
      */
-    private RoutingModel routingModel;
+    private final RoutingModel routingModel;
 
     /**
      * Start, Middle and End icons
      */
-    private Icon startIcon, middleIcon, endIcon;
+    private final Icon startIcon;
+    private final Icon middleIcon;
+    private final Icon endIcon;
 
     /**
      * Associated OSM layer
      */
-    private OsmDataLayer dataLayer;
+    private final OsmDataLayer dataLayer;
 
     /**
      * Default constructor
      * @param name Layer name.
+     * @param dataLayer The datalayer to use for routing
      */
     public RoutingLayer(String name, OsmDataLayer dataLayer) {
         super(name);
-        logger.debug("Creating Routing Layer...");
-        if (startIcon == null) startIcon = ImageProvider.get("routing", "startflag");
-        if (middleIcon == null) middleIcon = ImageProvider.get("routing", "middleflag");
-        if (endIcon == null) endIcon = ImageProvider.get("routing", "endflag");
+        Logging.trace("Creating Routing Layer...");
+        this.startIcon = ImageProvider.get("routing", "startflag");
+        this.middleIcon = ImageProvider.get("routing", "middleflag");
+        this.endIcon = ImageProvider.get("routing", "endflag");
         this.dataLayer = dataLayer;
         this.routingModel = new RoutingModel(dataLayer.data);
-        logger.debug("Routing Layer created.");
-
+        Logging.trace("Routing Layer created.");
 
         this.routingModel.routingGraph.createGraph();    /* construct the graph right after we we create the layer */
@@ -138,11 +134,9 @@
                 if (n.isDeleted() || n.isIncomplete()) continue;
 
-                Point P = MainApplication.getMap().mapView.getPoint(n);
-                double dist = p.distance(P);
-                if (dist < snapDistance) {
-                    if ((nearest == null) || (dist < minDist)) {
-                        nearest = n;
-                        minDist = dist;
-                    }
+                Point point = MainApplication.getMap().mapView.getPoint(n);
+                double dist = p.distance(point);
+                if (dist < snapDistance && ((nearest == null) || (dist < minDist))) {
+                    nearest = n;
+                    minDist = dist;
                 }
             }
@@ -153,11 +147,10 @@
     @Override
     public Icon getIcon() {
-        Icon icon = ImageProvider.get("layer", "routing_small");
-        return icon;
+        return ImageProvider.get("layer", "routing_small");
     }
 
     @Override
     public Object getInfoComponent() {
-        String info = "<html>"
+        return "<html>"
                 + "<body>"
                 +"Graph Vertex: "+this.routingModel.routingGraph.getVertexCount()+"<br/>"
@@ -165,5 +158,4 @@
                 + "</body>"
                 + "</html>";
-        return info;
     }
 
@@ -183,7 +175,6 @@
     @Override
     public String getToolTipText() {
-        String tooltip = this.routingModel.routingGraph.getVertexCount() + " vertices, "
+        return this.routingModel.routingGraph.getVertexCount() + " vertices, "
                 + this.routingModel.routingGraph.getEdgeCount() + " edges";
-        return tooltip;
     }
 
@@ -208,11 +199,11 @@
         Color color;
         if (isActiveLayer) {
-            color = new NamedColorProperty(PreferencesKeys.KEY_ACTIVE_ROUTE_COLOR.key, Color.RED).get();
+            color = new NamedColorProperty(PreferencesKeys.KEY_ACTIVE_ROUTE_COLOR.getKey(), Color.RED).get();
         } else {
-            color = new NamedColorProperty(PreferencesKeys.KEY_INACTIVE_ROUTE_COLOR.key, Color.decode("#dd2222")).get();
+            color = new NamedColorProperty(PreferencesKeys.KEY_INACTIVE_ROUTE_COLOR.getKey(), Color.decode("#dd2222")).get();
         }
 
         // Get path stroke width from preferences
-        String widthString = Config.getPref().get(PreferencesKeys.KEY_ROUTE_WIDTH.key);
+        String widthString = Config.getPref().get(PreferencesKeys.KEY_ROUTE_WIDTH.getKey());
         if (widthString.length() == 0) {
             widthString = "2";                        /* I think 2 is better  */
@@ -223,17 +214,13 @@
 
         // draw our graph
-        if (isActiveLayer) {
-            if (routingModel != null) {
-                if (routingModel.routingGraph != null && routingModel.routingGraph.getGraph() != null) {
-                    Set<OsmEdge> graphEdges = routingModel.routingGraph.getGraph().edgeSet();
-                    if (!graphEdges.isEmpty()) {
-                        Color color2 = ColorHelper.html2color("#00ff00");        /* just green for now  */
-                        OsmEdge firstedge = (OsmEdge) graphEdges.toArray()[0];
-                        Point from = mv.getPoint(firstedge.fromEastNorth());
-                        g.drawRect(from.x-4, from.y+4, from.x+4, from.y-4);
-                        for (OsmEdge edge : graphEdges) {
-                            drawGraph(g, mv, edge, color2, width);
-                        }
-                    }
+        if (isActiveLayer && routingModel.routingGraph != null && routingModel.routingGraph.getGraph() != null) {
+            Set<OsmEdge> graphEdges = routingModel.routingGraph.getGraph().edgeSet();
+            if (!graphEdges.isEmpty()) {
+                Color color2 = ColorHelper.html2color("#00ff00");        /* just green for now  */
+                OsmEdge firstedge = (OsmEdge) graphEdges.toArray()[0];
+                Point from = mv.getPoint(firstedge.fromEastNorth());
+                g.drawRect(from.x - 4, from.y + 4, from.x + 4, from.y - 4);
+                for (OsmEdge edge : graphEdges) {
+                    drawGraph(g, mv, edge, color2, width);
                 }
             }
@@ -241,5 +228,5 @@
 
 
-        if (nodes == null || nodes.size() == 0) return;
+        if (nodes == null || nodes.isEmpty()) return;
 
         // Paint routing path
@@ -289,5 +276,5 @@
      * Draw a line with the given color.
      */
-    private void drawEdge(Graphics g, MapView mv, OsmEdge edge, Color col, int width,
+    private static void drawEdge(Graphics g, MapView mv, OsmEdge edge, Color col, int width,
             boolean showDirection) {
         g.setColor(col);
@@ -310,5 +297,5 @@
     }
 
-    private void drawGraph(Graphics g, MapView mv, OsmEdge edge, Color col, int width) {
+    private static void drawGraph(Graphics g, MapView mv, OsmEdge edge, Color col, int width) {
         g.setColor(col);
         Point from;
Index: applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/RoutingModel.java
===================================================================
--- applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/RoutingModel.java	(revision 36084)
+++ applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/RoutingModel.java	(revision 36085)
@@ -5,5 +5,4 @@
 import java.util.List;
 
-import org.apache.log4j.Logger;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
@@ -12,5 +11,5 @@
 import com.innovant.josm.jrt.core.RoutingGraph.Algorithm;
 import com.innovant.josm.jrt.osm.OsmEdge;
-
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -21,38 +20,33 @@
  */
 public class RoutingModel {
-
-    /**
-     * Logger
-     */
-    static Logger logger = Logger.getLogger(RoutingModel.class);
-
     /**
      * Graph to calculate route
      */
-    public RoutingGraph routingGraph = null;
+    public final RoutingGraph routingGraph;
 
     /**
      * List of nodes that the route has to traverse
      */
-    private List<Node> nodes = null;
+    private List<Node> nodes;
 
-    private List<OsmEdge> path = null;
+    private List<OsmEdge> path;
 
     /**
      * Flag to advise about changes in the selected nodes.
      */
-    private boolean changeNodes = false;
+    private boolean changeNodes;
 
     /**
      * Flag to advise about changes in ways.
      */
-    private boolean changeOneway = false;
+    private boolean changeOneway;
 
     /**
      * Default Constructor.
+     * @param data The data to use for the routing graph
      */
     public RoutingModel(DataSet data) {
         nodes = new ArrayList<>();
-        System.out.println("gr " + data);
+        Logging.trace("gr " + data);
         routingGraph = new RoutingGraph(data);
     }
Index: applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/RoutingPlugin.java
===================================================================
--- applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/RoutingPlugin.java	(revision 36084)
+++ applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/RoutingPlugin.java	(revision 36085)
@@ -4,9 +4,12 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-import java.io.File;
 import java.util.ArrayList;
 
-import org.apache.log4j.Logger;
-import org.apache.log4j.xml.DOMConfigurator;
+import com.innovant.josm.plugin.routing.actions.AddRouteNodeAction;
+import com.innovant.josm.plugin.routing.actions.MoveRouteNodeAction;
+import com.innovant.josm.plugin.routing.actions.RemoveRouteNodeAction;
+import com.innovant.josm.plugin.routing.gui.RoutingDialog;
+import com.innovant.josm.plugin.routing.gui.RoutingMenu;
+import com.innovant.josm.plugin.routing.gui.RoutingPreferenceDialog;
 import org.openstreetmap.josm.data.osm.event.AbstractDatasetChangedEvent;
 import org.openstreetmap.josm.data.osm.event.DataSetListenerAdapter;
@@ -27,11 +30,4 @@
 import org.openstreetmap.josm.tools.Logging;
 
-import com.innovant.josm.plugin.routing.actions.AddRouteNodeAction;
-import com.innovant.josm.plugin.routing.actions.MoveRouteNodeAction;
-import com.innovant.josm.plugin.routing.actions.RemoveRouteNodeAction;
-import com.innovant.josm.plugin.routing.gui.RoutingDialog;
-import com.innovant.josm.plugin.routing.gui.RoutingMenu;
-import com.innovant.josm.plugin.routing.gui.RoutingPreferenceDialog;
-
 /**
  * The main class of the routing plugin
@@ -43,8 +39,4 @@
  */
 public class RoutingPlugin extends Plugin implements LayerChangeListener, DataSetListenerAdapter.Listener {
-    /**
-     * Logger
-     */
-    static Logger logger = Logger.getLogger(RoutingPlugin.class);
 
     /**
@@ -116,11 +108,5 @@
         datasetAdapter = new DataSetListenerAdapter(this);
         plugin = this; // Assign reference to the plugin class
-        File log4jConfigFile = new java.io.File("log4j.xml");
-        if (log4jConfigFile.exists()) {
-            DOMConfigurator.configure(log4jConfigFile.getPath());
-        } else {
-            System.err.println("Routing plugin warning: log4j configuration not found");
-        }
-        logger.debug("Loading routing plugin...");
+        Logging.trace("Loading routing plugin...");
         preferenceSettings = new RoutingPreferenceDialog();
         // Initialize layers list
@@ -131,5 +117,5 @@
         MainApplication.getLayerManager().addLayerChangeListener(this);
         DatasetEventManager.getInstance().addDatasetListener(datasetAdapter, FireMode.IN_EDT_CONSOLIDATED);
-        logger.debug("Finished loading plugin");
+        Logging.trace("Finished loading plugin");
     }
 
@@ -178,5 +164,6 @@
             // Enable menu
             menu.enableStartItem();
-            newFrame.addToggleDialog(routingDialog = new RoutingDialog());
+            routingDialog = new RoutingDialog();
+            newFrame.addToggleDialog(routingDialog);
         } else {
             addRouteNodeAction = null;
@@ -218,5 +205,5 @@
             // Set layer on top and select layer, also refresh toggleDialog to reflect selection
             MainApplication.getMap().mapView.moveLayer(newLayer, 0);
-            logger.debug("Added routing layer.");
+            Logging.trace("Added routing layer.");
         }
     }
@@ -232,5 +219,5 @@
             menu.disableRestOfItems();
             layers.remove(oldLayer);
-            logger.debug("Removed routing layer.");
+            Logging.trace("Removed routing layer.");
         } else if (oldLayer instanceof OsmDataLayer) {
             // Remove all associated routing layers
@@ -238,9 +225,9 @@
             // FIXME: can't remove associated routing layers without triggering exceptions in some cases
             RoutingLayer[] layersArray = layers.toArray(new RoutingLayer[0]);
-            for (int i = 0; i < layersArray.length; i++) {
-                if (layersArray[i].getDataLayer().equals(oldLayer)) {
+            for (RoutingLayer routingLayer : layersArray) {
+                if (routingLayer.getDataLayer().equals(oldLayer)) {
                     try {
                         // Remove layer
-                        MainApplication.getLayerManager().removeLayer(layersArray[i]);
+                        MainApplication.getLayerManager().removeLayer(routingLayer);
                     } catch (IllegalArgumentException e) {
                         Logging.error(e);
Index: applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/AddRouteNodeAction.java
===================================================================
--- applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/AddRouteNodeAction.java	(revision 36084)
+++ applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/AddRouteNodeAction.java	(revision 36085)
@@ -6,5 +6,4 @@
 import java.awt.event.MouseEvent;
 
-import org.apache.log4j.Logger;
 import org.openstreetmap.josm.actions.mapmode.MapMode;
 import org.openstreetmap.josm.data.osm.Node;
@@ -15,4 +14,5 @@
 import com.innovant.josm.plugin.routing.RoutingLayer;
 import com.innovant.josm.plugin.routing.RoutingPlugin;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -24,13 +24,6 @@
  */
 public class AddRouteNodeAction extends MapMode {
-
-    /**
-     * Logger.
-     */
-    static Logger logger = Logger.getLogger(AddRouteNodeAction.class);
-
     /**
      * Constructor
-     * @param mapFrame map frame
      */
     public AddRouteNodeAction() {
@@ -60,8 +53,8 @@
                 node = layer.getNearestHighwayNode(e.getPoint());
                 if (node == null) {
-                    logger.debug("no selected node");
+                    Logging.trace("no selected node");
                     return;
                 }
-                logger.debug("selected node " + node);
+                Logging.trace("selected node {0}", node);
                 layer.getRoutingModel().addNode(node);
                 RoutingPlugin.getInstance().getRoutingDialog().addNode(node);
Index: applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/MoveRouteNodeAction.java
===================================================================
--- applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/MoveRouteNodeAction.java	(revision 36084)
+++ applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/MoveRouteNodeAction.java	(revision 36085)
@@ -8,5 +8,4 @@
 import java.util.List;
 
-import org.apache.log4j.Logger;
 import org.openstreetmap.josm.actions.mapmode.MapMode;
 import org.openstreetmap.josm.data.osm.Node;
@@ -19,4 +18,5 @@
 import com.innovant.josm.plugin.routing.RoutingPlugin;
 import com.innovant.josm.plugin.routing.gui.RoutingDialog;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -35,9 +35,4 @@
 
     /**
-     * Logger.
-     */
-    static Logger logger = Logger.getLogger(RoutingLayer.class);
-
-    /**
      * Index of dragged node
      */
@@ -46,5 +41,4 @@
     /**
      * Constructor
-     * @param mapFrame map frame
      */
     public MoveRouteNodeAction() {
@@ -67,24 +61,22 @@
     @Override public void mousePressed(MouseEvent e) {
         // If left button is pressed
-        if (e.getButton() == MouseEvent.BUTTON1) {
-            if (MainApplication.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
-                requestFocusInMapView();
-                RoutingLayer layer = (RoutingLayer) MainApplication.getLayerManager().getActiveLayer();
-                RoutingModel routingModel = layer.getRoutingModel();
-                // Search for the nearest node in the list
-                List<Node> nl = routingModel.getSelectedNodes();
-                index = -1;
-                double dmax = DRAG_SQR_RADIUS; // maximum distance, in pixels
-                for (int i = 0; i < nl.size(); i++) {
-                    Node node = nl.get(i);
-                    double d = MainApplication.getMap().mapView.getPoint(node).distanceSq(e.getPoint());
-                    if (d < dmax) {
-                        dmax = d;
-                        index = i;
-                    }
+        if (e.getButton() == MouseEvent.BUTTON1 && MainApplication.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
+            requestFocusInMapView();
+            RoutingLayer layer = (RoutingLayer) MainApplication.getLayerManager().getActiveLayer();
+            RoutingModel routingModel = layer.getRoutingModel();
+            // Search for the nearest node in the list
+            List<Node> nl = routingModel.getSelectedNodes();
+            index = -1;
+            double dmax = DRAG_SQR_RADIUS; // maximum distance, in pixels
+            for (int i = 0; i < nl.size(); i++) {
+                Node node = nl.get(i);
+                double d = MainApplication.getMap().mapView.getPoint(node).distanceSq(e.getPoint());
+                if (d < dmax) {
+                    dmax = d;
+                    index = i;
                 }
-                if (index >= 0)
-                    logger.debug("Moved from node " + nl.get(index));
             }
+            if (index >= 0)
+                Logging.trace("Moved from node {0}", nl.get(index));
         }
     }
@@ -109,8 +101,8 @@
             node = layer.getNearestHighwayNode(point);
             if (node == null) {
-                logger.debug("Didn't found a close node to move to.");
+                Logging.trace("Didn't found a close node to move to.");
                 return;
             }
-            logger.debug("Moved to node " + node);
+            Logging.trace("Moved to node {0}", node);
             routingModel.removeNode(index);
             routingDialog.removeNode(index);
Index: applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/RemoveRouteNodeAction.java
===================================================================
--- applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/RemoveRouteNodeAction.java	(revision 36084)
+++ applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/RemoveRouteNodeAction.java	(revision 36085)
@@ -7,5 +7,4 @@
 import java.util.List;
 
-import org.apache.log4j.Logger;
 import org.openstreetmap.josm.actions.mapmode.MapMode;
 import org.openstreetmap.josm.data.osm.Node;
@@ -17,4 +16,5 @@
 import com.innovant.josm.plugin.routing.RoutingModel;
 import com.innovant.josm.plugin.routing.RoutingPlugin;
+import org.openstreetmap.josm.tools.Logging;
 
 /**
@@ -31,9 +31,4 @@
      */
     private static final int REMOVE_SQR_RADIUS = 100;
-
-    /**
-     * Logger.
-     */
-    static Logger logger = Logger.getLogger(RoutingLayer.class);
 
     public RemoveRouteNodeAction() {
@@ -56,30 +51,28 @@
     @Override public void mouseClicked(MouseEvent e) {
         // If left button is clicked
-        if (e.getButton() == MouseEvent.BUTTON1) {
-            if (MainApplication.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
-                RoutingLayer layer = (RoutingLayer) MainApplication.getLayerManager().getActiveLayer();
-                RoutingModel routingModel = layer.getRoutingModel();
-                // Search for the nearest node in the list
-                List<Node> nl = routingModel.getSelectedNodes();
-                int index = -1;
-                double dmax = REMOVE_SQR_RADIUS; // maximum distance, in pixels
-                for (int i = 0; i < nl.size(); i++) {
-                    Node node = nl.get(i);
-                    double d = MainApplication.getMap().mapView.getPoint(node).distanceSq(e.getPoint());
-                    if (d < dmax) {
-                        dmax = d;
-                        index = i;
-                    }
+        if (e.getButton() == MouseEvent.BUTTON1 && MainApplication.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
+            RoutingLayer layer = (RoutingLayer) MainApplication.getLayerManager().getActiveLayer();
+            RoutingModel routingModel = layer.getRoutingModel();
+            // Search for the nearest node in the list
+            List<Node> nl = routingModel.getSelectedNodes();
+            int index = -1;
+            double dmax = REMOVE_SQR_RADIUS; // maximum distance, in pixels
+            for (int i = 0; i < nl.size(); i++) {
+                Node node = nl.get(i);
+                double d = MainApplication.getMap().mapView.getPoint(node).distanceSq(e.getPoint());
+                if (d < dmax) {
+                    dmax = d;
+                    index = i;
                 }
-                // If found a close node, remove it and recalculate route
-                if (index >= 0) {
-                    // Remove node
-                    logger.debug("Removing node " + nl.get(index));
-                    routingModel.removeNode(index);
-                    RoutingPlugin.getInstance().getRoutingDialog().removeNode(index);
-                    MainApplication.getMap().repaint();
-                } else {
-                    logger.debug("Can't find a node to remove.");
-                }
+            }
+            // If found a close node, remove it and recalculate route
+            if (index >= 0) {
+                // Remove node
+                Logging.trace("Removing node {0}", nl.get(index));
+                routingModel.removeNode(index);
+                RoutingPlugin.getInstance().getRoutingDialog().removeNode(index);
+                MainApplication.getMap().repaint();
+            } else {
+                Logging.trace("Can't find a node to remove.");
             }
         }
Index: applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingDialog.java
===================================================================
--- applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingDialog.java	(revision 36084)
+++ applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingDialog.java	(revision 36085)
@@ -18,5 +18,4 @@
 import com.innovant.josm.plugin.routing.RoutingLayer;
 import com.innovant.josm.plugin.routing.RoutingModel;
-
 
 /**
Index: applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingMenu.java
===================================================================
--- applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingMenu.java	(revision 36084)
+++ applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingMenu.java	(revision 36085)
@@ -5,8 +5,5 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
 import java.awt.event.KeyEvent;
 
@@ -17,11 +14,10 @@
 import javax.swing.JRadioButtonMenuItem;
 
-import org.openstreetmap.josm.gui.MainApplication;
-import org.openstreetmap.josm.gui.MainMenu;
-
 import com.innovant.josm.jrt.core.RoutingGraph.RouteType;
 import com.innovant.josm.plugin.routing.RoutingLayer;
 import com.innovant.josm.plugin.routing.RoutingModel;
 import com.innovant.josm.plugin.routing.RoutingPlugin;
+import org.openstreetmap.josm.gui.MainApplication;
+import org.openstreetmap.josm.gui.MainMenu;
 
 /**
@@ -51,10 +47,5 @@
 
         startMI = new JMenuItem(tr("Add routing layer"));
-        startMI.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                RoutingPlugin.getInstance().addLayer();
-            }
-        });
+        startMI.addActionListener(e -> RoutingPlugin.getInstance().addLayer());
         menu.add(startMI);
 
@@ -66,24 +57,20 @@
         JRadioButtonMenuItem rshorter = new JRadioButtonMenuItem(tr("Shortest"));
         rshorter.setSelected(true);
-        rshorter.addItemListener(new ItemListener() {
-            @Override
-            public void itemStateChanged(ItemEvent e) {
-                if (MainApplication.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
-                    RoutingLayer layer = (RoutingLayer) MainApplication.getLayerManager().getActiveLayer();
-                    RoutingModel routingModel = layer.getRoutingModel();
-                    if (e.getStateChange() == ItemEvent.SELECTED) {
-                        routingModel.routingGraph.setTypeRoute(RouteType.SHORTEST);
-                    } else {
-                        routingModel.routingGraph.setTypeRoute(RouteType.FASTEST);
-                    }
-                    //  routingModel.routingGraph.resetGraph();
-                    //  routingModel.routingGraph.createGraph();
-                    //TODO: Change this way
-                    //FIXME: do not change node but recalculate routing.
-                    routingModel.setNodesChanged();
-                    MainApplication.getMap().repaint();
+        rshorter.addItemListener(e -> {
+            if (MainApplication.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
+                RoutingLayer layer = (RoutingLayer) MainApplication.getLayerManager().getActiveLayer();
+                RoutingModel routingModel = layer.getRoutingModel();
+                if (e.getStateChange() == ItemEvent.SELECTED) {
+                    routingModel.routingGraph.setTypeRoute(RouteType.SHORTEST);
+                } else {
+                    routingModel.routingGraph.setTypeRoute(RouteType.FASTEST);
                 }
+                //  routingModel.routingGraph.resetGraph();
+                //  routingModel.routingGraph.createGraph();
+                //TODO: Change this way
+                //FIXME: do not change node but recalculate routing.
+                routingModel.setNodesChanged();
+                MainApplication.getMap().repaint();
             }
-
         });
 
@@ -96,18 +83,12 @@
         criteriaM.addSeparator();
         JCheckBoxMenuItem cbmi = new JCheckBoxMenuItem(tr("Ignore oneways"));
-        cbmi.addItemListener(new ItemListener() {
-            @Override
-            public void itemStateChanged(ItemEvent e) {
-                if (MainApplication.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
-                    RoutingLayer layer = (RoutingLayer) MainApplication.getLayerManager().getActiveLayer();
-                    RoutingModel routingModel = layer.getRoutingModel();
-                    if (e.getStateChange() == ItemEvent.SELECTED)
-                        routingModel.routingGraph.getRoutingProfile().setOnewayUse(false);
-                    else
-                        routingModel.routingGraph.getRoutingProfile().setOnewayUse(true);
-                    routingModel.setNodesChanged();
-                    routingModel.setOnewayChanged();
-                    MainApplication.getMap().repaint();
-                }
+        cbmi.addItemListener(e -> {
+            if (MainApplication.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
+                RoutingLayer layer = (RoutingLayer) MainApplication.getLayerManager().getActiveLayer();
+                RoutingModel routingModel = layer.getRoutingModel();
+                routingModel.routingGraph.getRoutingProfile().setOnewayUse(e.getStateChange() != ItemEvent.SELECTED);
+                routingModel.setNodesChanged();
+                routingModel.setOnewayChanged();
+                MainApplication.getMap().repaint();
             }
         });
@@ -117,13 +98,10 @@
         menu.addSeparator();
         reverseMI = new JMenuItem(tr("Reverse route"));
-        reverseMI.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                if (MainApplication.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
-                    RoutingLayer layer = (RoutingLayer) MainApplication.getLayerManager().getActiveLayer();
-                    RoutingModel routingModel = layer.getRoutingModel();
-                    routingModel.reverseNodes();
-                    MainApplication.getMap().repaint();
-                }
+        reverseMI.addActionListener(e -> {
+            if (MainApplication.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
+                RoutingLayer layer = (RoutingLayer) MainApplication.getLayerManager().getActiveLayer();
+                RoutingModel routingModel = layer.getRoutingModel();
+                routingModel.reverseNodes();
+                MainApplication.getMap().repaint();
             }
         });
@@ -131,15 +109,12 @@
 
         clearMI = new JMenuItem(tr("Clear route"));
-        clearMI.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                if (MainApplication.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
-                    RoutingLayer layer = (RoutingLayer) MainApplication.getLayerManager().getActiveLayer();
-                    RoutingModel routingModel = layer.getRoutingModel();
-                    // Reset routing nodes and paths
-                    routingModel.reset();
-                    RoutingPlugin.getInstance().getRoutingDialog().clearNodes();
-                    MainApplication.getMap().repaint();
-                }
+        clearMI.addActionListener(e -> {
+            if (MainApplication.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
+                RoutingLayer layer = (RoutingLayer) MainApplication.getLayerManager().getActiveLayer();
+                RoutingModel routingModel = layer.getRoutingModel();
+                // Reset routing nodes and paths
+                routingModel.reset();
+                RoutingPlugin.getInstance().getRoutingDialog().clearNodes();
+                MainApplication.getMap().repaint();
             }
         });
@@ -147,13 +122,10 @@
 
         regraphMI = new JMenuItem(tr("Reconstruct Graph"));
-        regraphMI.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                if (MainApplication.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
-                    RoutingLayer layer = (RoutingLayer) MainApplication.getLayerManager().getActiveLayer();
-                    RoutingModel routingModel = layer.getRoutingModel();
-                    routingModel.routingGraph.resetGraph();
-                    routingModel.routingGraph.createGraph();
-                }
+        regraphMI.addActionListener(e -> {
+            if (MainApplication.getLayerManager().getActiveLayer() instanceof RoutingLayer) {
+                RoutingLayer layer = (RoutingLayer) MainApplication.getLayerManager().getActiveLayer();
+                RoutingModel routingModel = layer.getRoutingModel();
+                routingModel.routingGraph.resetGraph();
+                routingModel.routingGraph.createGraph();
             }
         });
Index: applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingPreferenceDialog.java
===================================================================
--- applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingPreferenceDialog.java	(revision 36084)
+++ applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingPreferenceDialog.java	(revision 36085)
@@ -7,6 +7,4 @@
 import java.awt.Dimension;
 import java.awt.GridBagLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
@@ -26,5 +24,5 @@
 import javax.swing.table.DefaultTableModel;
 
-import org.apache.log4j.Logger;
+import com.innovant.josm.jrt.osm.OsmWayTypes;
 import org.openstreetmap.josm.data.Preferences;
 import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting;
@@ -32,13 +30,8 @@
 import org.openstreetmap.josm.spi.preferences.Config;
 import org.openstreetmap.josm.tools.GBC;
-
-import com.innovant.josm.jrt.osm.OsmWayTypes;
+import org.openstreetmap.josm.tools.Logging;
 
 public class RoutingPreferenceDialog extends DefaultTabPreferenceSetting {
 
-    /**
-     * Logger
-     */
-    static Logger logger = Logger.getLogger(RoutingPreferenceDialog.class);
 
     private Map<String, String> orig;
@@ -81,26 +74,23 @@
         p.add(Box.createHorizontalGlue(), GBC.std().fill(GBC.HORIZONTAL));
         p.add(add, GBC.std().insets(0, 5, 0, 0));
-        add.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                JPanel p = new JPanel(new GridBagLayout());
-                p.add(new JLabel(tr("Weight")), GBC.std().insets(0, 0, 5, 0));
-                JComboBox<String> key = new JComboBox<>();
-                for (OsmWayTypes pk : OsmWayTypes.values()) {
-                    key.addItem(pk.getTag());
-                }
-                JTextField value = new JTextField(10);
-                p.add(key, GBC.eop().insets(5, 0, 0, 0).fill(GBC.HORIZONTAL));
-                p.add(new JLabel(tr("Value")), GBC.std().insets(0, 0, 5, 0));
-                p.add(value, GBC.eol().insets(5, 0, 0, 0).fill(GBC.HORIZONTAL));
-                int answer = JOptionPane.showConfirmDialog(gui, p,
-                        tr("Enter weight values"),
-                        JOptionPane.OK_CANCEL_OPTION);
-                if (answer == JOptionPane.OK_OPTION) {
-                    model
-                    .addRow(new String[] {
-                            key.getSelectedItem().toString(),
-                            value.getText() });
-                }
+        add.addActionListener(e -> {
+            JPanel p1 = new JPanel(new GridBagLayout());
+            p1.add(new JLabel(tr("Weight")), GBC.std().insets(0, 0, 5, 0));
+            JComboBox<String> key = new JComboBox<>();
+            for (OsmWayTypes pk : OsmWayTypes.values()) {
+                key.addItem(pk.getTag());
+            }
+            JTextField value = new JTextField(10);
+            p1.add(key, GBC.eop().insets(5, 0, 0, 0).fill(GBC.HORIZONTAL));
+            p1.add(new JLabel(tr("Value")), GBC.std().insets(0, 0, 5, 0));
+            p1.add(value, GBC.eol().insets(5, 0, 0, 0).fill(GBC.HORIZONTAL));
+            int answer = JOptionPane.showConfirmDialog(gui, p1,
+                    tr("Enter weight values"),
+                    JOptionPane.OK_CANCEL_OPTION);
+            if (answer == JOptionPane.OK_OPTION) {
+                model
+                .addRow(new String[] {
+                        key.getSelectedItem().toString(),
+                        value.getText() });
             }
         });
@@ -108,15 +98,12 @@
         JButton delete = new JButton(tr("Delete"));
         p.add(delete, GBC.std().insets(0, 5, 0, 0));
-        delete.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                if (list.getSelectedRow() == -1)
-                    JOptionPane.showMessageDialog(gui,
-                            tr("Please select the row to delete."));
-                else {
-                    Integer i;
-                    while ((i = list.getSelectedRow()) != -1) {
-                        model.removeRow(i);
-                    }
+        delete.addActionListener(e -> {
+            if (list.getSelectedRow() == -1)
+                JOptionPane.showMessageDialog(gui,
+                        tr("Please select the row to delete."));
+            else {
+                int i;
+                while ((i = list.getSelectedRow()) != -1) {
+                    model.removeRow(i);
                 }
             }
@@ -125,16 +112,11 @@
         JButton edit = new JButton(tr("Edit"));
         p.add(edit, GBC.std().insets(5, 5, 5, 0));
-        edit.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                edit(gui, list);
-            }
-        });
+        edit.addActionListener(e -> edit(gui, list));
 
-        JTabbedPane Opciones = new JTabbedPane();
-        Opciones.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
+        JTabbedPane options = new JTabbedPane();
+        options.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
 
-        Opciones.addTab("Profile", null, p, null);
-        //      Opciones.addTab("Preferences", new JPanel());
+        options.addTab("Profile", null, p, null);
+        //      options.addTab("Preferences", new JPanel());
 
         list.addMouseListener(new MouseAdapter() {
@@ -145,5 +127,5 @@
         });
 
-        principal.add(Opciones, GBC.eol().fill(GBC.BOTH));
+        principal.add(options, GBC.eol().fill(GBC.BOTH));
 
     }
@@ -184,6 +166,6 @@
         readPreferences();
         // Put these values in the model
-        for (String tag : orig.keySet()) {
-            model.addRow(new String[] {tag, orig.get(tag)});
+        for (Map.Entry<String, String> entry : orig.entrySet()) {
+            model.addRow(new String[] {entry.getKey(), entry.getValue()});
         }
     }
@@ -192,5 +174,5 @@
         orig = Preferences.main().getAllPrefix("routing.profile.default.speed");
         if (orig.size() == 0) { // defaults
-            logger.debug("Loading Default Preferences.");
+            Logging.trace("Loading Default Preferences.");
             for (OsmWayTypes owt : OsmWayTypes.values()) {
                 Config.getPref().putInt("routing.profile.default.speed."
@@ -198,5 +180,5 @@
             }
             orig = Preferences.main().getAllPrefix("routing.profile.default.speed");
-        } else logger.debug("Default preferences already exist.");
+        } else Logging.trace("Default preferences already exist.");
     }
     /*
