Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryData.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryData.java	(revision 31489)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryData.java	(revision 31490)
@@ -71,5 +71,5 @@
    * @param image
    */
-  public synchronized void delete(MapillaryAbstractImage image) {
+  public synchronized void remove(MapillaryAbstractImage image) {
     if (MapillaryMainDialog.getInstance().getImage() != null) {
       MapillaryMainDialog.getInstance().setImage(null);
@@ -89,7 +89,7 @@
    * @param images
    */
-  public synchronized void delete(List<MapillaryAbstractImage> images) {
+  public synchronized void remove(List<MapillaryAbstractImage> images) {
     for (MapillaryAbstractImage img : images)
-      delete(img);
+      remove(img);
   }
 
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java	(revision 31489)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java	(revision 31490)
@@ -5,9 +5,9 @@
 
 import org.openstreetmap.josm.plugins.mapillary.cache.CacheUtils;
-import org.openstreetmap.josm.plugins.mapillary.commands.CommandDeleteImage;
-import org.openstreetmap.josm.plugins.mapillary.commands.MapillaryRecord;
 import org.openstreetmap.josm.plugins.mapillary.downloads.MapillaryDownloader;
 import org.openstreetmap.josm.plugins.mapillary.gui.MapillaryFilterDialog;
 import org.openstreetmap.josm.plugins.mapillary.gui.MapillaryMainDialog;
+import org.openstreetmap.josm.plugins.mapillary.history.MapillaryRecord;
+import org.openstreetmap.josm.plugins.mapillary.history.commands.CommandDelete;
 import org.openstreetmap.josm.plugins.mapillary.mode.AbstractMode;
 import org.openstreetmap.josm.plugins.mapillary.mode.JoinMode;
@@ -623,5 +623,5 @@
       if (INSTANCE != null) {
         MapillaryRecord.getInstance().addCommand(
-            new CommandDeleteImage(getData().getMultiSelectedImages()));
+            new CommandDelete(getData().getMultiSelectedImages()));
       }
     }
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportAction.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportAction.java	(revision 31489)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportAction.java	(revision 31490)
@@ -7,4 +7,6 @@
 import java.io.File;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
 
 import javax.swing.JFileChooser;
@@ -22,7 +24,10 @@
 import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.plugins.mapillary.MapillaryAbstractImage;
 import org.openstreetmap.josm.plugins.mapillary.MapillaryImportedImage;
 import org.openstreetmap.josm.plugins.mapillary.MapillaryLayer;
 import org.openstreetmap.josm.plugins.mapillary.MapillaryPlugin;
+import org.openstreetmap.josm.plugins.mapillary.history.MapillaryRecord;
+import org.openstreetmap.josm.plugins.mapillary.history.commands.CommandImport;
 import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryUtils;
 import org.openstreetmap.josm.tools.Shortcut;
@@ -70,4 +75,5 @@
     this.chooser.setMultiSelectionEnabled(true);
     if (this.chooser.showOpenDialog(Main.parent) == JFileChooser.APPROVE_OPTION) {
+      List<MapillaryAbstractImage> images = new ArrayList<>();
       for (int i = 0; i < this.chooser.getSelectedFiles().length; i++) {
         File file = this.chooser.getSelectedFiles()[i];
@@ -85,10 +91,8 @@
             try {
               if (extension.equals("jpg") || extension.equals("jpeg"))
-                MapillaryLayer.getInstance().getData()
-                    .add(readJPG(file.listFiles()[j]));
+                images.add(readJPG(file.listFiles()[j]));
 
               else if (extension.equals("png"))
-                MapillaryLayer.getInstance().getData()
-                    .add(readPNG(file.listFiles()[j]));
+                images.add(readPNG(file.listFiles()[j]));
             } catch (ImageReadException | IOException | NullPointerException e1) {
               Main.error(e1);
@@ -101,5 +105,5 @@
                   .equals(".jpeg")) {
             try {
-              MapillaryLayer.getInstance().getData().add(readJPG(file));
+              images.add(readJPG(file));
             } catch (ImageReadException ex) {
               Main.error(ex);
@@ -109,10 +113,10 @@
           } else if (file.getPath().substring(file.getPath().length() - 4)
               .equals(".png")) {
-            MapillaryLayer.getInstance().getData().add(readPNG(file));
+            images.add(readPNG(file));
           }
         }
       }
+      MapillaryRecord.getInstance().addCommand(new CommandImport(images));
       MapillaryLayer.getInstance().showAllPictures();
-
     }
   }
@@ -154,9 +158,9 @@
       double caValue = 0;
       if (lat.getValue() instanceof RationalNumber[])
-        latValue = MapillaryUtils.degMinSecToDouble((RationalNumber[]) lat.getValue(), lat_ref
-            .getValue().toString());
+        latValue = MapillaryUtils.degMinSecToDouble(
+            (RationalNumber[]) lat.getValue(), lat_ref.getValue().toString());
       if (lon.getValue() instanceof RationalNumber[])
-        lonValue = MapillaryUtils.degMinSecToDouble((RationalNumber[]) lon.getValue(), lon_ref
-            .getValue().toString());
+        lonValue = MapillaryUtils.degMinSecToDouble(
+            (RationalNumber[]) lon.getValue(), lon_ref.getValue().toString());
       if (ca != null && ca.getValue() instanceof RationalNumber)
         caValue = ((RationalNumber) ca.getValue()).doubleValue();
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportIntoSequenceAction.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportIntoSequenceAction.java	(revision 31489)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryImportIntoSequenceAction.java	(revision 31490)
@@ -10,4 +10,5 @@
 import java.util.Comparator;
 import java.util.LinkedList;
+import java.util.List;
 
 import javax.swing.JFileChooser;
@@ -29,4 +30,6 @@
 import org.openstreetmap.josm.plugins.mapillary.MapillaryPlugin;
 import org.openstreetmap.josm.plugins.mapillary.MapillarySequence;
+import org.openstreetmap.josm.plugins.mapillary.history.MapillaryRecord;
+import org.openstreetmap.josm.plugins.mapillary.history.commands.CommandImport;
 import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryUtils;
 import org.openstreetmap.josm.tools.Shortcut;
@@ -44,5 +47,5 @@
   private JFileChooser chooser;
 
-  private LinkedList<MapillaryImportedImage> images;
+  private List<MapillaryAbstractImage> images;
 
   /**
@@ -111,6 +114,6 @@
       }
       joinImages();
-    }
-
+      MapillaryRecord.getInstance().addCommand(new CommandImport(this.images));
+    }
     MapillaryLayer.getInstance().showAllPictures();
   }
@@ -161,7 +164,4 @@
       MapillaryImportedImage image = new MapillaryImportedImage(latValue,
           lonValue, caValue, file, datetimeOriginal.getStringValue());
-      MapillaryLayer.getInstance().getData().add(image);
-      image.getCapturedAt();
-
       this.images.add(image);
     }
@@ -174,5 +174,5 @@
     Collections.sort(this.images, new MapillaryEpochComparator());
     MapillarySequence seq = new MapillarySequence();
-    for (MapillaryImportedImage img : this.images) {
+    for (MapillaryAbstractImage img : this.images) {
       seq.add(img);
       img.setSequence(seq);
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/CommandDeleteImage.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/CommandDeleteImage.java	(revision 31489)
+++ 	(revision )
@@ -1,59 +1,0 @@
-package org.openstreetmap.josm.plugins.mapillary.commands;
-
-import static org.openstreetmap.josm.tools.I18n.trn;
-
-import java.util.HashMap;
-import java.util.List;
-
-import org.openstreetmap.josm.plugins.mapillary.MapillaryAbstractImage;
-import org.openstreetmap.josm.plugins.mapillary.MapillaryLayer;
-
-/**
- * @author nokutu
- *
- */
-public class CommandDeleteImage extends MapillaryExecutableCommand {
-
-  private HashMap<MapillaryAbstractImage, Integer> changesHash;
-
-  /**
-   * @param images
-   */
-  public CommandDeleteImage(List<MapillaryAbstractImage> images) {
-    super(images);
-    this.changesHash = new HashMap<>();
-  }
-
-  @Override
-  public void sum(MapillaryCommand command) {
-    // Ignored
-  }
-
-  @Override
-  public void execute() {
-    for (MapillaryAbstractImage img : this.images) {
-      this.changesHash.put(img, img.getSequence().getImages().indexOf(img));
-      MapillaryLayer.getInstance().getData().delete(img);
-    }
-  }
-
-  @Override
-  public String toString() {
-    return trn("Deleted {0} image", "Deleted {0} images", this.images.size(),
-        this.images.size());
-  }
-
-  @Override
-  public void undo() {
-    for (int i = this.images.size() - 1; i >= 0; i--) {
-      MapillaryAbstractImage img = this.images.get(i);
-      MapillaryLayer.getInstance().getData().add(img);
-      img.getSequence().getImages().add(this.changesHash.get(img), img);
-    }
-  }
-
-  @Override
-  public void redo() {
-    MapillaryLayer.getInstance().getData().delete(this.images);
-  }
-}
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/CommandJoin.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/CommandJoin.java	(revision 31489)
+++ 	(revision )
@@ -1,55 +1,0 @@
-package org.openstreetmap.josm.plugins.mapillary.commands;
-
-import static org.openstreetmap.josm.tools.I18n.tr;
-
-import java.util.List;
-
-import org.openstreetmap.josm.plugins.mapillary.MapillaryAbstractImage;
-import org.openstreetmap.josm.plugins.mapillary.MapillaryImportedImage;
-import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryUtils;
-
-/**
- * Command joined when joining two images into the same sequence.
- *
- * @author nokutu
- *
- */
-public class CommandJoin extends MapillaryExecutableCommand {
-
-  /**
-   * Main constructor.
-   *
-   * @param images
-   */
-  public CommandJoin(List<MapillaryAbstractImage> images) {
-    super(images);
-  }
-
-  @Override
-  public void execute() {
-    this.redo();
-  }
-
-  @Override
-  public void undo() {
-    MapillaryUtils.unjoin((MapillaryImportedImage) this.images.get(0),
-        (MapillaryImportedImage) this.images.get(1));
-  }
-
-  @Override
-  public void redo() {
-    MapillaryUtils.join((MapillaryImportedImage) this.images.get(0),
-        (MapillaryImportedImage) this.images.get(1));
-  }
-
-  @Override
-  public void sum(MapillaryCommand command) {
-    // TODO Auto-generated method stub
-
-  }
-
-  @Override
-  public String toString() {
-    return tr("2 images joined");
-  }
-}
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/CommandMoveImage.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/CommandMoveImage.java	(revision 31489)
+++ 	(revision )
@@ -1,72 +1,0 @@
-package org.openstreetmap.josm.plugins.mapillary.commands;
-
-import static org.openstreetmap.josm.tools.I18n.trn;
-
-import java.util.List;
-
-import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.plugins.mapillary.MapillaryAbstractImage;
-
-/**
- * Command created when an image's position is changed.
- *
- * @author nokutu
- *
- */
-public class CommandMoveImage extends MapillaryCommand {
-  private double x;
-  private double y;
-
-  /**
-   * Main constructor.
-   *
-   * @param images
-   *          Set of images that are going to be moved.
-   * @param x
-   *          How much the x coordinate increases.
-   * @param y
-   *          How much the y coordinate increases.
-   */
-  public CommandMoveImage(List<MapillaryAbstractImage> images, double x,
-      double y) {
-    super(images);
-    this.x = x;
-    this.y = y;
-  }
-
-  @Override
-  public void undo() {
-    for (MapillaryAbstractImage image : this.images) {
-      image.move(-this.x, -this.y);
-      image.stopMoving();
-    }
-    checkModified();
-    if (Main.main != null)
-      Main.map.repaint();
-  }
-
-  @Override
-  public void redo() {
-    for (MapillaryAbstractImage image : this.images) {
-      image.move(this.x, this.y);
-      image.stopMoving();
-    }
-    checkModified();
-    if (Main.main != null)
-      Main.map.repaint();
-  }
-
-  @Override
-  public String toString() {
-    return trn("Moved {0} image", "Moved {0} images", this.images.size(),
-        this.images.size());
-  }
-
-  @Override
-  public void sum(MapillaryCommand command) {
-    if (command instanceof CommandMoveImage) {
-      this.x += ((CommandMoveImage) command).x;
-      this.y += ((CommandMoveImage) command).y;
-    }
-  }
-}
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/CommandTurnImage.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/CommandTurnImage.java	(revision 31489)
+++ 	(revision )
@@ -1,66 +1,0 @@
-package org.openstreetmap.josm.plugins.mapillary.commands;
-
-import static org.openstreetmap.josm.tools.I18n.trn;
-
-import java.util.List;
-
-import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.plugins.mapillary.MapillaryAbstractImage;
-
-/**
- * Command created when an image's direction is changed.
- *
- * @author nokutu
- *
- */
-public class CommandTurnImage extends MapillaryCommand {
-  private double ca;
-
-  /**
-   * Main constructor.
-   *
-   * @param images
-   *          Set of images that is turned.
-   * @param ca
-   *          How much the images turn.
-   */
-  public CommandTurnImage(List<MapillaryAbstractImage> images, double ca) {
-    super(images);
-    this.ca = ca;
-  }
-
-  @Override
-  public void undo() {
-    for (MapillaryAbstractImage image : this.images) {
-      image.turn(-this.ca);
-      image.stopMoving();
-    }
-    checkModified();
-    if (Main.main != null)
-      Main.map.repaint();
-  }
-
-  @Override
-  public void redo() {
-    for (MapillaryAbstractImage image : this.images) {
-      image.turn(this.ca);
-      image.stopMoving();
-    }
-    checkModified();
-    if (Main.main != null)
-      Main.map.repaint();
-  }
-
-  @Override
-  public String toString() {
-    return trn("Turned {0} image", "Turned {0} images", this.images.size(),
-        this.images.size());
-  }
-
-  @Override
-  public void sum(MapillaryCommand command) {
-    if (command instanceof CommandTurnImage) {
-      this.ca += ((CommandTurnImage) command).ca;
-    }
-  }
-}
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/CommandUnjoin.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/CommandUnjoin.java	(revision 31489)
+++ 	(revision )
@@ -1,54 +1,0 @@
-package org.openstreetmap.josm.plugins.mapillary.commands;
-
-import static org.openstreetmap.josm.tools.I18n.tr;
-
-import java.util.List;
-
-import org.openstreetmap.josm.plugins.mapillary.MapillaryAbstractImage;
-import org.openstreetmap.josm.plugins.mapillary.MapillaryImportedImage;
-import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryUtils;
-
-/**
- * Command joined when joining two images into the same sequence.
- *
- * @author nokutu
- *
- */
-public class CommandUnjoin extends MapillaryExecutableCommand {
-
-  /**
-   * Main constructor.
-   *
-   * @param images
-   */
-  public CommandUnjoin(List<MapillaryAbstractImage> images) {
-    super(images);
-  }
-
-  @Override
-  public void execute() {
-    this.redo();
-  }
-
-  @Override
-  public void undo() {
-    MapillaryUtils.join((MapillaryImportedImage) this.images.get(0),
-        (MapillaryImportedImage) this.images.get(1));
-  }
-
-  @Override
-  public void redo() {
-    MapillaryUtils.unjoin((MapillaryImportedImage) this.images.get(0),
-        (MapillaryImportedImage) this.images.get(1));
-  }
-
-  @Override
-  public void sum(MapillaryCommand command) {
-    // IGNORE
-  }
-
-  @Override
-  public String toString() {
-    return tr("2 images unjoined");
-  }
-}
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/MapillaryCommand.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/MapillaryCommand.java	(revision 31489)
+++ 	(revision )
@@ -1,56 +1,0 @@
-package org.openstreetmap.josm.plugins.mapillary.commands;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.openstreetmap.josm.plugins.mapillary.MapillaryAbstractImage;
-
-/**
- * Abstract class for any Mapillary command.
- *
- * @author nokutu
- *
- */
-public abstract class MapillaryCommand {
-  protected List<MapillaryAbstractImage> images;
-
-  /**
-   * Main constructor.
-   *
-   * @param images
-   *          The images that are affected by the command.
-   */
-  public MapillaryCommand(List<MapillaryAbstractImage> images) {
-    this.images = new ArrayList<MapillaryAbstractImage>(images);
-  }
-
-  /**
-   * Undoes the action.
-   */
-  public abstract void undo();
-
-  /**
-   * Redoes the action.
-   */
-  public abstract void redo();
-
-  /**
-   * If two equal commands are applied consecutively to the same set of images,
-   * they are summed in order to reduce them to just one command.
-   *
-   * @param command
-   *          The command to be summed to last command.
-   */
-  public abstract void sum(MapillaryCommand command);
-
-  /**
-   * Checks if the image has been modified, comparing with its original values.
-   */
-  public void checkModified() {
-    for (MapillaryAbstractImage image : this.images)
-      image.isModified = (image.tempLatLon == image.latLon || image.tempCa == image.ca);
-  }
-
-  @Override
-  public abstract String toString();
-}
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/MapillaryExecutableCommand.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/MapillaryExecutableCommand.java	(revision 31489)
+++ 	(revision )
@@ -1,28 +1,0 @@
-package org.openstreetmap.josm.plugins.mapillary.commands;
-
-import java.util.List;
-
-import org.openstreetmap.josm.plugins.mapillary.MapillaryAbstractImage;
-
-/**
- * Superclass for those commands that must be executed after creation.
- *
- * @author nokutu
- *
- */
-public abstract class MapillaryExecutableCommand extends MapillaryCommand {
-
-  /**
-   * Main constructor.
-   *
-   * @param images
-   */
-  public MapillaryExecutableCommand(List<MapillaryAbstractImage> images) {
-    super(images);
-  }
-
-  /**
-   * Executes the command.
-   */
-  public abstract void execute();
-}
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/MapillaryRecord.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/MapillaryRecord.java	(revision 31489)
+++ 	(revision )
@@ -1,126 +1,0 @@
-package org.openstreetmap.josm.plugins.mapillary.commands;
-
-import java.util.ArrayList;
-
-import org.openstreetmap.josm.plugins.mapillary.MapillaryAbstractImage;
-
-/**
- * History record system in order to let the user undo and redo commands.
- *
- * @author nokutu
- *
- */
-public class MapillaryRecord {
-  /** The unique instance of the class. */
-  private static MapillaryRecord INSTANCE;
-
-  private ArrayList<MapillaryRecordListener> listeners;
-
-  /** The set of commands that have taken place or that have been undone. */
-  public ArrayList<MapillaryCommand> commandList;
-  /** Last written command. */
-  public int position;
-
-  /**
-   * Main constructor.
-   */
-  public MapillaryRecord() {
-    this.commandList = new ArrayList<>();
-    this.position = -1;
-    this.listeners = new ArrayList<>();
-  }
-
-  /**
-   * Returns the unique instance of the class.
-   *
-   * @return The unique instance of the class.
-   */
-  public static synchronized MapillaryRecord getInstance() {
-    if (MapillaryRecord.INSTANCE == null)
-      MapillaryRecord.INSTANCE = new MapillaryRecord();
-    return MapillaryRecord.INSTANCE;
-  }
-
-  /**
-   * Adds a listener.
-   *
-   * @param lis
-   *          The listener to be added.
-   */
-  public void addListener(MapillaryRecordListener lis) {
-    this.listeners.add(lis);
-  }
-
-  /**
-   * Removes the given listener.
-   *
-   * @param lis
-   *          The listener to be removed.
-   */
-  public void removeListener(MapillaryRecordListener lis) {
-    this.listeners.remove(lis);
-  }
-
-  /**
-   * Adds a new command to the list.
-   *
-   * @param command
-   *          The command to be added.
-   */
-  public void addCommand(MapillaryCommand command) {
-    if (command instanceof MapillaryExecutableCommand)
-      ((MapillaryExecutableCommand) command).execute();
-    // Checks if it is a continuation of last command
-    if (this.position != -1) {
-      boolean equalSets = true;
-      for (MapillaryAbstractImage img : this.commandList.get(this.position).images)
-        if (!command.images.contains(img))
-          equalSets = false;
-      for (MapillaryAbstractImage img : command.images)
-        if (!this.commandList.get(this.position).images.contains(img))
-          equalSets = false;
-      if (equalSets
-          && this.commandList.get(this.position).getClass() == command
-              .getClass()) {
-        this.commandList.get(this.position).sum(command);
-        fireRecordChanged();
-        return;
-      }
-    }
-    // Adds the command to the last position of the list.
-    this.commandList.add(this.position + 1, command);
-    this.position++;
-    while (this.commandList.size() > this.position + 1) {
-      this.commandList.remove(this.position + 1);
-    }
-    fireRecordChanged();
-  }
-
-  /**
-   * Undo latest command.
-   */
-  public void undo() {
-    if (this.position == -1)
-      throw new IllegalStateException();
-    this.commandList.get(this.position).undo();
-    this.position--;
-    fireRecordChanged();
-  }
-
-  /**
-   * Redoes latest undone action.
-   */
-  public void redo() {
-    if (this.position + 1 >= this.commandList.size())
-      throw new IllegalStateException();
-    this.position++;
-    this.commandList.get(this.position).redo();
-    fireRecordChanged();
-  }
-
-  private void fireRecordChanged() {
-    for (MapillaryRecordListener lis : this.listeners)
-      if (lis != null)
-        lis.recordChanged();
-  }
-}
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/MapillaryRecordListener.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/commands/MapillaryRecordListener.java	(revision 31489)
+++ 	(revision )
@@ -1,14 +1,0 @@
-package org.openstreetmap.josm.plugins.mapillary.commands;
-
-/**
- * Interface for the listener of the {@link MapillaryRecord} class
- * 
- * @author nokutu
- * @see MapillaryRecord
- */
-public interface MapillaryRecordListener {
-  /**
-   * Fired when any command is undone or redone.
-   */
-  public void recordChanged();
-}
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryHistoryDialog.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryHistoryDialog.java	(revision 31489)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryHistoryDialog.java	(revision 31490)
@@ -22,7 +22,7 @@
 import org.openstreetmap.josm.gui.SideButton;
 import org.openstreetmap.josm.gui.dialogs.ToggleDialog;
-import org.openstreetmap.josm.plugins.mapillary.commands.MapillaryCommand;
-import org.openstreetmap.josm.plugins.mapillary.commands.MapillaryRecord;
-import org.openstreetmap.josm.plugins.mapillary.commands.MapillaryRecordListener;
+import org.openstreetmap.josm.plugins.mapillary.history.MapillaryRecord;
+import org.openstreetmap.josm.plugins.mapillary.history.MapillaryRecordListener;
+import org.openstreetmap.josm.plugins.mapillary.history.commands.MapillaryCommand;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/MapillaryRecord.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/MapillaryRecord.java	(revision 31490)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/MapillaryRecord.java	(revision 31490)
@@ -0,0 +1,128 @@
+package org.openstreetmap.josm.plugins.mapillary.history;
+
+import java.util.ArrayList;
+
+import org.openstreetmap.josm.plugins.mapillary.MapillaryAbstractImage;
+import org.openstreetmap.josm.plugins.mapillary.history.commands.MapillaryCommand;
+import org.openstreetmap.josm.plugins.mapillary.history.commands.MapillaryExecutableCommand;
+
+/**
+ * History record system in order to let the user undo and redo commands.
+ *
+ * @author nokutu
+ *
+ */
+public class MapillaryRecord {
+  /** The unique instance of the class. */
+  private static MapillaryRecord INSTANCE;
+
+  private ArrayList<MapillaryRecordListener> listeners;
+
+  /** The set of commands that have taken place or that have been undone. */
+  public ArrayList<MapillaryCommand> commandList;
+  /** Last written command. */
+  public int position;
+
+  /**
+   * Main constructor.
+   */
+  public MapillaryRecord() {
+    this.commandList = new ArrayList<>();
+    this.position = -1;
+    this.listeners = new ArrayList<>();
+  }
+
+  /**
+   * Returns the unique instance of the class.
+   *
+   * @return The unique instance of the class.
+   */
+  public static synchronized MapillaryRecord getInstance() {
+    if (MapillaryRecord.INSTANCE == null)
+      MapillaryRecord.INSTANCE = new MapillaryRecord();
+    return MapillaryRecord.INSTANCE;
+  }
+
+  /**
+   * Adds a listener.
+   *
+   * @param lis
+   *          The listener to be added.
+   */
+  public void addListener(MapillaryRecordListener lis) {
+    this.listeners.add(lis);
+  }
+
+  /**
+   * Removes the given listener.
+   *
+   * @param lis
+   *          The listener to be removed.
+   */
+  public void removeListener(MapillaryRecordListener lis) {
+    this.listeners.remove(lis);
+  }
+
+  /**
+   * Adds a new command to the list.
+   *
+   * @param command
+   *          The command to be added.
+   */
+  public void addCommand(MapillaryCommand command) {
+    if (command instanceof MapillaryExecutableCommand)
+      ((MapillaryExecutableCommand) command).execute();
+    // Checks if it is a continuation of last command
+    if (this.position != -1) {
+      boolean equalSets = true;
+      for (MapillaryAbstractImage img : this.commandList.get(this.position).images)
+        if (!command.images.contains(img))
+          equalSets = false;
+      for (MapillaryAbstractImage img : command.images)
+        if (!this.commandList.get(this.position).images.contains(img))
+          equalSets = false;
+      if (equalSets
+          && this.commandList.get(this.position).getClass() == command
+              .getClass()) {
+        this.commandList.get(this.position).sum(command);
+        fireRecordChanged();
+        return;
+      }
+    }
+    // Adds the command to the last position of the list.
+    this.commandList.add(this.position + 1, command);
+    this.position++;
+    while (this.commandList.size() > this.position + 1) {
+      this.commandList.remove(this.position + 1);
+    }
+    fireRecordChanged();
+  }
+
+  /**
+   * Undo latest command.
+   */
+  public void undo() {
+    if (this.position == -1)
+      throw new IllegalStateException();
+    this.commandList.get(this.position).undo();
+    this.position--;
+    fireRecordChanged();
+  }
+
+  /**
+   * Redoes latest undone action.
+   */
+  public void redo() {
+    if (this.position + 1 >= this.commandList.size())
+      throw new IllegalStateException();
+    this.position++;
+    this.commandList.get(this.position).redo();
+    fireRecordChanged();
+  }
+
+  private void fireRecordChanged() {
+    for (MapillaryRecordListener lis : this.listeners)
+      if (lis != null)
+        lis.recordChanged();
+  }
+}
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/MapillaryRecordListener.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/MapillaryRecordListener.java	(revision 31490)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/MapillaryRecordListener.java	(revision 31490)
@@ -0,0 +1,14 @@
+package org.openstreetmap.josm.plugins.mapillary.history;
+
+/**
+ * Interface for the listener of the {@link MapillaryRecord} class
+ * 
+ * @author nokutu
+ * @see MapillaryRecord
+ */
+public interface MapillaryRecordListener {
+  /**
+   * Fired when any command is undone or redone.
+   */
+  public void recordChanged();
+}
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/commands/CommandDelete.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/commands/CommandDelete.java	(revision 31490)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/commands/CommandDelete.java	(revision 31490)
@@ -0,0 +1,59 @@
+package org.openstreetmap.josm.plugins.mapillary.history.commands;
+
+import static org.openstreetmap.josm.tools.I18n.trn;
+
+import java.util.HashMap;
+import java.util.List;
+
+import org.openstreetmap.josm.plugins.mapillary.MapillaryAbstractImage;
+import org.openstreetmap.josm.plugins.mapillary.MapillaryLayer;
+
+/**
+ * @author nokutu
+ *
+ */
+public class CommandDelete extends MapillaryExecutableCommand {
+
+  private HashMap<MapillaryAbstractImage, Integer> changesHash;
+
+  /**
+   * @param images
+   */
+  public CommandDelete(List<MapillaryAbstractImage> images) {
+    super(images);
+    this.changesHash = new HashMap<>();
+  }
+
+  @Override
+  public void sum(MapillaryCommand command) {
+    // Ignored
+  }
+
+  @Override
+  public void execute() {
+    for (MapillaryAbstractImage img : this.images) {
+      this.changesHash.put(img, img.getSequence().getImages().indexOf(img));
+      MapillaryLayer.getInstance().getData().remove(img);
+    }
+  }
+
+  @Override
+  public String toString() {
+    return trn("Deleted {0} image", "Deleted {0} images", this.images.size(),
+        this.images.size());
+  }
+
+  @Override
+  public void undo() {
+    for (int i = this.images.size() - 1; i >= 0; i--) {
+      MapillaryAbstractImage img = this.images.get(i);
+      MapillaryLayer.getInstance().getData().add(img);
+      img.getSequence().getImages().add(this.changesHash.get(img), img);
+    }
+  }
+
+  @Override
+  public void redo() {
+    MapillaryLayer.getInstance().getData().remove(this.images);
+  }
+}
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/commands/CommandImport.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/commands/CommandImport.java	(revision 31490)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/commands/CommandImport.java	(revision 31490)
@@ -0,0 +1,57 @@
+package org.openstreetmap.josm.plugins.mapillary.history.commands;
+
+import static org.openstreetmap.josm.tools.I18n.trn;
+
+import java.util.List;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.plugins.mapillary.MapillaryAbstractImage;
+import org.openstreetmap.josm.plugins.mapillary.MapillaryData;
+import org.openstreetmap.josm.plugins.mapillary.MapillaryLayer;
+
+/**
+ * Imports a set of images stored locally.
+ *
+ * @author nokutu
+ *
+ */
+public class CommandImport extends MapillaryExecutableCommand {
+
+  /**
+   * Main constructor.
+   *
+   * @param images
+   */
+  public CommandImport(List<MapillaryAbstractImage> images) {
+    super(images);
+  }
+
+  @Override
+  public void execute() {
+    this.redo();
+  }
+
+  @Override
+  public void undo() {
+    for (MapillaryAbstractImage img : this.images)
+      MapillaryLayer.getInstance().getData().getImages().remove(img);
+    if (Main.main != null)
+      MapillaryData.dataUpdated();
+  }
+
+  @Override
+  public void redo() {
+    MapillaryLayer.getInstance().getData().add(this.images);
+  }
+
+  @Override
+  public void sum(MapillaryCommand command) {
+    // IGNORE
+  }
+
+  @Override
+  public String toString() {
+    return trn("Imported {0} image", "Imported {0} images", this.images.size(),
+        this.images.size());
+  }
+}
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/commands/CommandJoin.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/commands/CommandJoin.java	(revision 31490)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/commands/CommandJoin.java	(revision 31490)
@@ -0,0 +1,55 @@
+package org.openstreetmap.josm.plugins.mapillary.history.commands;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.util.List;
+
+import org.openstreetmap.josm.plugins.mapillary.MapillaryAbstractImage;
+import org.openstreetmap.josm.plugins.mapillary.MapillaryImportedImage;
+import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryUtils;
+
+/**
+ * Command joined when joining two images into the same sequence.
+ *
+ * @author nokutu
+ *
+ */
+public class CommandJoin extends MapillaryExecutableCommand {
+
+  /**
+   * Main constructor.
+   *
+   * @param images
+   */
+  public CommandJoin(List<MapillaryAbstractImage> images) {
+    super(images);
+  }
+
+  @Override
+  public void execute() {
+    this.redo();
+  }
+
+  @Override
+  public void undo() {
+    MapillaryUtils.unjoin((MapillaryImportedImage) this.images.get(0),
+        (MapillaryImportedImage) this.images.get(1));
+  }
+
+  @Override
+  public void redo() {
+    MapillaryUtils.join((MapillaryImportedImage) this.images.get(0),
+        (MapillaryImportedImage) this.images.get(1));
+  }
+
+  @Override
+  public void sum(MapillaryCommand command) {
+    // TODO Auto-generated method stub
+
+  }
+
+  @Override
+  public String toString() {
+    return tr("2 images joined");
+  }
+}
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/commands/CommandMove.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/commands/CommandMove.java	(revision 31490)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/commands/CommandMove.java	(revision 31490)
@@ -0,0 +1,72 @@
+package org.openstreetmap.josm.plugins.mapillary.history.commands;
+
+import static org.openstreetmap.josm.tools.I18n.trn;
+
+import java.util.List;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.plugins.mapillary.MapillaryAbstractImage;
+
+/**
+ * Command created when an image's position is changed.
+ *
+ * @author nokutu
+ *
+ */
+public class CommandMove extends MapillaryCommand {
+  private double x;
+  private double y;
+
+  /**
+   * Main constructor.
+   *
+   * @param images
+   *          Set of images that are going to be moved.
+   * @param x
+   *          How much the x coordinate increases.
+   * @param y
+   *          How much the y coordinate increases.
+   */
+  public CommandMove(List<MapillaryAbstractImage> images, double x,
+      double y) {
+    super(images);
+    this.x = x;
+    this.y = y;
+  }
+
+  @Override
+  public void undo() {
+    for (MapillaryAbstractImage image : this.images) {
+      image.move(-this.x, -this.y);
+      image.stopMoving();
+    }
+    checkModified();
+    if (Main.main != null)
+      Main.map.repaint();
+  }
+
+  @Override
+  public void redo() {
+    for (MapillaryAbstractImage image : this.images) {
+      image.move(this.x, this.y);
+      image.stopMoving();
+    }
+    checkModified();
+    if (Main.main != null)
+      Main.map.repaint();
+  }
+
+  @Override
+  public String toString() {
+    return trn("Moved {0} image", "Moved {0} images", this.images.size(),
+        this.images.size());
+  }
+
+  @Override
+  public void sum(MapillaryCommand command) {
+    if (command instanceof CommandMove) {
+      this.x += ((CommandMove) command).x;
+      this.y += ((CommandMove) command).y;
+    }
+  }
+}
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/commands/CommandTurn.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/commands/CommandTurn.java	(revision 31490)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/commands/CommandTurn.java	(revision 31490)
@@ -0,0 +1,66 @@
+package org.openstreetmap.josm.plugins.mapillary.history.commands;
+
+import static org.openstreetmap.josm.tools.I18n.trn;
+
+import java.util.List;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.plugins.mapillary.MapillaryAbstractImage;
+
+/**
+ * Command created when an image's direction is changed.
+ *
+ * @author nokutu
+ *
+ */
+public class CommandTurn extends MapillaryCommand {
+  private double ca;
+
+  /**
+   * Main constructor.
+   *
+   * @param images
+   *          Set of images that is turned.
+   * @param ca
+   *          How much the images turn.
+   */
+  public CommandTurn(List<MapillaryAbstractImage> images, double ca) {
+    super(images);
+    this.ca = ca;
+  }
+
+  @Override
+  public void undo() {
+    for (MapillaryAbstractImage image : this.images) {
+      image.turn(-this.ca);
+      image.stopMoving();
+    }
+    checkModified();
+    if (Main.main != null)
+      Main.map.repaint();
+  }
+
+  @Override
+  public void redo() {
+    for (MapillaryAbstractImage image : this.images) {
+      image.turn(this.ca);
+      image.stopMoving();
+    }
+    checkModified();
+    if (Main.main != null)
+      Main.map.repaint();
+  }
+
+  @Override
+  public String toString() {
+    return trn("Turned {0} image", "Turned {0} images", this.images.size(),
+        this.images.size());
+  }
+
+  @Override
+  public void sum(MapillaryCommand command) {
+    if (command instanceof CommandTurn) {
+      this.ca += ((CommandTurn) command).ca;
+    }
+  }
+}
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/commands/CommandUnjoin.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/commands/CommandUnjoin.java	(revision 31490)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/commands/CommandUnjoin.java	(revision 31490)
@@ -0,0 +1,54 @@
+package org.openstreetmap.josm.plugins.mapillary.history.commands;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.util.List;
+
+import org.openstreetmap.josm.plugins.mapillary.MapillaryAbstractImage;
+import org.openstreetmap.josm.plugins.mapillary.MapillaryImportedImage;
+import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryUtils;
+
+/**
+ * Command joined when joining two images into the same sequence.
+ *
+ * @author nokutu
+ *
+ */
+public class CommandUnjoin extends MapillaryExecutableCommand {
+
+  /**
+   * Main constructor.
+   *
+   * @param images
+   */
+  public CommandUnjoin(List<MapillaryAbstractImage> images) {
+    super(images);
+  }
+
+  @Override
+  public void execute() {
+    this.redo();
+  }
+
+  @Override
+  public void undo() {
+    MapillaryUtils.join((MapillaryImportedImage) this.images.get(0),
+        (MapillaryImportedImage) this.images.get(1));
+  }
+
+  @Override
+  public void redo() {
+    MapillaryUtils.unjoin((MapillaryImportedImage) this.images.get(0),
+        (MapillaryImportedImage) this.images.get(1));
+  }
+
+  @Override
+  public void sum(MapillaryCommand command) {
+    // IGNORE
+  }
+
+  @Override
+  public String toString() {
+    return tr("2 images unjoined");
+  }
+}
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/commands/MapillaryCommand.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/commands/MapillaryCommand.java	(revision 31490)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/commands/MapillaryCommand.java	(revision 31490)
@@ -0,0 +1,57 @@
+package org.openstreetmap.josm.plugins.mapillary.history.commands;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.openstreetmap.josm.plugins.mapillary.MapillaryAbstractImage;
+
+/**
+ * Abstract class for any Mapillary command.
+ *
+ * @author nokutu
+ *
+ */
+public abstract class MapillaryCommand {
+  /** Set of {@link MapillaryAbstractImage} objects affected by the command */
+  public List<MapillaryAbstractImage> images;
+
+  /**
+   * Main constructor.
+   *
+   * @param images
+   *          The images that are affected by the command.
+   */
+  public MapillaryCommand(List<MapillaryAbstractImage> images) {
+    this.images = new ArrayList<MapillaryAbstractImage>(images);
+  }
+
+  /**
+   * Undoes the action.
+   */
+  public abstract void undo();
+
+  /**
+   * Redoes the action.
+   */
+  public abstract void redo();
+
+  /**
+   * If two equal commands are applied consecutively to the same set of images,
+   * they are summed in order to reduce them to just one command.
+   *
+   * @param command
+   *          The command to be summed to last command.
+   */
+  public abstract void sum(MapillaryCommand command);
+
+  /**
+   * Checks if the image has been modified, comparing with its original values.
+   */
+  public void checkModified() {
+    for (MapillaryAbstractImage image : this.images)
+      image.isModified = (image.tempLatLon == image.latLon || image.tempCa == image.ca);
+  }
+
+  @Override
+  public abstract String toString();
+}
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/commands/MapillaryExecutableCommand.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/commands/MapillaryExecutableCommand.java	(revision 31490)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/history/commands/MapillaryExecutableCommand.java	(revision 31490)
@@ -0,0 +1,28 @@
+package org.openstreetmap.josm.plugins.mapillary.history.commands;
+
+import java.util.List;
+
+import org.openstreetmap.josm.plugins.mapillary.MapillaryAbstractImage;
+
+/**
+ * Superclass for those commands that must be executed after creation.
+ *
+ * @author nokutu
+ *
+ */
+public abstract class MapillaryExecutableCommand extends MapillaryCommand {
+
+  /**
+   * Main constructor.
+   *
+   * @param images
+   */
+  public MapillaryExecutableCommand(List<MapillaryAbstractImage> images) {
+    super(images);
+  }
+
+  /**
+   * Executes the command.
+   */
+  public abstract void execute();
+}
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/JoinMode.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/JoinMode.java	(revision 31489)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/JoinMode.java	(revision 31490)
@@ -15,7 +15,7 @@
 import org.openstreetmap.josm.plugins.mapillary.MapillaryImportedImage;
 import org.openstreetmap.josm.plugins.mapillary.MapillaryLayer;
-import org.openstreetmap.josm.plugins.mapillary.commands.CommandJoin;
-import org.openstreetmap.josm.plugins.mapillary.commands.CommandUnjoin;
-import org.openstreetmap.josm.plugins.mapillary.commands.MapillaryRecord;
+import org.openstreetmap.josm.plugins.mapillary.history.MapillaryRecord;
+import org.openstreetmap.josm.plugins.mapillary.history.commands.CommandJoin;
+import org.openstreetmap.josm.plugins.mapillary.history.commands.CommandUnjoin;
 
 /**
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/SelectMode.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/SelectMode.java	(revision 31489)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/SelectMode.java	(revision 31490)
@@ -17,8 +17,8 @@
 import org.openstreetmap.josm.plugins.mapillary.MapillaryImage;
 import org.openstreetmap.josm.plugins.mapillary.MapillaryLayer;
-import org.openstreetmap.josm.plugins.mapillary.commands.CommandMoveImage;
-import org.openstreetmap.josm.plugins.mapillary.commands.CommandTurnImage;
-import org.openstreetmap.josm.plugins.mapillary.commands.MapillaryRecord;
 import org.openstreetmap.josm.plugins.mapillary.gui.MapillaryMainDialog;
+import org.openstreetmap.josm.plugins.mapillary.history.MapillaryRecord;
+import org.openstreetmap.josm.plugins.mapillary.history.commands.CommandMove;
+import org.openstreetmap.josm.plugins.mapillary.history.commands.CommandTurn;
 
 /**
@@ -134,5 +134,5 @@
       double from = this.data.getSelectedImage().getTempCa();
       double to = this.data.getSelectedImage().getCa();
-      this.record.addCommand(new CommandTurnImage(this.data.getMultiSelectedImages(), to
+      this.record.addCommand(new CommandTurn(this.data.getMultiSelectedImages(), to
           - from));
     } else if (this.data.getSelectedImage().getTempLatLon() != this.data
@@ -140,5 +140,5 @@
       LatLon from = this.data.getSelectedImage().getTempLatLon();
       LatLon to = this.data.getSelectedImage().getLatLon();
-      this.record.addCommand(new CommandMoveImage(this.data.getMultiSelectedImages(), to
+      this.record.addCommand(new CommandMove(this.data.getMultiSelectedImages(), to
           .getX() - from.getX(), to.getY() - from.getY()));
     }
Index: applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/commands/MapillaryRecordTest.java
===================================================================
--- applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/commands/MapillaryRecordTest.java	(revision 31489)
+++ applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/commands/MapillaryRecordTest.java	(revision 31490)
@@ -10,4 +10,8 @@
 import org.openstreetmap.josm.plugins.mapillary.MapillaryAbstractImage;
 import org.openstreetmap.josm.plugins.mapillary.MapillaryImage;
+import org.openstreetmap.josm.plugins.mapillary.history.MapillaryRecord;
+import org.openstreetmap.josm.plugins.mapillary.history.commands.CommandMove;
+import org.openstreetmap.josm.plugins.mapillary.history.commands.CommandTurn;
+import org.openstreetmap.josm.plugins.mapillary.history.commands.MapillaryCommand;
 
 /**
@@ -41,17 +45,17 @@
   @Test
   public void commandTest() {
-    MapillaryCommand cmd12 = new CommandMoveImage(
+    MapillaryCommand cmd12 = new CommandMove(
         Arrays.asList(new MapillaryAbstractImage[] { this.img1, this.img2 }),
         0.1, 0.1);
-    MapillaryCommand cmd23 = new CommandMoveImage(
+    MapillaryCommand cmd23 = new CommandMove(
         Arrays.asList(new MapillaryAbstractImage[] { this.img2, this.img3 }),
         0.1, 0.1);
-    MapillaryCommand cmd13 = new CommandMoveImage(
+    MapillaryCommand cmd13 = new CommandMove(
         Arrays.asList(new MapillaryAbstractImage[] { this.img1, this.img3 }),
         0.1, 0.1);
-    MapillaryCommand cmd1 = new CommandMoveImage(
+    MapillaryCommand cmd1 = new CommandMove(
         Arrays.asList(new MapillaryAbstractImage[] { this.img1 }),
         0.1, 0.1);
-    MapillaryCommand cmd31 = new CommandMoveImage(
+    MapillaryCommand cmd31 = new CommandMove(
         Arrays.asList(new MapillaryAbstractImage[] { this.img3, this.img1 }),
         0.2, 0.2);
@@ -98,8 +102,8 @@
   @Test
   public void commandMoveTest() {
-    CommandMoveImage cmd1 = new CommandMoveImage(
+    CommandMove cmd1 = new CommandMove(
         Arrays.asList(new MapillaryAbstractImage[] { this.img1, this.img2 }),
         0.1, 0.1);
-    CommandMoveImage cmd2 = new CommandMoveImage(
+    CommandMove cmd2 = new CommandMove(
         Arrays.asList(new MapillaryAbstractImage[] { this.img1, this.img2 }),
         0.1, 0.1);
@@ -132,8 +136,8 @@
   @Test
   public void commandTurnTest() {
-    CommandTurnImage cmd1 = new CommandTurnImage(
+    CommandTurn cmd1 = new CommandTurn(
         Arrays.asList(new MapillaryAbstractImage[] { this.img1, this.img2 }),
         0.2);
-    CommandTurnImage cmd2 = new CommandTurnImage(
+    CommandTurn cmd2 = new CommandTurn(
         Arrays.asList(new MapillaryAbstractImage[] { this.img1, this.img2 }),
         0.1);
