diff --git a/redfish-core/include/error_messages.hpp b/redfish-core/include/error_messages.hpp
index 9658f0b..5e4fb5d 100644
--- a/redfish-core/include/error_messages.hpp
+++ b/redfish-core/include/error_messages.hpp
@@ -75,14 +75,13 @@
  * @param[in] arg3 Parameter of message that will replace %3 in its body.
  *
  * @returns Message ActionParameterValueFormatError formatted to JSON */
-nlohmann::json actionParameterValueFormatError(const std::string& arg1,
-                                               const std::string& arg2,
-                                               const std::string& arg3);
+nlohmann::json actionParameterValueFormatError(std::string_view arg1,
+                                               std::string_view arg2,
+                                               std::string_view arg3);
 
-void actionParameterValueFormatError(crow::Response& res,
-                                     const std::string& arg1,
-                                     const std::string& arg2,
-                                     const std::string& arg3);
+void actionParameterValueFormatError(crow::Response& res, std::string_view arg1,
+                                     std::string_view arg2,
+                                     std::string_view arg3);
 
 /**
  * @brief Formats InternalError message into JSON
@@ -117,11 +116,11 @@
  *
  * @returns Message ResourceAtUriUnauthorized formatted to JSON */
 nlohmann::json resourceAtUriUnauthorized(const boost::urls::url_view& arg1,
-                                         const std::string& arg2);
+                                         std::string_view arg2);
 
 void resourceAtUriUnauthorized(crow::Response& res,
                                const boost::urls::url_view& arg1,
-                               const std::string& arg2);
+                               std::string_view arg2);
 
 /**
  * @brief Formats ActionParameterUnknown message into JSON
@@ -132,11 +131,11 @@
  * @param[in] arg2 Parameter of message that will replace %2 in its body.
  *
  * @returns Message ActionParameterUnknown formatted to JSON */
-nlohmann::json actionParameterUnknown(const std::string& arg1,
-                                      const std::string& arg2);
+nlohmann::json actionParameterUnknown(std::string_view arg1,
+                                      std::string_view arg2);
 
-void actionParameterUnknown(crow::Response& res, const std::string& arg1,
-                            const std::string& arg2);
+void actionParameterUnknown(crow::Response& res, std::string_view arg1,
+                            std::string_view arg2);
 
 /**
  * @brief Formats ResourceCannotBeDeleted message into JSON
@@ -156,9 +155,9 @@
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
  *
  * @returns Message PropertyDuplicate formatted to JSON */
-nlohmann::json propertyDuplicate(const std::string& arg1);
+nlohmann::json propertyDuplicate(std::string_view arg1);
 
-void propertyDuplicate(crow::Response& res, const std::string& arg1);
+void propertyDuplicate(crow::Response& res, std::string_view arg1);
 
 /**
  * @brief Formats ServiceTemporarilyUnavailable message into JSON
@@ -168,10 +167,9 @@
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
  *
  * @returns Message ServiceTemporarilyUnavailable formatted to JSON */
-nlohmann::json serviceTemporarilyUnavailable(const std::string& arg1);
+nlohmann::json serviceTemporarilyUnavailable(std::string_view arg1);
 
-void serviceTemporarilyUnavailable(crow::Response& res,
-                                   const std::string& arg1);
+void serviceTemporarilyUnavailable(crow::Response& res, std::string_view arg1);
 
 /**
  * @brief Formats ResourceAlreadyExists message into JSON
@@ -183,12 +181,12 @@
  * @param[in] arg3 Parameter of message that will replace %3 in its body.
  *
  * @returns Message ResourceAlreadyExists formatted to JSON */
-nlohmann::json resourceAlreadyExists(const std::string& arg1,
-                                     const std::string& arg2,
-                                     const std::string& arg3);
+nlohmann::json resourceAlreadyExists(std::string_view arg1,
+                                     std::string_view arg2,
+                                     std::string_view arg3);
 
-void resourceAlreadyExists(crow::Response& res, const std::string& arg1,
-                           const std::string& arg2, const std::string& arg3);
+void resourceAlreadyExists(crow::Response& res, std::string_view arg1,
+                           std::string_view arg2, std::string_view arg3);
 
 /**
  * @brief Formats AccountForSessionNoLongerExists message into JSON
@@ -209,10 +207,10 @@
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
  *
  * @returns Message CreateFailedMissingReqProperties formatted to JSON */
-nlohmann::json createFailedMissingReqProperties(const std::string& arg1);
+nlohmann::json createFailedMissingReqProperties(std::string_view arg1);
 
 void createFailedMissingReqProperties(crow::Response& res,
-                                      const std::string& arg1);
+                                      std::string_view arg1);
 
 /**
  * @brief Formats PropertyValueFormatError message into JSON
@@ -223,11 +221,11 @@
  * @param[in] arg2 Parameter of message that will replace %2 in its body.
  *
  * @returns Message PropertyValueFormatError formatted to JSON */
-nlohmann::json propertyValueFormatError(const std::string& arg1,
-                                        const std::string& arg2);
+nlohmann::json propertyValueFormatError(std::string_view arg1,
+                                        std::string_view arg2);
 
-void propertyValueFormatError(crow::Response& res, const std::string& arg1,
-                              const std::string& arg2);
+void propertyValueFormatError(crow::Response& res, std::string_view arg1,
+                              std::string_view arg2);
 
 /**
  * @brief Formats PropertyValueNotInList message into JSON
@@ -238,11 +236,11 @@
  * @param[in] arg2 Parameter of message that will replace %2 in its body.
  *
  * @returns Message PropertyValueNotInList formatted to JSON */
-nlohmann::json propertyValueNotInList(const std::string& arg1,
-                                      const std::string& arg2);
+nlohmann::json propertyValueNotInList(std::string_view arg1,
+                                      std::string_view arg2);
 
-void propertyValueNotInList(crow::Response& res, const std::string& arg1,
-                            const std::string& arg2);
+void propertyValueNotInList(crow::Response& res, std::string_view arg1,
+                            std::string_view arg2);
 
 /**
  * @brief Formats ResourceAtUriInUnknownFormat message into JSON
@@ -265,9 +263,9 @@
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
  *
  * @returns Message ServiceDisabled formatted to JSON */
-nlohmann::json serviceDisabled(const std::string& arg1);
+nlohmann::json serviceDisabled(std::string_view arg1);
 
-void serviceDisabled(crow::Response& res, const std::string& arg1);
+void serviceDisabled(crow::Response& res, std::string_view arg1);
 
 /**
  * @brief Formats ServiceInUnknownState message into JSON
@@ -300,11 +298,11 @@
  * @param[in] arg2 Parameter of message that will replace %2 in its body.
  *
  * @returns Message ActionParameterMissing formatted to JSON */
-nlohmann::json actionParameterMissing(const std::string& arg1,
-                                      const std::string& arg2);
+nlohmann::json actionParameterMissing(std::string_view arg1,
+                                      std::string_view arg2);
 
-void actionParameterMissing(crow::Response& res, const std::string& arg1,
-                            const std::string& arg2);
+void actionParameterMissing(crow::Response& res, std::string_view arg1,
+                            std::string_view arg2);
 
 /**
  * @brief Formats StringValueTooLong message into JSON
@@ -314,9 +312,9 @@
  * @param[in] arg2 Parameter of message that will replace %2 in its body.
  *
  * @returns Message StringValueTooLong formatted to JSON */
-nlohmann::json stringValueTooLong(const std::string& arg1, int arg2);
+nlohmann::json stringValueTooLong(std::string_view arg1, int arg2);
 
-void stringValueTooLong(crow::Response& res, const std::string& arg1, int arg2);
+void stringValueTooLong(crow::Response& res, std::string_view arg1, int arg2);
 
 /**
  * @brief Formats SessionTerminated message into JSON
@@ -347,11 +345,11 @@
  * @param[in] arg2 Parameter of message that will replace %2 in its body.
  *
  * @returns Message ResourceTypeIncompatible formatted to JSON */
-nlohmann::json resourceTypeIncompatible(const std::string& arg1,
-                                        const std::string& arg2);
+nlohmann::json resourceTypeIncompatible(std::string_view arg1,
+                                        std::string_view arg2);
 
-void resourceTypeIncompatible(crow::Response& res, const std::string& arg1,
-                              const std::string& arg2);
+void resourceTypeIncompatible(crow::Response& res, std::string_view arg1,
+                              std::string_view arg2);
 
 /**
  * @brief Formats ResetRequired message into JSON
@@ -363,10 +361,10 @@
  *
  * @returns Message ResetRequired formatted to JSON */
 nlohmann::json resetRequired(const boost::urls::url_view& arg1,
-                             const std::string& arg2);
+                             std::string_view arg2);
 
 void resetRequired(crow::Response& res, const boost::urls::url_view& arg1,
-                   const std::string& arg2);
+                   std::string_view arg2);
 
 /**
  * @brief Formats ChassisPowerStateOnRequired message into JSON
@@ -376,9 +374,9 @@
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
  *
  * @returns Message ChassisPowerStateOnRequired formatted to JSON */
-nlohmann::json chassisPowerStateOnRequired(const std::string& arg1);
+nlohmann::json chassisPowerStateOnRequired(std::string_view arg1);
 
-void chassisPowerStateOnRequired(crow::Response& res, const std::string& arg1);
+void chassisPowerStateOnRequired(crow::Response& res, std::string_view arg1);
 
 /**
  * @brief Formats ChassisPowerStateOffRequired message into JSON
@@ -388,9 +386,9 @@
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
  *
  * @returns Message ChassisPowerStateOffRequired formatted to JSON */
-nlohmann::json chassisPowerStateOffRequired(const std::string& arg1);
+nlohmann::json chassisPowerStateOffRequired(std::string_view arg1);
 
-void chassisPowerStateOffRequired(crow::Response& res, const std::string& arg1);
+void chassisPowerStateOffRequired(crow::Response& res, std::string_view arg1);
 
 /**
  * @brief Formats PropertyValueConflict message into JSON
@@ -401,11 +399,11 @@
  * @param[in] arg2 Parameter of message that will replace %2 in its body.
  *
  * @returns Message PropertyValueConflict formatted to JSON */
-nlohmann::json propertyValueConflict(const std::string& arg1,
-                                     const std::string& arg2);
+nlohmann::json propertyValueConflict(std::string_view arg1,
+                                     std::string_view arg2);
 
-void propertyValueConflict(crow::Response& res, const std::string& arg1,
-                           const std::string& arg2);
+void propertyValueConflict(crow::Response& res, std::string_view arg1,
+                           std::string_view arg2);
 
 /**
  * @brief Formats PropertyValueIncorrect message into JSON
@@ -417,11 +415,11 @@
  * @param[in] arg2 Parameter of message that will replace %2 in its body.
  *
  * @returns Message PropertyValueIncorrect formatted to JSON */
-nlohmann::json propertyValueIncorrect(const std::string& arg1,
-                                      const std::string& arg2);
+nlohmann::json propertyValueIncorrect(std::string_view arg1,
+                                      std::string_view arg2);
 
-void propertyValueIncorrect(crow::Response& res, const std::string& arg1,
-                            const std::string& arg2);
+void propertyValueIncorrect(crow::Response& res, std::string_view arg1,
+                            std::string_view arg2);
 
 /**
  * @brief Formats ResourceCreationConflict message into JSON
@@ -431,10 +429,9 @@
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
  *
  * @returns Message ResourceCreationConflict formatted to JSON */
-nlohmann::json resourceCreationConflict(const boost::urls::url_view& arg1);
+nlohmann::json resourceCreationConflict(std::string_view arg1);
 
-void resourceCreationConflict(crow::Response& res,
-                              const boost::urls::url_view& arg1);
+void resourceCreationConflict(crow::Response& res, std::string_view arg1);
 
 /**
  * @brief Formats MaximumErrorsExceeded message into JSON
@@ -499,11 +496,11 @@
  * @param[in] arg2 Parameter of message that will replace %2 in its body.
  *
  * @returns Message PropertyValueTypeError formatted to JSON */
-nlohmann::json propertyValueTypeError(const std::string& arg1,
-                                      const std::string& arg2);
+nlohmann::json propertyValueTypeError(std::string_view arg1,
+                                      std::string_view arg2);
 
-void propertyValueTypeError(crow::Response& res, const std::string& arg1,
-                            const std::string& arg2);
+void propertyValueTypeError(crow::Response& res, std::string_view arg1,
+                            std::string_view arg2);
 
 /**
  * @brief Formats ResourceNotFound message into JSON
@@ -514,11 +511,10 @@
  * @param[in] arg2 Parameter of message that will replace %2 in its body.
  *
  * @returns Message ResourceNotFound formatted to JSON */
-nlohmann::json resourceNotFound(const std::string& arg1,
-                                const std::string& arg2);
+nlohmann::json resourceNotFound(std::string_view arg1, std::string_view arg2);
 
-void resourceNotFound(crow::Response& res, const std::string& arg1,
-                      const std::string& arg2);
+void resourceNotFound(crow::Response& res, std::string_view arg1,
+                      std::string_view arg2);
 
 /**
  * @brief Formats CouldNotEstablishConnection message into JSON
@@ -541,9 +537,9 @@
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
  *
  * @returns Message PropertyNotWritable formatted to JSON */
-nlohmann::json propertyNotWritable(const std::string& arg1);
+nlohmann::json propertyNotWritable(std::string_view arg1);
 
-void propertyNotWritable(crow::Response& res, const std::string& arg1);
+void propertyNotWritable(crow::Response& res, std::string_view arg1);
 
 /**
  * @brief Formats QueryParameterValueTypeError message into JSON
@@ -554,11 +550,11 @@
  * @param[in] arg2 Parameter of message that will replace %2 in its body.
  *
  * @returns Message QueryParameterValueTypeError formatted to JSON */
-nlohmann::json queryParameterValueTypeError(const std::string& arg1,
-                                            const std::string& arg2);
+nlohmann::json queryParameterValueTypeError(std::string_view arg1,
+                                            std::string_view arg2);
 
-void queryParameterValueTypeError(crow::Response& res, const std::string& arg1,
-                                  const std::string& arg2);
+void queryParameterValueTypeError(crow::Response& res, std::string_view arg1,
+                                  std::string_view arg2);
 
 /**
  * @brief Formats ServiceShuttingDown message into JSON
@@ -580,11 +576,11 @@
  * @param[in] arg2 Parameter of message that will replace %2 in its body.
  *
  * @returns Message ActionParameterDuplicate formatted to JSON */
-nlohmann::json actionParameterDuplicate(const std::string& arg1,
-                                        const std::string& arg2);
+nlohmann::json actionParameterDuplicate(std::string_view arg1,
+                                        std::string_view arg2);
 
-void actionParameterDuplicate(crow::Response& res, const std::string& arg1,
-                              const std::string& arg2);
+void actionParameterDuplicate(crow::Response& res, std::string_view arg1,
+                              std::string_view arg2);
 
 /**
  * @brief Formats ActionParameterNotSupported message into JSON
@@ -595,11 +591,11 @@
  * @param[in] arg2 Parameter of message that will replace %2 in its body.
  *
  * @returns Message ActionParameterNotSupported formatted to JSON */
-nlohmann::json actionParameterNotSupported(const std::string& arg1,
-                                           const std::string& arg2);
+nlohmann::json actionParameterNotSupported(std::string_view arg1,
+                                           std::string_view arg2);
 
-void actionParameterNotSupported(crow::Response& res, const std::string& arg1,
-                                 const std::string& arg2);
+void actionParameterNotSupported(crow::Response& res, std::string_view arg1,
+                                 std::string_view arg2);
 
 /**
  * @brief Formats SourceDoesNotSupportProtocol message into JSON
@@ -611,11 +607,11 @@
  *
  * @returns Message SourceDoesNotSupportProtocol formatted to JSON */
 nlohmann::json sourceDoesNotSupportProtocol(const boost::urls::url_view& arg1,
-                                            const std::string& arg2);
+                                            std::string_view arg2);
 
 void sourceDoesNotSupportProtocol(crow::Response& res,
                                   const boost::urls::url_view& arg1,
-                                  const std::string& arg2);
+                                  std::string_view arg2);
 
 /**
  * @brief Formats AccountRemoved message into JSON
@@ -635,9 +631,9 @@
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
  *
  * @returns Message AccessDenied formatted to JSON */
-nlohmann::json accessDenied(const boost::urls::url_view& arg1);
+nlohmann::json accessDenied(std::string_view arg1);
 
-void accessDenied(crow::Response& res, const boost::urls::url_view& arg1);
+void accessDenied(crow::Response& res, std::string_view arg1);
 
 /**
  * @brief Formats QueryNotSupported message into JSON
@@ -710,9 +706,9 @@
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
  *
  * @returns Message PropertyUnknown formatted to JSON */
-nlohmann::json propertyUnknown(const std::string& arg1);
+nlohmann::json propertyUnknown(std::string_view arg1);
 
-void propertyUnknown(crow::Response& res, const std::string& arg1);
+void propertyUnknown(crow::Response& res, std::string_view arg1);
 
 /**
  * @brief Formats NoValidSession message into JSON
@@ -757,13 +753,13 @@
  * @param[in] arg3 Parameter of message that will replace %3 in its body.
  *
  * @returns Message ActionParameterValueTypeError formatted to JSON */
-nlohmann::json actionParameterValueTypeError(const std::string& arg1,
-                                             const std::string& arg2,
-                                             const std::string& arg3);
+nlohmann::json actionParameterValueTypeError(std::string_view arg1,
+                                             std::string_view arg2,
+                                             std::string_view arg3);
 
-void actionParameterValueTypeError(crow::Response& res, const std::string& arg1,
-                                   const std::string& arg2,
-                                   const std::string& arg3);
+void actionParameterValueTypeError(crow::Response& res, std::string_view arg1,
+                                   std::string_view arg2,
+                                   std::string_view arg3);
 
 /**
  * @brief Formats SessionLimitExceeded message into JSON
@@ -783,9 +779,9 @@
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
  *
  * @returns Message ActionNotSupported formatted to JSON */
-nlohmann::json actionNotSupported(const std::string& arg1);
+nlohmann::json actionNotSupported(std::string_view arg1);
 
-void actionNotSupported(crow::Response& res, const std::string& arg1);
+void actionNotSupported(crow::Response& res, std::string_view arg1);
 
 /**
  * @brief Formats InvalidIndex message into JSON
@@ -861,11 +857,11 @@
  * @param[in] arg2 Parameter of message that will replace %2 in its body.
  *
  * @returns Message PropertyValueModified formatted to JSON */
-nlohmann::json propertyValueModified(const std::string& arg1,
-                                     const std::string& arg2);
+nlohmann::json propertyValueModified(std::string_view arg1,
+                                     std::string_view arg2);
 
-void propertyValueModified(crow::Response& res, const std::string& arg1,
-                           const std::string& arg2);
+void propertyValueModified(crow::Response& res, std::string_view arg1,
+                           std::string_view arg2);
 
 /**
  * @brief Formats AccountNotModified message into JSON
@@ -887,12 +883,11 @@
  *
  * @returns Message QueryParameterValueFormatError formatted to JSON */
 
-nlohmann::json queryParameterValueFormatError(const std::string& arg1,
-                                              const std::string& arg2);
+nlohmann::json queryParameterValueFormatError(std::string_view arg1,
+                                              std::string_view arg2);
 
-void queryParameterValueFormatError(crow::Response& res,
-                                    const std::string& arg1,
-                                    const std::string& arg2);
+void queryParameterValueFormatError(crow::Response& res, std::string_view arg1,
+                                    std::string_view arg2);
 
 /**
  * @brief Formats PropertyMissing message into JSON
@@ -902,9 +897,9 @@
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
  *
  * @returns Message PropertyMissing formatted to JSON */
-nlohmann::json propertyMissing(const std::string& arg1);
+nlohmann::json propertyMissing(std::string_view arg1);
 
-void propertyMissing(crow::Response& res, const std::string& arg1);
+void propertyMissing(crow::Response& res, std::string_view arg1);
 
 /**
  * @brief Formats ResourceExhaustion message into JSON
@@ -914,9 +909,9 @@
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
  *
  * @returns Message ResourceExhaustion formatted to JSON */
-nlohmann::json resourceExhaustion(const std::string& arg1);
+nlohmann::json resourceExhaustion(std::string_view arg1);
 
-void resourceExhaustion(crow::Response& res, const std::string& arg1);
+void resourceExhaustion(crow::Response& res, std::string_view arg1);
 
 /**
  * @brief Formats AccountModified message into JSON
@@ -938,12 +933,12 @@
  * @param[in] arg3 Parameter of message that will replace %3 in its body.
  *
  * @returns Message QueryParameterOutOfRange formatted to JSON */
-nlohmann::json queryParameterOutOfRange(const std::string& arg1,
-                                        const std::string& arg2,
-                                        const std::string& arg3);
+nlohmann::json queryParameterOutOfRange(std::string_view arg1,
+                                        std::string_view arg2,
+                                        std::string_view arg3);
 
-void queryParameterOutOfRange(crow::Response& res, const std::string& arg1,
-                              const std::string& arg2, const std::string& arg3);
+void queryParameterOutOfRange(crow::Response& res, std::string_view arg1,
+                              std::string_view arg2, std::string_view arg3);
 
 /**
  * @brief Formats PasswordChangeRequired message into JSON
@@ -967,10 +962,10 @@
  * @param[in] arg2 Parameter of message that will replace %2 in its body.
  *
  * @returns Message InvalidUpload formatted to JSON */
-nlohmann::json invalidUpload(const std::string& arg1, const std::string& arg2);
+nlohmann::json invalidUpload(std::string_view arg1, std::string_view arg2);
 
-void invalidUpload(crow::Response& res, const std::string& arg1,
-                   const std::string& arg2);
+void invalidUpload(crow::Response& res, std::string_view arg1,
+                   std::string_view arg2);
 
 } // namespace messages
 
diff --git a/redfish-core/lib/managers.hpp b/redfish-core/lib/managers.hpp
index a5e8c23..acaa40a 100644
--- a/redfish-core/lib/managers.hpp
+++ b/redfish-core/lib/managers.hpp
@@ -682,8 +682,7 @@
     if (config.empty())
     {
         BMCWEB_LOG_ERROR << "Empty Zones";
-        messages::propertyValueFormatError(response->res,
-                                           nlohmann::json::array(), "Zones");
+        messages::propertyValueFormatError(response->res, "[]", "Zones");
         return false;
     }
     for (auto& odata : config)
@@ -1601,8 +1600,8 @@
                 if (createNewObject && it.value() == nullptr)
                 {
                     // can't delete a non-existent object
-                    messages::propertyValueNotInList(response->res, it.value(),
-                                                     name);
+                    messages::propertyValueNotInList(response->res,
+                                                     it.value().dump(), name);
                     continue;
                 }
 
diff --git a/redfish-core/lib/metric_report_definition.hpp b/redfish-core/lib/metric_report_definition.hpp
index 4e9d78a..ab7c88b 100644
--- a/redfish-core/lib/metric_report_definition.hpp
+++ b/redfish-core/lib/metric_report_definition.hpp
@@ -316,8 +316,9 @@
                     {
                         metricProperties.emplace_back(uri);
                     }
-                    messages::propertyValueIncorrect(
-                        aResp->res, metricProperties, "MetricProperties");
+                    messages::propertyValueIncorrect(aResp->res,
+                                                     metricProperties.dump(),
+                                                     "MetricProperties");
                     return;
                 }
                 if (ec)
diff --git a/redfish-core/src/error_messages.cpp b/redfish-core/src/error_messages.cpp
index fafbf21..1897f29 100644
--- a/redfish-core/src/error_messages.cpp
+++ b/redfish-core/src/error_messages.cpp
@@ -22,6 +22,8 @@
 #include <logging.hpp>
 #include <nlohmann/json.hpp>
 
+#include <array>
+
 namespace redfish
 {
 
@@ -89,18 +91,20 @@
 
 static void addMessageToJson(nlohmann::json& target,
                              const nlohmann::json& message,
-                             const std::string& fieldPath)
+                             std::string_view fieldPath)
 {
-    std::string extendedInfo(fieldPath + messages::messageAnnotation);
+    std::string extendedInfo(fieldPath);
+    extendedInfo += messages::messageAnnotation;
 
-    if (!target[extendedInfo].is_array())
+    nlohmann::json& field = target[extendedInfo];
+    if (!field.is_array())
     {
         // Force object to be an array
-        target[extendedInfo] = nlohmann::json::array();
+        field = nlohmann::json::array();
     }
 
     // Object exists and it is an array so we can just push in the message
-    target[extendedInfo].push_back(message);
+    field.push_back(message);
 }
 
 nlohmann::json getLog(redfish::message_registries::base::Index name,
@@ -198,20 +202,18 @@
  * See header file for more information
  * @endinternal
  */
-nlohmann::json actionParameterValueFormatError(const std::string& arg1,
-                                               const std::string& arg2,
-                                               const std::string& arg3)
+nlohmann::json actionParameterValueFormatError(std::string_view arg1,
+                                               std::string_view arg2,
+                                               std::string_view arg3)
 {
-    std::array<std::string_view, 3> args{arg1, arg2, arg3};
     return getLog(redfish::message_registries::base::Index::
                       actionParameterValueFormatError,
-                  args);
+                  std::to_array({arg1, arg2, arg3}));
 }
 
-void actionParameterValueFormatError(crow::Response& res,
-                                     const std::string& arg1,
-                                     const std::string& arg2,
-                                     const std::string& arg3)
+void actionParameterValueFormatError(crow::Response& res, std::string_view arg1,
+                                     std::string_view arg2,
+                                     std::string_view arg3)
 {
     res.result(boost::beast::http::status::bad_request);
     addMessageToErrorJson(res.jsonValue,
@@ -266,18 +268,16 @@
  * @endinternal
  */
 nlohmann::json resourceAtUriUnauthorized(const boost::urls::url_view& arg1,
-                                         const std::string& arg2)
+                                         std::string_view arg2)
 {
-    std::array<std::string_view, 2> args{
-        std::string_view{arg1.data(), arg1.size()}, arg2};
     return getLog(
         redfish::message_registries::base::Index::resourceAtUriUnauthorized,
-        args);
+        std::to_array({std::string_view{arg1.data(), arg1.size()}, arg2}));
 }
 
 void resourceAtUriUnauthorized(crow::Response& res,
                                const boost::urls::url_view& arg1,
-                               const std::string& arg2)
+                               std::string_view arg2)
 {
     res.result(boost::beast::http::status::unauthorized);
     addMessageToErrorJson(res.jsonValue, resourceAtUriUnauthorized(arg1, arg2));
@@ -290,16 +290,16 @@
  * See header file for more information
  * @endinternal
  */
-nlohmann::json actionParameterUnknown(const std::string& arg1,
-                                      const std::string& arg2)
+nlohmann::json actionParameterUnknown(std::string_view arg1,
+                                      std::string_view arg2)
 {
-    std::array<std::string_view, 3> args{arg1, arg2};
     return getLog(
-        redfish::message_registries::base::Index::actionParameterUnknown, args);
+        redfish::message_registries::base::Index::actionParameterUnknown,
+        std::to_array({arg1, arg2}));
 }
 
-void actionParameterUnknown(crow::Response& res, const std::string& arg1,
-                            const std::string& arg2)
+void actionParameterUnknown(crow::Response& res, std::string_view arg1,
+                            std::string_view arg2)
 {
     res.result(boost::beast::http::status::bad_request);
     addMessageToErrorJson(res.jsonValue, actionParameterUnknown(arg1, arg2));
@@ -331,14 +331,13 @@
  * See header file for more information
  * @endinternal
  */
-nlohmann::json propertyDuplicate(const std::string& arg1)
+nlohmann::json propertyDuplicate(std::string_view arg1)
 {
-    std::array<std::string_view, 1> args{arg1};
     return getLog(redfish::message_registries::base::Index::propertyDuplicate,
-                  args);
+                  std::to_array({arg1}));
 }
 
-void propertyDuplicate(crow::Response& res, const std::string& arg1)
+void propertyDuplicate(crow::Response& res, std::string_view arg1)
 {
     res.result(boost::beast::http::status::bad_request);
     addMessageToJson(res.jsonValue, propertyDuplicate(arg1), arg1);
@@ -351,15 +350,14 @@
  * See header file for more information
  * @endinternal
  */
-nlohmann::json serviceTemporarilyUnavailable(const std::string& arg1)
+nlohmann::json serviceTemporarilyUnavailable(std::string_view arg1)
 {
-    std::array<std::string_view, 1> args{arg1};
     return getLog(
         redfish::message_registries::base::Index::serviceTemporarilyUnavailable,
-        args);
+        std::to_array({arg1}));
 }
 
-void serviceTemporarilyUnavailable(crow::Response& res, const std::string& arg1)
+void serviceTemporarilyUnavailable(crow::Response& res, std::string_view arg1)
 {
     res.addHeader("Retry-After", arg1);
     res.result(boost::beast::http::status::service_unavailable);
@@ -373,17 +371,17 @@
  * See header file for more information
  * @endinternal
  */
-nlohmann::json resourceAlreadyExists(const std::string& arg1,
-                                     const std::string& arg2,
-                                     const std::string& arg3)
+nlohmann::json resourceAlreadyExists(std::string_view arg1,
+                                     std::string_view arg2,
+                                     std::string_view arg3)
 {
-    std::array<std::string_view, 3> args{arg1, arg2, arg3};
     return getLog(
-        redfish::message_registries::base::Index::resourceAlreadyExists, args);
+        redfish::message_registries::base::Index::resourceAlreadyExists,
+        std::to_array({arg1, arg2, arg3}));
 }
 
-void resourceAlreadyExists(crow::Response& res, const std::string& arg1,
-                           const std::string& arg2, const std::string& arg3)
+void resourceAlreadyExists(crow::Response& res, std::string_view arg1,
+                           std::string_view arg2, std::string_view arg3)
 {
     res.result(boost::beast::http::status::bad_request);
     addMessageToJson(res.jsonValue, resourceAlreadyExists(arg1, arg2, arg3),
@@ -417,16 +415,15 @@
  * See header file for more information
  * @endinternal
  */
-nlohmann::json createFailedMissingReqProperties(const std::string& arg1)
+nlohmann::json createFailedMissingReqProperties(std::string_view arg1)
 {
-    std::array<std::string_view, 2> args{arg1};
     return getLog(redfish::message_registries::base::Index::
                       createFailedMissingReqProperties,
-                  args);
+                  std::to_array({arg1}));
 }
 
 void createFailedMissingReqProperties(crow::Response& res,
-                                      const std::string& arg1)
+                                      std::string_view arg1)
 {
     res.result(boost::beast::http::status::bad_request);
     addMessageToJson(res.jsonValue, createFailedMissingReqProperties(arg1),
@@ -441,17 +438,16 @@
  * See header file for more information
  * @endinternal
  */
-nlohmann::json propertyValueFormatError(const std::string& arg1,
-                                        const std::string& arg2)
+nlohmann::json propertyValueFormatError(std::string_view arg1,
+                                        std::string_view arg2)
 {
-    std::array<std::string_view, 2> args{arg1, arg2};
     return getLog(
         redfish::message_registries::base::Index::propertyValueFormatError,
-        args);
+        std::to_array({arg1, arg2}));
 }
 
-void propertyValueFormatError(crow::Response& res, const std::string& arg1,
-                              const std::string& arg2)
+void propertyValueFormatError(crow::Response& res, std::string_view arg1,
+                              std::string_view arg2)
 {
     res.result(boost::beast::http::status::bad_request);
     addMessageToJson(res.jsonValue, propertyValueFormatError(arg1, arg2), arg2);
@@ -465,16 +461,16 @@
  * See header file for more information
  * @endinternal
  */
-nlohmann::json propertyValueNotInList(const std::string& arg1,
-                                      const std::string& arg2)
+nlohmann::json propertyValueNotInList(std::string_view arg1,
+                                      std::string_view arg2)
 {
-    std::array<std::string_view, 2> args{arg1, arg2};
     return getLog(
-        redfish::message_registries::base::Index::propertyValueNotInList, args);
+        redfish::message_registries::base::Index::propertyValueNotInList,
+        std::to_array({arg1, arg2}));
 }
 
-void propertyValueNotInList(crow::Response& res, const std::string& arg1,
-                            const std::string& arg2)
+void propertyValueNotInList(crow::Response& res, std::string_view arg1,
+                            std::string_view arg2)
 {
     res.result(boost::beast::http::status::bad_request);
     addMessageToJson(res.jsonValue, propertyValueNotInList(arg1, arg2), arg2);
@@ -489,11 +485,10 @@
  */
 nlohmann::json resourceAtUriInUnknownFormat(const boost::urls::url_view& arg1)
 {
-    std::array<std::string_view, 1> args{
-        std::string_view{arg1.data(), arg1.size()}};
+    std::string_view arg1str{arg1.data(), arg1.size()};
     return getLog(
         redfish::message_registries::base::Index::resourceAtUriInUnknownFormat,
-        args);
+        std::to_array({arg1str}));
 }
 
 void resourceAtUriInUnknownFormat(crow::Response& res,
@@ -510,14 +505,13 @@
  * See header file for more information
  * @endinternal
  */
-nlohmann::json serviceDisabled(const std::string& arg1)
+nlohmann::json serviceDisabled(std::string_view arg1)
 {
-    std::array<std::string_view, 1> args{arg1};
     return getLog(redfish::message_registries::base::Index::serviceDisabled,
-                  args);
+                  std::to_array({arg1}));
 }
 
-void serviceDisabled(crow::Response& res, const std::string& arg1)
+void serviceDisabled(crow::Response& res, std::string_view arg1)
 {
     res.result(boost::beast::http::status::service_unavailable);
     addMessageToErrorJson(res.jsonValue, serviceDisabled(arg1));
@@ -569,16 +563,16 @@
  * See header file for more information
  * @endinternal
  */
-nlohmann::json actionParameterMissing(const std::string& arg1,
-                                      const std::string& arg2)
+nlohmann::json actionParameterMissing(std::string_view arg1,
+                                      std::string_view arg2)
 {
-    std::array<std::string_view, 2> args{arg1, arg2};
     return getLog(
-        redfish::message_registries::base::Index::actionParameterMissing, args);
+        redfish::message_registries::base::Index::actionParameterMissing,
+        std::to_array({arg1, arg2}));
 }
 
-void actionParameterMissing(crow::Response& res, const std::string& arg1,
-                            const std::string& arg2)
+void actionParameterMissing(crow::Response& res, std::string_view arg1,
+                            std::string_view arg2)
 {
     res.result(boost::beast::http::status::bad_request);
     addMessageToErrorJson(res.jsonValue, actionParameterMissing(arg1, arg2));
@@ -591,15 +585,14 @@
  * See header file for more information
  * @endinternal
  */
-nlohmann::json stringValueTooLong(const std::string& arg1, int arg2)
+nlohmann::json stringValueTooLong(std::string_view arg1, int arg2)
 {
     std::string arg2String = std::to_string(arg2);
-    std::array<std::string_view, 2> args{arg1, arg2String};
     return getLog(redfish::message_registries::base::Index::stringValueTooLong,
-                  args);
+                  std::to_array({arg1, std::string_view(arg2String)}));
 }
 
-void stringValueTooLong(crow::Response& res, const std::string& arg1, int arg2)
+void stringValueTooLong(crow::Response& res, std::string_view arg1, int arg2)
 {
     res.result(boost::beast::http::status::bad_request);
     addMessageToErrorJson(res.jsonValue, stringValueTooLong(arg1, arg2));
@@ -650,17 +643,16 @@
  * See header file for more information
  * @endinternal
  */
-nlohmann::json resourceTypeIncompatible(const std::string& arg1,
-                                        const std::string& arg2)
+nlohmann::json resourceTypeIncompatible(std::string_view arg1,
+                                        std::string_view arg2)
 {
-    std::array<std::string_view, 2> args{arg1, arg2};
     return getLog(
         redfish::message_registries::base::Index::resourceTypeIncompatible,
-        args);
+        std::to_array({arg1, arg2}));
 }
 
-void resourceTypeIncompatible(crow::Response& res, const std::string& arg1,
-                              const std::string& arg2)
+void resourceTypeIncompatible(crow::Response& res, std::string_view arg1,
+                              std::string_view arg2)
 {
     res.result(boost::beast::http::status::bad_request);
     addMessageToErrorJson(res.jsonValue, resourceTypeIncompatible(arg1, arg2));
@@ -674,16 +666,15 @@
  * @endinternal
  */
 nlohmann::json resetRequired(const boost::urls::url_view& arg1,
-                             const std::string& arg2)
+                             std::string_view arg2)
 {
-    std::array<std::string_view, 2> args{
-        std::string_view(arg1.data(), arg1.size()), arg2};
+    std::string_view arg1str(arg1.data(), arg1.size());
     return getLog(redfish::message_registries::base::Index::resetRequired,
-                  args);
+                  std::to_array({arg1str, arg2}));
 }
 
 void resetRequired(crow::Response& res, const boost::urls::url_view& arg1,
-                   const std::string& arg2)
+                   std::string_view arg2)
 {
     res.result(boost::beast::http::status::bad_request);
     addMessageToErrorJson(res.jsonValue, resetRequired(arg1, arg2));
@@ -696,14 +687,13 @@
  * See header file for more information
  * @endinternal
  */
-nlohmann::json chassisPowerStateOnRequired(const std::string& arg1)
+nlohmann::json chassisPowerStateOnRequired(std::string_view arg1)
 {
-    std::array<std::string_view, 1> args{arg1};
     return getLog(redfish::message_registries::base::Index::resetRequired,
-                  args);
+                  std::to_array({arg1}));
 }
 
-void chassisPowerStateOnRequired(crow::Response& res, const std::string& arg1)
+void chassisPowerStateOnRequired(crow::Response& res, std::string_view arg1)
 {
     res.result(boost::beast::http::status::bad_request);
     addMessageToErrorJson(res.jsonValue, chassisPowerStateOnRequired(arg1));
@@ -716,15 +706,14 @@
  * See header file for more information
  * @endinternal
  */
-nlohmann::json chassisPowerStateOffRequired(const std::string& arg1)
+nlohmann::json chassisPowerStateOffRequired(std::string_view arg1)
 {
-    std::array<std::string_view, 1> args{arg1};
     return getLog(
         redfish::message_registries::base::Index::chassisPowerStateOffRequired,
-        args);
+        std::to_array({arg1}));
 }
 
-void chassisPowerStateOffRequired(crow::Response& res, const std::string& arg1)
+void chassisPowerStateOffRequired(crow::Response& res, std::string_view arg1)
 {
     res.result(boost::beast::http::status::bad_request);
     addMessageToErrorJson(res.jsonValue, chassisPowerStateOffRequired(arg1));
@@ -737,16 +726,16 @@
  * See header file for more information
  * @endinternal
  */
-nlohmann::json propertyValueConflict(const std::string& arg1,
-                                     const std::string& arg2)
+nlohmann::json propertyValueConflict(std::string_view arg1,
+                                     std::string_view arg2)
 {
-    std::array<std::string_view, 2> args{arg1, arg2};
     return getLog(
-        redfish::message_registries::base::Index::propertyValueConflict, args);
+        redfish::message_registries::base::Index::propertyValueConflict,
+        std::to_array({arg1, arg2}));
 }
 
-void propertyValueConflict(crow::Response& res, const std::string& arg1,
-                           const std::string& arg2)
+void propertyValueConflict(crow::Response& res, std::string_view arg1,
+                           std::string_view arg2)
 {
     res.result(boost::beast::http::status::bad_request);
     addMessageToErrorJson(res.jsonValue, propertyValueConflict(arg1, arg2));
@@ -759,16 +748,16 @@
  * See header file for more information
  * @endinternal
  */
-nlohmann::json propertyValueIncorrect(const std::string& arg1,
-                                      const std::string& arg2)
+nlohmann::json propertyValueIncorrect(std::string_view arg1,
+                                      std::string_view arg2)
 {
-    std::array<std::string_view, 2> args{arg1, arg2};
     return getLog(
-        redfish::message_registries::base::Index::propertyValueIncorrect, args);
+        redfish::message_registries::base::Index::propertyValueIncorrect,
+        std::to_array({arg1, arg2}));
 }
 
-void propertyValueIncorrect(crow::Response& res, const std::string& arg1,
-                            const std::string& arg2)
+void propertyValueIncorrect(crow::Response& res, std::string_view arg1,
+                            std::string_view arg2)
 {
     res.result(boost::beast::http::status::bad_request);
     addMessageToErrorJson(res.jsonValue, propertyValueIncorrect(arg1, arg2));
@@ -783,12 +772,10 @@
  */
 nlohmann::json resourceCreationConflict(const boost::urls::url_view& arg1)
 {
-
-    std::array<std::string_view, 1> args{
-        std::string_view(arg1.data(), arg1.size())};
+    std::string_view arg1str(arg1.data(), arg1.size());
     return getLog(
         redfish::message_registries::base::Index::resourceCreationConflict,
-        args);
+        std::to_array({arg1str}));
 }
 
 void resourceCreationConflict(crow::Response& res,
@@ -901,16 +888,16 @@
  * See header file for more information
  * @endinternal
  */
-nlohmann::json propertyValueTypeError(const std::string& arg1,
-                                      const std::string& arg2)
+nlohmann::json propertyValueTypeError(std::string_view arg1,
+                                      std::string_view arg2)
 {
-    std::array<std::string_view, 2> args{arg1, arg2};
     return getLog(
-        redfish::message_registries::base::Index::propertyValueTypeError, args);
+        redfish::message_registries::base::Index::propertyValueTypeError,
+        std::to_array({arg1, arg2}));
 }
 
-void propertyValueTypeError(crow::Response& res, const std::string& arg1,
-                            const std::string& arg2)
+void propertyValueTypeError(crow::Response& res, std::string_view arg1,
+                            std::string_view arg2)
 {
     res.result(boost::beast::http::status::bad_request);
     addMessageToJson(res.jsonValue, propertyValueTypeError(arg1, arg2), arg2);
@@ -923,16 +910,14 @@
  * See header file for more information
  * @endinternal
  */
-nlohmann::json resourceNotFound(const std::string& arg1,
-                                const std::string& arg2)
+nlohmann::json resourceNotFound(std::string_view arg1, std::string_view arg2)
 {
-    std::array<std::string_view, 2> args{arg1, arg2};
     return getLog(redfish::message_registries::base::Index::resourceNotFound,
-                  args);
+                  std::to_array({arg1, arg2}));
 }
 
-void resourceNotFound(crow::Response& res, const std::string& arg1,
-                      const std::string& arg2)
+void resourceNotFound(crow::Response& res, std::string_view arg1,
+                      std::string_view arg2)
 {
     res.result(boost::beast::http::status::not_found);
     addMessageToErrorJson(res.jsonValue, resourceNotFound(arg1, arg2));
@@ -947,12 +932,10 @@
  */
 nlohmann::json couldNotEstablishConnection(const boost::urls::url_view& arg1)
 {
-
-    std::array<std::string_view, 1> args{
-        std::string_view(arg1.data(), arg1.size())};
+    std::string_view arg1str(arg1.data(), arg1.size());
     return getLog(
         redfish::message_registries::base::Index::couldNotEstablishConnection,
-        args);
+        std::to_array({arg1str}));
 }
 
 void couldNotEstablishConnection(crow::Response& res,
@@ -970,14 +953,13 @@
  * See header file for more information
  * @endinternal
  */
-nlohmann::json propertyNotWritable(const std::string& arg1)
+nlohmann::json propertyNotWritable(std::string_view arg1)
 {
-    std::array<std::string_view, 1> args{arg1};
     return getLog(redfish::message_registries::base::Index::propertyNotWritable,
-                  args);
+                  std::to_array({arg1}));
 }
 
-void propertyNotWritable(crow::Response& res, const std::string& arg1)
+void propertyNotWritable(crow::Response& res, std::string_view arg1)
 {
     res.result(boost::beast::http::status::forbidden);
     addMessageToJson(res.jsonValue, propertyNotWritable(arg1), arg1);
@@ -990,17 +972,16 @@
  * See header file for more information
  * @endinternal
  */
-nlohmann::json queryParameterValueTypeError(const std::string& arg1,
-                                            const std::string& arg2)
+nlohmann::json queryParameterValueTypeError(std::string_view arg1,
+                                            std::string_view arg2)
 {
-    std::array<std::string_view, 2> args{arg1, arg2};
     return getLog(
         redfish::message_registries::base::Index::queryParameterValueTypeError,
-        args);
+        std::to_array({arg1, arg2}));
 }
 
-void queryParameterValueTypeError(crow::Response& res, const std::string& arg1,
-                                  const std::string& arg2)
+void queryParameterValueTypeError(crow::Response& res, std::string_view arg1,
+                                  std::string_view arg2)
 {
     res.result(boost::beast::http::status::bad_request);
     addMessageToErrorJson(res.jsonValue,
@@ -1033,17 +1014,16 @@
  * See header file for more information
  * @endinternal
  */
-nlohmann::json actionParameterDuplicate(const std::string& arg1,
-                                        const std::string& arg2)
+nlohmann::json actionParameterDuplicate(std::string_view arg1,
+                                        std::string_view arg2)
 {
-    std::array<std::string_view, 2> args{arg1, arg2};
     return getLog(
         redfish::message_registries::base::Index::actionParameterDuplicate,
-        args);
+        std::to_array({arg1, arg2}));
 }
 
-void actionParameterDuplicate(crow::Response& res, const std::string& arg1,
-                              const std::string& arg2)
+void actionParameterDuplicate(crow::Response& res, std::string_view arg1,
+                              std::string_view arg2)
 {
     res.result(boost::beast::http::status::bad_request);
     addMessageToErrorJson(res.jsonValue, actionParameterDuplicate(arg1, arg2));
@@ -1056,17 +1036,16 @@
  * See header file for more information
  * @endinternal
  */
-nlohmann::json actionParameterNotSupported(const std::string& arg1,
-                                           const std::string& arg2)
+nlohmann::json actionParameterNotSupported(std::string_view arg1,
+                                           std::string_view arg2)
 {
-    std::array<std::string_view, 2> args{arg1, arg2};
     return getLog(
         redfish::message_registries::base::Index::actionParameterNotSupported,
-        args);
+        std::to_array({arg1, arg2}));
 }
 
-void actionParameterNotSupported(crow::Response& res, const std::string& arg1,
-                                 const std::string& arg2)
+void actionParameterNotSupported(crow::Response& res, std::string_view arg1,
+                                 std::string_view arg2)
 {
     res.result(boost::beast::http::status::bad_request);
     addMessageToErrorJson(res.jsonValue,
@@ -1081,18 +1060,17 @@
  * @endinternal
  */
 nlohmann::json sourceDoesNotSupportProtocol(const boost::urls::url_view& arg1,
-                                            const std::string& arg2)
+                                            std::string_view arg2)
 {
-    std::array<std::string_view, 2> args{
-        std::string_view(arg1.data(), arg1.size()), arg2};
+    std::string_view arg1str(arg1.data(), arg1.size());
     return getLog(
         redfish::message_registries::base::Index::sourceDoesNotSupportProtocol,
-        args);
+        std::to_array({arg1str, arg2}));
 }
 
 void sourceDoesNotSupportProtocol(crow::Response& res,
                                   const boost::urls::url_view& arg1,
-                                  const std::string& arg2)
+                                  std::string_view arg2)
 {
     res.result(boost::beast::http::status::bad_request);
     addMessageToErrorJson(res.jsonValue,
@@ -1126,9 +1104,9 @@
  */
 nlohmann::json accessDenied(const boost::urls::url_view& arg1)
 {
-    std::array<std::string_view, 1> args{
-        std::string_view(arg1.data(), arg1.size())};
-    return getLog(redfish::message_registries::base::Index::accessDenied, args);
+    std::string_view arg1str(arg1.data(), arg1.size());
+    return getLog(redfish::message_registries::base::Index::accessDenied,
+                  std::to_array({arg1str}));
 }
 
 void accessDenied(crow::Response& res, const boost::urls::url_view& arg1)
@@ -1257,14 +1235,13 @@
  * See header file for more information
  * @endinternal
  */
-nlohmann::json propertyUnknown(const std::string& arg1)
+nlohmann::json propertyUnknown(std::string_view arg1)
 {
-    std::array<std::string_view, 1> args{arg1};
     return getLog(redfish::message_registries::base::Index::propertyUnknown,
-                  args);
+                  std::to_array({arg1}));
 }
 
-void propertyUnknown(crow::Response& res, const std::string& arg1)
+void propertyUnknown(crow::Response& res, std::string_view arg1)
 {
     res.result(boost::beast::http::status::bad_request);
     addMessageToJson(res.jsonValue, propertyUnknown(arg1), arg1);
@@ -1297,10 +1274,9 @@
  */
 nlohmann::json invalidObject(const boost::urls::url_view& arg1)
 {
-    std::array<std::string_view, 1> args{
-        std::string_view(arg1.data(), arg1.size())};
+    std::string_view arg1str(arg1.data(), arg1.size());
     return getLog(redfish::message_registries::base::Index::invalidObject,
-                  args);
+                  std::to_array({arg1str}));
 }
 
 void invalidObject(crow::Response& res, const boost::urls::url_view& arg1)
@@ -1335,19 +1311,17 @@
  * See header file for more information
  * @endinternal
  */
-nlohmann::json actionParameterValueTypeError(const std::string& arg1,
-                                             const std::string& arg2,
-                                             const std::string& arg3)
+nlohmann::json actionParameterValueTypeError(std::string_view arg1,
+                                             std::string_view arg2,
+                                             std::string_view arg3)
 {
-    std::array<std::string_view, 3> args{arg1, arg2, arg3};
     return getLog(
         redfish::message_registries::base::Index::actionParameterValueTypeError,
-        args);
+        std::to_array({arg1, arg2, arg3}));
 }
 
-void actionParameterValueTypeError(crow::Response& res, const std::string& arg1,
-                                   const std::string& arg2,
-                                   const std::string& arg3)
+void actionParameterValueTypeError(crow::Response& res, std::string_view arg1,
+                                   std::string_view arg2, std::string_view arg3)
 {
     res.result(boost::beast::http::status::bad_request);
     addMessageToErrorJson(res.jsonValue,
@@ -1380,14 +1354,13 @@
  * See header file for more information
  * @endinternal
  */
-nlohmann::json actionNotSupported(const std::string& arg1)
+nlohmann::json actionNotSupported(std::string_view arg1)
 {
-    std::array<std::string_view, 1> args{arg1};
     return getLog(redfish::message_registries::base::Index::actionNotSupported,
-                  args);
+                  std::to_array({arg1}));
 }
 
-void actionNotSupported(crow::Response& res, const std::string& arg1)
+void actionNotSupported(crow::Response& res, std::string_view arg1)
 {
     res.result(boost::beast::http::status::bad_request);
     addMessageToErrorJson(res.jsonValue, actionNotSupported(arg1));
@@ -1403,8 +1376,8 @@
 nlohmann::json invalidIndex(int64_t arg1)
 {
     std::string arg1Str = std::to_string(arg1);
-    std::array<std::string_view, 1> args{arg1Str};
-    return getLog(redfish::message_registries::base::Index::invalidIndex, args);
+    return getLog(redfish::message_registries::base::Index::invalidIndex,
+                  std::to_array<std::string_view>({arg1Str}));
 }
 
 void invalidIndex(crow::Response& res, int64_t arg1)
@@ -1516,16 +1489,16 @@
  * See header file for more information
  * @endinternal
  */
-nlohmann::json propertyValueModified(const std::string& arg1,
-                                     const std::string& arg2)
+nlohmann::json propertyValueModified(std::string_view arg1,
+                                     std::string_view arg2)
 {
-    std::array<std::string_view, 2> args{arg1, arg2};
     return getLog(
-        redfish::message_registries::base::Index::propertyValueModified, args);
+        redfish::message_registries::base::Index::propertyValueModified,
+        std::to_array({arg1, arg2}));
 }
 
-void propertyValueModified(crow::Response& res, const std::string& arg1,
-                           const std::string& arg2)
+void propertyValueModified(crow::Response& res, std::string_view arg1,
+                           std::string_view arg2)
 {
     res.result(boost::beast::http::status::ok);
     addMessageToJson(res.jsonValue, propertyValueModified(arg1, arg2), arg1);
@@ -1557,18 +1530,16 @@
  * See header file for more information
  * @endinternal
  */
-nlohmann::json queryParameterValueFormatError(const std::string& arg1,
-                                              const std::string& arg2)
+nlohmann::json queryParameterValueFormatError(std::string_view arg1,
+                                              std::string_view arg2)
 {
-    std::array<std::string_view, 2> args{arg1, arg2};
     return getLog(redfish::message_registries::base::Index::
                       queryParameterValueFormatError,
-                  args);
+                  std::to_array({arg1, arg2}));
 }
 
-void queryParameterValueFormatError(crow::Response& res,
-                                    const std::string& arg1,
-                                    const std::string& arg2)
+void queryParameterValueFormatError(crow::Response& res, std::string_view arg1,
+                                    std::string_view arg2)
 {
     res.result(boost::beast::http::status::bad_request);
     addMessageToErrorJson(res.jsonValue,
@@ -1583,14 +1554,13 @@
  * See header file for more information
  * @endinternal
  */
-nlohmann::json propertyMissing(const std::string& arg1)
+nlohmann::json propertyMissing(std::string_view arg1)
 {
-    std::array<std::string_view, 1> args{arg1};
     return getLog(redfish::message_registries::base::Index::propertyMissing,
-                  args);
+                  std::to_array({arg1}));
 }
 
-void propertyMissing(crow::Response& res, const std::string& arg1)
+void propertyMissing(crow::Response& res, std::string_view arg1)
 {
     res.result(boost::beast::http::status::bad_request);
     addMessageToJson(res.jsonValue, propertyMissing(arg1), arg1);
@@ -1603,14 +1573,13 @@
  * See header file for more information
  * @endinternal
  */
-nlohmann::json resourceExhaustion(const std::string& arg1)
+nlohmann::json resourceExhaustion(std::string_view arg1)
 {
-    std::array<std::string_view, 1> args{arg1};
     return getLog(redfish::message_registries::base::Index::resourceExhaustion,
-                  args);
+                  std::to_array({arg1}));
 }
 
-void resourceExhaustion(crow::Response& res, const std::string& arg1)
+void resourceExhaustion(crow::Response& res, std::string_view arg1)
 {
     res.result(boost::beast::http::status::service_unavailable);
     addMessageToErrorJson(res.jsonValue, resourceExhaustion(arg1));
@@ -1642,18 +1611,17 @@
  * See header file for more information
  * @endinternal
  */
-nlohmann::json queryParameterOutOfRange(const std::string& arg1,
-                                        const std::string& arg2,
-                                        const std::string& arg3)
+nlohmann::json queryParameterOutOfRange(std::string_view arg1,
+                                        std::string_view arg2,
+                                        std::string_view arg3)
 {
-    std::array<std::string_view, 3> args{arg1, arg2, arg3};
     return getLog(
         redfish::message_registries::base::Index::queryParameterOutOfRange,
-        args);
+        std::to_array({arg1, arg2, arg3}));
 }
 
-void queryParameterOutOfRange(crow::Response& res, const std::string& arg1,
-                              const std::string& arg2, const std::string& arg3)
+void queryParameterOutOfRange(crow::Response& res, std::string_view arg1,
+                              std::string_view arg2, std::string_view arg3)
 {
     res.result(boost::beast::http::status::bad_request);
     addMessageToErrorJson(res.jsonValue,
@@ -1662,11 +1630,10 @@
 
 nlohmann::json passwordChangeRequired(const boost::urls::url_view& arg1)
 {
-    std::array<std::string_view, 1> args{
-        std::string_view(arg1.data(), arg1.size())};
-
+    std::string_view arg1str(arg1.data(), arg1.size());
     return getLog(
-        redfish::message_registries::base::Index::passwordChangeRequired, args);
+        redfish::message_registries::base::Index::passwordChangeRequired,
+        std::to_array({arg1str}));
 }
 
 /**
@@ -1682,8 +1649,8 @@
     messages::addMessageToJsonRoot(res.jsonValue, passwordChangeRequired(arg1));
 }
 
-void invalidUpload(crow::Response& res, const std::string& arg1,
-                   const std::string& arg2)
+void invalidUpload(crow::Response& res, std::string_view arg1,
+                   std::string_view arg2)
 {
     res.result(boost::beast::http::status::bad_request);
     addMessageToErrorJson(res.jsonValue, invalidUpload(arg1, arg2));
@@ -1696,12 +1663,17 @@
  * See header file for more information
  * @endinternal
  */
-nlohmann::json invalidUpload(const std::string& arg1, const std::string& arg2)
+nlohmann::json invalidUpload(std::string_view arg1, std::string_view arg2)
 {
+    std::string msg = "Invalid file uploaded to ";
+    msg += arg1;
+    msg += ": ";
+    msg += arg2;
+    msg += ".";
     return nlohmann::json{
         {"@odata.type", "/redfish/v1/$metadata#Message.v1_1_1.Message"},
         {"MessageId", "OpenBMC.0.2.InvalidUpload"},
-        {"Message", "Invalid file uploaded to " + arg1 + ": " + arg2 + "."},
+        {"Message", std::move(msg)},
         {"MessageArgs", {arg1, arg2}},
         {"MessageSeverity", "Warning"},
         {"Resolution", "None."}};
