diff --git a/src/main/java/com/googlesource/gerrit/plugins/refprotection/BackupBranch.java b/src/main/java/com/googlesource/gerrit/plugins/refprotection/BackupBranch.java
deleted file mode 100644
index dbed47a..0000000
--- a/src/main/java/com/googlesource/gerrit/plugins/refprotection/BackupBranch.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- *  The MIT License
- *
- *  Copyright 2015 Sony Mobile Communications AB. All rights reserved.
- *
- *  Permission is hereby granted, free of charge, to any person obtaining a copy
- *  of this software and associated documentation files (the "Software"), to deal
- *  in the Software without restriction, including without limitation the rights
- *  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- *  copies of the Software, and to permit persons to whom the Software is
- *  furnished to do so, subject to the following conditions:
- *
- *  The above copyright notice and this permission notice shall be included in
- *  all copies or substantial portions of the Software.
- *
- *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- *  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- *  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- *  THE SOFTWARE.
- */
-package com.googlesource.gerrit.plugins.refprotection;
-
-import static org.eclipse.jgit.lib.Constants.R_HEADS;
-import static org.eclipse.jgit.lib.Constants.R_REFS;
-import static org.eclipse.jgit.lib.Constants.R_TAGS;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-public class BackupBranch {
-  public static final String R_BACKUPS = R_REFS + "backups/";
-
-  public static String get(String branchName) {
-    if (branchName.startsWith(R_HEADS) || branchName.startsWith(R_TAGS)) {
-      return String.format("%s-%s",
-          R_BACKUPS + branchName.replaceFirst(R_REFS, ""),
-          new SimpleDateFormat("YYYYMMdd-HHmmss").format(new Date()));
-    }
-
-    return branchName;
-  }
-}
diff --git a/src/main/java/com/googlesource/gerrit/plugins/refprotection/BackupRef.java b/src/main/java/com/googlesource/gerrit/plugins/refprotection/BackupRef.java
new file mode 100644
index 0000000..b35e930
--- /dev/null
+++ b/src/main/java/com/googlesource/gerrit/plugins/refprotection/BackupRef.java
@@ -0,0 +1,86 @@
+/*
+ *  The MIT License
+ *
+ *  Copyright 2015 Sony Mobile Communications AB. All rights reserved.
+ *
+ *  Permission is hereby granted, free of charge, to any person obtaining a copy
+ *  of this software and associated documentation files (the "Software"), to deal
+ *  in the Software without restriction, including without limitation the rights
+ *  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ *  copies of the Software, and to permit persons to whom the Software is
+ *  furnished to do so, subject to the following conditions:
+ *
+ *  The above copyright notice and this permission notice shall be included in
+ *  all copies or substantial portions of the Software.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ *  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ *  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ *  THE SOFTWARE.
+ */
+package com.googlesource.gerrit.plugins.refprotection;
+
+import com.google.gerrit.extensions.events.GitReferenceUpdatedListener.Event;
+import com.google.gerrit.extensions.restapi.AuthException;
+import com.google.gerrit.extensions.restapi.BadRequestException;
+import com.google.gerrit.extensions.restapi.ResourceConflictException;
+import com.google.gerrit.server.project.CreateBranch;
+import com.google.gerrit.server.project.ProjectResource;
+import com.google.inject.Inject;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static org.eclipse.jgit.lib.Constants.R_HEADS;
+import static org.eclipse.jgit.lib.Constants.R_REFS;
+import static org.eclipse.jgit.lib.Constants.R_TAGS;
+
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+public class BackupRef {
+  public static final String R_BACKUPS = R_REFS + "backups/";
+  private static final Logger log =
+      LoggerFactory.getLogger(BackupRef.class);
+  private final CreateBranch.Factory createBranchFactory;
+
+  @Inject
+  BackupRef(CreateBranch.Factory createBranchFactory) {
+    this.createBranchFactory = createBranchFactory;
+  }
+
+  public void createBackup(Event event, ProjectResource project) {
+    String refName = event.getRefName();
+    String backupRef = get(refName);
+
+    // No-op if the backup branch name is same as the original
+    if (backupRef.equals(refName)) {
+      return;
+    }
+
+    CreateBranch.Input input = new CreateBranch.Input();
+    input.ref = backupRef;
+    input.revision = event.getOldObjectId();
+
+    try {
+      createBranchFactory.create(backupRef).apply(project, input);
+    } catch (BadRequestException | AuthException | ResourceConflictException
+        | IOException e) {
+      log.error(e.getMessage(), e);
+    }
+  }
+
+  static String get(String refName) {
+    if (refName.startsWith(R_HEADS) || refName.startsWith(R_TAGS)) {
+      return String.format("%s-%s",
+          R_BACKUPS + refName.replaceFirst(R_REFS, ""),
+          new SimpleDateFormat("YYYYMMdd-HHmmss").format(new Date()));
+    }
+
+    return refName;
+  }
+}
diff --git a/src/main/java/com/googlesource/gerrit/plugins/refprotection/RefUpdateListener.java b/src/main/java/com/googlesource/gerrit/plugins/refprotection/RefUpdateListener.java
index 09d9c94..6484b38 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/refprotection/RefUpdateListener.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/refprotection/RefUpdateListener.java
@@ -27,13 +27,9 @@
 import static org.eclipse.jgit.lib.Constants.R_TAGS;
 
 import com.google.gerrit.extensions.events.GitReferenceUpdatedListener;
-import com.google.gerrit.extensions.restapi.AuthException;
-import com.google.gerrit.extensions.restapi.BadRequestException;
-import com.google.gerrit.extensions.restapi.ResourceConflictException;
 import com.google.gerrit.reviewdb.client.Project;
 import com.google.gerrit.server.CurrentUser;
 import com.google.gerrit.server.git.GitRepositoryManager;
-import com.google.gerrit.server.project.CreateBranch;
 import com.google.gerrit.server.project.NoSuchProjectException;
 import com.google.gerrit.server.project.ProjectControl;
 import com.google.gerrit.server.project.ProjectResource;
@@ -53,20 +49,20 @@
 
   private static final Logger log =
       LoggerFactory.getLogger(RefUpdateListener.class);
-  private final CreateBranch.Factory createBranchFactory;
   private final ProjectControl.GenericFactory projectControl;
   private final CurrentUser user;
   private final GitRepositoryManager repoManager;
+  private final BackupRef backupRef;
 
   @Inject
-  RefUpdateListener(CreateBranch.Factory createBranchFactory,
-      ProjectControl.GenericFactory p,
+  RefUpdateListener(ProjectControl.GenericFactory p,
       CurrentUser user,
-      GitRepositoryManager repoManager) {
-    this.createBranchFactory = createBranchFactory;
+      GitRepositoryManager repoManager,
+      BackupRef backupRef) {
     this.projectControl = p;
     this.user = user;
     this.repoManager = repoManager;
+    this.backupRef = backupRef;
   }
 
   @Override
@@ -77,7 +73,7 @@
         ProjectResource project =
             new ProjectResource(projectControl.controlFor(nameKey, user));
         if (isRefDeleted(event) || isNonFastForwardUpdate(event, project)) {
-          createBackupBranch(event, project);
+          backupRef.createBackup(event, project);
         }
       } catch (NoSuchProjectException | IOException e) {
         log.error(e.getMessage(), e);
@@ -86,32 +82,6 @@
   }
 
   /**
-   * Create a backup branch for the given ref.
-   *
-   * @param event the Event
-   */
-  private void createBackupBranch(Event event, ProjectResource project) {
-    String branchName = event.getRefName();
-    String backupRef = BackupBranch.get(branchName);
-
-    // No-op if the backup branch name is same as the original
-    if (backupRef.equals(branchName)) {
-      return;
-    }
-
-    CreateBranch.Input input = new CreateBranch.Input();
-    input.ref = backupRef;
-    input.revision = event.getOldObjectId();
-
-    try {
-      createBranchFactory.create(backupRef).apply(project, input);
-    } catch (BadRequestException | AuthException | ResourceConflictException
-        | IOException e) {
-      log.error(e.getMessage(), e);
-    }
-  }
-
-  /**
    * Is the event on a relevant ref?
    *
    * @param event the Event
diff --git a/src/test/java/com/googlesource/gerrit/plugins/refprotection/BackupBranchNameTest.java b/src/test/java/com/googlesource/gerrit/plugins/refprotection/BackupBranchNameTest.java
deleted file mode 100644
index b2bc9a2..0000000
--- a/src/test/java/com/googlesource/gerrit/plugins/refprotection/BackupBranchNameTest.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package com.googlesource.gerrit.plugins.refprotection;
-
-import static com.google.common.truth.Truth.assertThat;
-
-import org.junit.Test;
-
-public class BackupBranchNameTest {
-
-  @Test
-  public void backupBranchNameForTag() throws Exception {
-    String name = BackupBranch.get("refs/tags/v1.0");
-    String expected_prefix = BackupBranch.R_BACKUPS + "tags/v1.0-";
-    assertThat(name).startsWith(expected_prefix);
-  }
-
-  @Test
-  public void backupBranchNameForBranch() throws Exception {
-    String name = BackupBranch.get("refs/heads/master");
-    String expected_prefix = BackupBranch.R_BACKUPS + "heads/master-";
-    assertThat(name).startsWith(expected_prefix);
-  }
-
-  @Test
-  public void backupBranchNameForUnsupportedNamespace() throws Exception {
-    String ref = "refs/changes/45/12345/1";
-    assertThat(BackupBranch.get(ref)).isEqualTo(ref);
-  }
-}
diff --git a/src/test/java/com/googlesource/gerrit/plugins/refprotection/BackupRefNameTest.java b/src/test/java/com/googlesource/gerrit/plugins/refprotection/BackupRefNameTest.java
new file mode 100644
index 0000000..0ad095f
--- /dev/null
+++ b/src/test/java/com/googlesource/gerrit/plugins/refprotection/BackupRefNameTest.java
@@ -0,0 +1,28 @@
+package com.googlesource.gerrit.plugins.refprotection;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import org.junit.Test;
+
+public class BackupRefNameTest {
+
+  @Test
+  public void backupRefNameForTag() throws Exception {
+    String name = BackupRef.get("refs/tags/v1.0");
+    String expected_prefix = BackupRef.R_BACKUPS + "tags/v1.0-";
+    assertThat(name).startsWith(expected_prefix);
+  }
+
+  @Test
+  public void backupRefNameForBranch() throws Exception {
+    String name = BackupRef.get("refs/heads/master");
+    String expected_prefix = BackupRef.R_BACKUPS + "heads/master-";
+    assertThat(name).startsWith(expected_prefix);
+  }
+
+  @Test
+  public void backupRefNameForUnsupportedNamespace() throws Exception {
+    String ref = "refs/changes/45/12345/1";
+    assertThat(BackupRef.get(ref)).isEqualTo(ref);
+  }
+}
