diff --git a/neuralnetworks/1.0/vts/functional/GeneratedTestHarness.cpp b/neuralnetworks/1.0/vts/functional/GeneratedTestHarness.cpp
index db90ac2..4b8daec 100644
--- a/neuralnetworks/1.0/vts/functional/GeneratedTestHarness.cpp
+++ b/neuralnetworks/1.0/vts/functional/GeneratedTestHarness.cpp
@@ -42,6 +42,24 @@
 using ::generated_tests::Float32Operands;
 using ::generated_tests::Int32Operands;
 using ::generated_tests::Quant8Operands;
+using ::generated_tests::compare;
+
+template <typename ty>
+void copy_back_(MixedTyped* dst, const std::vector<RequestArgument>& ra, char* src) {
+    MixedTyped& test = *dst;
+    for_each(test, [&ra, src](int index, std::vector<ty>& m) {
+        ASSERT_EQ(m.size(), ra[index].location.length / sizeof(ty));
+        char* begin = src + ra[index].location.offset;
+        memcpy(m.data(), begin, ra[index].location.length);
+    });
+}
+
+void copy_back(MixedTyped* dst, const std::vector<RequestArgument>& ra, char* src) {
+    copy_back_<float>(dst, ra, src);
+    copy_back_<int32_t>(dst, ra, src);
+    copy_back_<uint8_t>(dst, ra, src);
+}
+
 // Top level driver for models and examples generated by test_generator.py
 // Test driver for those generated from ml/nn/runtime/test/spec
 void Execute(const sp<IDevice>& device, std::function<Model(void)> create_model,
@@ -97,9 +115,7 @@
         MixedTyped test;  // holding test results
 
         // Go through all outputs, initialize RequestArgument descriptors
-        resize_accordingly<float>(golden, test);
-        resize_accordingly<int32_t>(golden, test);
-        resize_accordingly<uint8_t>(golden, test);
+        resize_accordingly(golden, test);
         for_all(golden, [&outputs_info, &outputSize](int index, auto, auto s) {
             if (outputs_info.size() <= static_cast<size_t>(index)) outputs_info.resize(index + 1);
             RequestArgument arg = {
@@ -156,40 +172,16 @@
 
         // validate results
         outputMemory->read();
-#define COPY_BACK(ty)                                                              \
-    for_each<ty>(test, [&outputs_info, outputPtr](int index, std::vector<ty>& m) { \
-        RequestArgument& i = outputs_info[index];                                  \
-        ASSERT_EQ(m.size(), i.location.length / sizeof(ty));                       \
-        char* begin = outputPtr + i.location.offset;                               \
-        memcpy(m.data(), begin, i.location.length);                                \
-    });
-        COPY_BACK(float);
-        COPY_BACK(int32_t);
-        COPY_BACK(uint8_t);
-#undef COPY_BACK
+        copy_back(&test, outputs_info, outputPtr);
         outputMemory->commit();
         // Filter out don't cares
         MixedTyped filtered_golden;
         MixedTyped filtered_test;
-        filter<float>(golden, &filtered_golden, is_ignored);
-        filter<float>(test, &filtered_test, is_ignored);
-        filter<int32_t>(golden, &filtered_golden, is_ignored);
-        filter<int32_t>(test, &filtered_test, is_ignored);
-        filter<uint8_t>(golden, &filtered_golden, is_ignored);
-        filter<uint8_t>(test, &filtered_test, is_ignored);
+        filter(golden, &filtered_golden, is_ignored);
+        filter(test, &filtered_test, is_ignored);
 
         // We want "close-enough" results for float
-        for_each<float>(filtered_golden, [&filtered_test](int index, auto& golden_float) {
-            auto& test_float_operands = std::get<Float32Operands>(filtered_test);
-            auto& test_float = test_float_operands[index];
-            for (unsigned int i = 0; i < golden_float.size(); i++) {
-                SCOPED_TRACE(i);
-                EXPECT_NEAR(golden_float[i], test_float[i], 1.e-5);
-            }
-        });
-        EXPECT_EQ(std::get<Int32Operands>(filtered_golden), std::get<Int32Operands>(filtered_test));
-        EXPECT_EQ(std::get<Quant8Operands>(filtered_golden),
-                  std::get<Quant8Operands>(filtered_test));
+        compare(filtered_golden, filtered_test);
     }
 }
 
