diff --git a/src/main/java/com/googlesource/gerrit/plugins/depends/on/ChangeMessageStore.java b/src/main/java/com/googlesource/gerrit/plugins/depends/on/ChangeMessageStore.java
index 67f5040..c7fa832 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/depends/on/ChangeMessageStore.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/depends/on/ChangeMessageStore.java
@@ -158,6 +158,12 @@
   /** Create a comment on the change with a DependsOn for the deps. */
   public void store(PatchSet.Id patchSetId, Set<DependsOn> deps, String message)
       throws InvalidChangeOperationException, StorageException {
+    store(changeNotesFactory.createCheckedUsingIndexLookup(patchSetId.changeId()), deps, message);
+  }
+
+  /** Create a comment on the change with a DependsOn for the deps. */
+  public void store(ChangeNotes changeNotes, Set<DependsOn> deps, String message)
+      throws InvalidChangeOperationException, StorageException {
     StringBuilder comment = new StringBuilder();
     if (message != null) {
       comment.append(message + "\n\n");
@@ -165,10 +171,8 @@
     comment.append(Comment.getMessages(deps));
     ReviewInput review = new ReviewInput();
     review.message = Strings.emptyToNull(comment.toString());
-    ChangeNotes changeNotes =
-        changeNotesFactory.createCheckedUsingIndexLookup(patchSetId.changeId());
     ChangeResource changeResource = changeResourceFactory.create(changeNotes, currentUser);
-    PatchSet patchSet = changeNotes.load().getPatchSets().get(patchSetId);
+    PatchSet patchSet = changeNotes.getCurrentPatchSet();
     try {
       retryHelper
           .changeUpdate(
diff --git a/src/main/java/com/googlesource/gerrit/plugins/depends/on/CoreListener.java b/src/main/java/com/googlesource/gerrit/plugins/depends/on/CoreListener.java
index 9b66a07..74cfd25 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/depends/on/CoreListener.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/depends/on/CoreListener.java
@@ -50,10 +50,9 @@
           Optional<Id> sourceId = Change.Id.tryParse(change.cherryPickOfChange.toString());
           Optional<Id> destId = Change.Id.tryParse(Integer.toString(change.number));
           if (sourceId.isPresent() && destId.isPresent()) {
-            Change sourceChange =
-                changeNotesFactory.createCheckedUsingIndexLookup(sourceId.get()).getChange();
-            Change destChange =
-                changeNotesFactory.createCheckedUsingIndexLookup(destId.get()).getChange();
+            ChangeNotes sourceChange =
+                changeNotesFactory.createCheckedUsingIndexLookup(sourceId.get());
+            ChangeNotes destChange = changeNotesFactory.createCheckedUsingIndexLookup(destId.get());
             propagator.propagateFromSourceToDestination(sourceChange, destChange);
           }
         } catch (InvalidChangeOperationException | NoSuchChangeException e) {
diff --git a/src/main/java/com/googlesource/gerrit/plugins/depends/on/Propagator.java b/src/main/java/com/googlesource/gerrit/plugins/depends/on/Propagator.java
index 5047e8b..a6a241c 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/depends/on/Propagator.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/depends/on/Propagator.java
@@ -36,19 +36,19 @@
     this.changeNotesFactory = changeNotesFactory;
   }
 
-  public void propagateFromSourceToDestination(Change srcChange, Change destChange)
+  public void propagateFromSourceToDestination(ChangeNotes srcChange, ChangeNotes destChange)
       throws InvalidChangeOperationException, NoSuchChangeException {
 
-    Set<DependsOn> deps = changeMessageStore.load(srcChange.getId());
+    Set<DependsOn> deps = changeMessageStore.load(srcChange);
     if (!deps.isEmpty()) {
       Set<DependsOn> keyDeps = new HashSet<DependsOn>(deps.size());
       for (DependsOn dep : deps) {
         keyDeps.add(DependsOn.create(loadChangeKey(dep)));
       }
       changeMessageStore.store(
-          destChange.currentPatchSetId(),
+          destChange,
           keyDeps,
-          "Dependencies propagated from " + srcChange.currentPatchSetId());
+          "Dependencies propagated from " + srcChange.getChange().currentPatchSetId());
     }
   }
 
