diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp
index 699d406..15d1874 100644
--- a/fastboot/fastboot.cpp
+++ b/fastboot/fastboot.cpp
@@ -1830,9 +1830,9 @@
     return size;
 }
 
-static void fb_perform_format(const std::string& partition, int skip_if_not_supported,
-                              const std::string& type_override, const std::string& size_override,
-                              const unsigned fs_options) {
+void fb_perform_format(const std::string& partition, int skip_if_not_supported,
+                       const std::string& type_override, const std::string& size_override,
+                       const unsigned fs_options) {
     std::string partition_type, partition_size;
 
     struct fastboot_buffer buf;
@@ -2026,7 +2026,6 @@
     android::base::InitLogging(argv, FastbootLogger, FastbootAborter);
     std::unique_ptr<FlashingPlan> fp = std::make_unique<FlashingPlan>();
 
-    unsigned fs_options = 0;
     int longindex;
     std::string slot_override;
     std::string next_active;
@@ -2080,7 +2079,7 @@
             } else if (name == "force") {
                 fp->force_flash = true;
             } else if (name == "fs-options") {
-                fs_options = ParseFsOption(optarg);
+                fp->fs_options = ParseFsOption(optarg);
             } else if (name == "header-version") {
                 g_boot_img_hdr.header_version = strtoul(optarg, nullptr, 0);
             } else if (name == "dtb") {
@@ -2250,7 +2249,7 @@
             std::string partition = next_arg(&args);
 
             auto format = [&](const std::string& partition) {
-                fb_perform_format(partition, 0, type_override, size_override, fs_options);
+                fb_perform_format(partition, 0, type_override, size_override, fp->fs_options);
             };
             do_for_partitions(partition, slot_override, format, true);
         } else if (command == "signature") {
@@ -2407,19 +2406,15 @@
             syntax_error("unknown command %s", command.c_str());
         }
     }
+
     if (fp->wants_wipe) {
         if (fp->force_flash) {
             CancelSnapshotIfNeeded();
         }
         std::vector<std::string> partitions = {"userdata", "cache", "metadata"};
         for (const auto& partition : partitions) {
-            std::string partition_type;
-            if (fb->GetVar("partition-type:" + partition, &partition_type) != fastboot::SUCCESS) {
-                continue;
-            }
-            if (partition_type.empty()) continue;
-            fb->Erase(partition);
-            fb_perform_format(partition, 1, partition_type, "", fs_options);
+            std::unique_ptr<WipeTask> wipe_task = std::make_unique<WipeTask>(fp.get(), partition);
+            wipe_task->Run();
         }
     }
     if (fp->wants_set_active) {
diff --git a/fastboot/fastboot.h b/fastboot/fastboot.h
index 2264ca3..ed33481 100644
--- a/fastboot/fastboot.h
+++ b/fastboot/fastboot.h
@@ -69,6 +69,7 @@
 using ImageEntry = std::pair<const Image*, std::string>;
 
 struct FlashingPlan {
+    unsigned fs_options = 0;
     // If the image uses the default slot, or the user specified "all", then
     // the paired string will be empty. If the image requests a specific slot
     // (for example, system_other) it is specified instead.
@@ -109,3 +110,6 @@
 
 bool is_retrofit_device();
 bool is_logical(const std::string& partition);
+void fb_perform_format(const std::string& partition, int skip_if_not_supported,
+                       const std::string& type_override, const std::string& size_override,
+                       const unsigned fs_options);
diff --git a/fastboot/task.cpp b/fastboot/task.cpp
index 6233c90..c70139b 100644
--- a/fastboot/task.cpp
+++ b/fastboot/task.cpp
@@ -143,8 +143,7 @@
     return std::make_unique<FlashSuperLayoutTask>(super_name, std::move(helper), std::move(s));
 }
 
-UpdateSuperTask::UpdateSuperTask(FlashingPlan* fp)
-    : fp_(fp) {}
+UpdateSuperTask::UpdateSuperTask(FlashingPlan* fp) : fp_(fp) {}
 
 void UpdateSuperTask::Run() {
     unique_fd fd = fp_->source->OpenFile("super_empty.img");
@@ -185,4 +184,16 @@
 
 void DeleteTask::Run() {
     fp_->fb->DeletePartition(pname_);
-}
\ No newline at end of file
+}
+
+WipeTask::WipeTask(FlashingPlan* fp, const std::string& pname) : fp_(fp), pname_(pname){};
+
+void WipeTask::Run() {
+    std::string partition_type;
+    if (fp_->fb->GetVar("partition-type:" + pname_, &partition_type) != fastboot::SUCCESS) {
+        return;
+    }
+    if (partition_type.empty()) return;
+    fp_->fb->Erase(pname_);
+    fb_perform_format(pname_, 1, partition_type, "", fp_->fs_options);
+}
diff --git a/fastboot/task.h b/fastboot/task.h
index 0af771e..149c34c 100644
--- a/fastboot/task.h
+++ b/fastboot/task.h
@@ -100,3 +100,13 @@
     const FlashingPlan* fp_;
     const std::string pname_;
 };
+
+class WipeTask : public Task {
+  public:
+    WipeTask(FlashingPlan* fp, const std::string& pname);
+    void Run() override;
+
+  private:
+    const FlashingPlan* fp_;
+    const std::string pname_;
+};
