Index: /applications/editors/josm/plugins/waypoint_search/src/org/openstreetmap/josm/plugins/waypointSearch/Engine.java
===================================================================
--- /applications/editors/josm/plugins/waypoint_search/src/org/openstreetmap/josm/plugins/waypointSearch/Engine.java	(revision 30776)
+++ /applications/editors/josm/plugins/waypoint_search/src/org/openstreetmap/josm/plugins/waypointSearch/Engine.java	(revision 30777)
@@ -8,13 +8,17 @@
 import java.util.regex.Pattern;
 
-public class Engine {
+class Engine {
     
-    public List<Marker> searchGpxWaypoints(String waypointSearchPattern) {
+    private Engine() {
+        // Utility class
+    }
+
+    static List<Marker> searchGpxWaypoints(String waypointSearchPattern) {
         List<Marker> returnList = new ArrayList<>();
         if (gpxLayersExist()) {
             //Loop over marker (waypoint) layers.. it could be more than one
-            for (Iterator<MarkerLayer> layerIterator = Main.map.mapView.getLayersOfType(MarkerLayer.class).iterator(); layerIterator.hasNext();) {
+            for (Iterator<MarkerLayer> it = Main.map.mapView.getLayersOfType(MarkerLayer.class).iterator(); it.hasNext();) {
                 //loop over each marker (waypoint)
-                for (Iterator<Marker> markerIterator = layerIterator.next().data.iterator(); markerIterator.hasNext();) {
+                for (Iterator<Marker> markerIterator = it.next().data.iterator(); markerIterator.hasNext();) {
                     Marker marker = markerIterator.next();
                     if (Pattern.matches(".*\\Q"+waypointSearchPattern.toLowerCase()+"\\E.*", marker.getText().toLowerCase())) {
@@ -26,25 +30,7 @@
         return returnList;
     }   
-        
-        
-        
     
-
-    
-    
-    
-    public boolean gpxLayersExist() {
-      boolean rv = false;
-      if (Main.map != null) {
-          if (Main.map.mapView.hasLayers()) {
-              if (Main.map.mapView.getLayersOfType(MarkerLayer.class).size()>0) {
-                  rv = true;
-              }
-          }
-      }
-      return rv;
+    static boolean gpxLayersExist() {
+        return Main.map != null && Main.map.mapView.hasLayers() && !Main.map.mapView.getLayersOfType(MarkerLayer.class).isEmpty();
     }
-    
-    
-    
 }
Index: /applications/editors/josm/plugins/waypoint_search/src/org/openstreetmap/josm/plugins/waypointSearch/SelectWaypointDialog.java
===================================================================
--- /applications/editors/josm/plugins/waypoint_search/src/org/openstreetmap/josm/plugins/waypointSearch/SelectWaypointDialog.java	(revision 30776)
+++ /applications/editors/josm/plugins/waypoint_search/src/org/openstreetmap/josm/plugins/waypointSearch/SelectWaypointDialog.java	(revision 30777)
@@ -17,14 +17,13 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-public class SelectWaypointDialog extends ToggleDialog implements KeyListener, MouseListener {
+class SelectWaypointDialog extends ToggleDialog implements KeyListener, MouseListener {
 
     private JTextField searchPattern = new JTextField(20);
     private DefaultListModel<String> listModel = new DefaultListModel<>();
     private JList<String> searchResult = new JList<>(listModel);
-    private List<Marker> SearchResultObjectCache = new ArrayList<>();
-    private boolean first_time_search = true;
-    private Engine engine = new Engine();
+    private List<Marker> searchResultObjectCache = new ArrayList<>();
+    private boolean firstTimeSearch = true;
     
-    public SelectWaypointDialog(String name, String iconName, String tooltip,
+    SelectWaypointDialog(String name, String iconName, String tooltip,
             Shortcut shortcut, int preferredHeight) {
         super(name, iconName, tooltip, shortcut, preferredHeight);
@@ -58,15 +57,15 @@
     }
     
-    public void updateSearchResults(){
+    void updateSearchResults() {
         String searchfor = "";
         listModel.clear();
-        SearchResultObjectCache.clear();
-        if (!first_time_search) {
+        searchResultObjectCache.clear();
+        if (!firstTimeSearch) {
             searchfor = searchPattern.getText();
         }
-        for (Iterator<Marker> i = engine.searchGpxWaypoints(searchfor).iterator(); i.hasNext();) {
+        for (Iterator<Marker> i = Engine.searchGpxWaypoints(searchfor).iterator(); i.hasNext();) {
             Marker marker = i.next();
             listModel.addElement(marker.getText());
-            SearchResultObjectCache.add(marker);
+            searchResultObjectCache.add(marker);
         }
     }
@@ -74,10 +73,9 @@
     @Override
     public void keyPressed(KeyEvent arg0) {
-        // TODO Auto-generated method stub
+        // Do nothing
     }
 
     @Override
     public void keyReleased(KeyEvent arg0) {
-        // TODO Auto-generated method stub
         updateSearchResults();
     }
@@ -85,5 +83,5 @@
     @Override
     public void keyTyped(KeyEvent arg0) {
-        first_time_search = false;
+        firstTimeSearch = false;
     }
 
@@ -92,5 +90,5 @@
         if (e.getSource()==searchResult) {
             //click on the search result box
-            Marker marker = SearchResultObjectCache.get(searchResult.getSelectedIndex());
+            Marker marker = searchResultObjectCache.get(searchResult.getSelectedIndex());
             Main.map.mapView.zoomTo(marker.getCoor());
         } else {
@@ -101,8 +99,10 @@
     @Override
     public void mouseEntered(MouseEvent arg0) {
+        // Do nothing
     }
 
     @Override
     public void mouseExited(MouseEvent arg0) {
+        // Do nothing
     }
 
@@ -116,4 +116,5 @@
     @Override
     public void mouseReleased(MouseEvent arg0) {
+        // Do nothing
     }
 }
Index: /applications/editors/josm/plugins/waypoint_search/src/org/openstreetmap/josm/plugins/waypointSearch/WaypointSearchPlugin.java
===================================================================
--- /applications/editors/josm/plugins/waypoint_search/src/org/openstreetmap/josm/plugins/waypointSearch/WaypointSearchPlugin.java	(revision 30776)
+++ /applications/editors/josm/plugins/waypoint_search/src/org/openstreetmap/josm/plugins/waypointSearch/WaypointSearchPlugin.java	(revision 30777)
@@ -10,30 +10,38 @@
 import org.openstreetmap.josm.plugins.PluginInformation;
 
+/**
+ * This plugin enables a user to search for waypoint imported from a gpx file.
+ * After the plugin is installed a new button is presented on the left side of the map window. 
+ * Pressing this buttons open the search dialog on the right side.
+ * Click on one of the search results/waypoints to move the map.
+ */
 public class WaypointSearchPlugin extends Plugin implements LayerChangeListener  {
-    /**
-    * Will be invoked by JOSM to bootstrap the plugin
-    *
-    * @param info  information about the plugin and its local installation    
-    */
-    private final Engine engine = new Engine();
     private SelectWaypointDialog waypointDialog;
     
+    /**
+     * Will be invoked by JOSM to bootstrap the plugin
+     *
+     * @param info  information about the plugin and its local installation    
+     */
     public WaypointSearchPlugin(PluginInformation info) {
-       super(info);
-       MapView.addLayerChangeListener(this);
+        super(info);
+        MapView.addLayerChangeListener(this);
     }
      
-	@Override
-	public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
-		if (newFrame != null) {
-			newFrame.addToggleDialog(waypointDialog = new SelectWaypointDialog(
-					tr("Waypoint search"), "ToolbarIcon", tr("Search after waypoint. Click and move the map view to the waypoint."), null, 100));
-		} else {
-			waypointDialog = null;
-		}
-	}
+    @Override
+    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
+        if (newFrame != null) {
+            waypointDialog = new SelectWaypointDialog(
+                    tr("Waypoint search"), "ToolbarIcon", 
+                    tr("Search after waypoint. Click and move the map view to the waypoint."), null, 100);
+            newFrame.addToggleDialog(waypointDialog);
+        } else {
+            waypointDialog = null;
+        }
+    }
 
-	@Override
+    @Override
     public void activeLayerChange(Layer oldLayer, Layer newLayer) {
+        // Do nothing
     }
     
@@ -41,5 +49,5 @@
     public void layerAdded(Layer newLayer) {
         // update search
-        if (waypointDialog != null && engine.gpxLayersExist()) {
+        if (waypointDialog != null && Engine.gpxLayersExist()) {
             waypointDialog.updateSearchResults();
         }
@@ -48,5 +56,5 @@
     @Override
     public void layerRemoved(Layer oldLayer) {
-        if (waypointDialog != null && !engine.gpxLayersExist()) {
+        if (waypointDialog != null && !Engine.gpxLayersExist()) {
             waypointDialog.updateSearchResults();
         }   
