diff --git a/src/fru_device.cpp b/src/fru_device.cpp
index 446d5c4..1e668ba 100644
--- a/src/fru_device.cpp
+++ b/src/fru_device.cpp
@@ -1107,42 +1107,20 @@
 
     struct FruArea fruAreaParams
     {};
-    size_t fruDataIter = 0;
 
-    if (!findFruAreaLocationAndField(fruData, propertyName, fruAreaParams,
-                                     fruDataIter))
+    if (!findFruAreaLocationAndField(fruData, propertyName, fruAreaParams))
     {
         std::cerr << "findFruAreaLocationAndField failed \n";
         return false;
     }
 
-    ssize_t fieldLength = 0;
-
-    // Push post update fru field bytes to a vector
-    fieldLength = getFieldLength(fruData[fruAreaParams.updateFieldLoc]);
-    if (fieldLength < 0)
+    std::vector<uint8_t> restFRUAreaFieldsData;
+    if (!copyRestFRUArea(fruData, propertyName, fruAreaParams,
+                         restFRUAreaFieldsData))
     {
-        std::cerr << "Property " << propertyName << " not present \n";
+        std::cerr << "copyRestFRUArea failed \n";
         return false;
     }
-    fruDataIter += 1 + fieldLength;
-    size_t restFRUFieldsLoc = fruDataIter;
-    size_t endOfFieldsLoc = 0;
-    while ((fieldLength = getFieldLength(fruData[fruDataIter])) >= 0)
-    {
-        if (fruDataIter >= (fruAreaParams.start + fruAreaParams.size))
-        {
-            fruDataIter = fruAreaParams.start + fruAreaParams.size;
-            break;
-        }
-        fruDataIter += 1 + fieldLength;
-    }
-    endOfFieldsLoc = fruDataIter;
-
-    std::vector<uint8_t> restFRUAreaFieldsData;
-    std::copy_n(fruData.begin() + restFRUFieldsLoc,
-                endOfFieldsLoc - restFRUFieldsLoc + 1,
-                std::back_inserter(restFRUAreaFieldsData));
 
     // Push post update fru areas if any
     unsigned int nextFRUAreaLoc = 0;
@@ -1151,7 +1129,7 @@
     {
         unsigned int fruAreaLoc =
             fruData[getHeaderAreaFieldOffset(nextFRUArea)] * fruBlockSize;
-        if ((fruAreaLoc > endOfFieldsLoc) &&
+        if ((fruAreaLoc > fruAreaParams.restFieldsEnd) &&
             ((nextFRUAreaLoc == 0) || (fruAreaLoc < nextFRUAreaLoc)))
         {
             nextFRUAreaLoc = fruAreaLoc;
@@ -1200,10 +1178,13 @@
               fruData.begin() + fruAreaParams.updateFieldLoc);
 
     // Copy remaining data to main fru area - post updated fru field vector
-    restFRUFieldsLoc = fruAreaParams.updateFieldLoc + updatePropertyReqLen;
-    size_t fruAreaDataEnd = restFRUFieldsLoc + restFRUAreaFieldsData.size();
+    fruAreaParams.restFieldsLoc =
+        fruAreaParams.updateFieldLoc + updatePropertyReqLen;
+    size_t fruAreaDataEnd =
+        fruAreaParams.restFieldsLoc + restFRUAreaFieldsData.size();
+
     std::copy(restFRUAreaFieldsData.begin(), restFRUAreaFieldsData.end(),
-              fruData.begin() + restFRUFieldsLoc);
+              fruData.begin() + fruAreaParams.restFieldsLoc);
 
     // Update final fru with new fru area length and checksum
     unsigned int nextFRUAreaNewLoc = updateFRUAreaLenAndChecksum(
