diff --git a/.clang-format b/.clang-format
index d92a3f1..d43e884 100644
--- a/.clang-format
+++ b/.clang-format
@@ -14,26 +14,30 @@
 AllowShortBlocksOnASingleLine: Empty
 AllowShortCaseLabelsOnASingleLine: false
 AllowShortFunctionsOnASingleLine: Empty
-AllowShortIfStatementsOnASingleLine: false
+AllowShortIfStatementsOnASingleLine: Never
+AllowShortLambdasOnASingleLine: true
 AllowShortLoopsOnASingleLine: false
 AlwaysBreakAfterReturnType: None
 AlwaysBreakBeforeMultilineStrings: false
 AlwaysBreakTemplateDeclarations: Yes
 BinPackArguments: true
 BinPackParameters: true
+BitFieldColonSpacing: None
 BraceWrapping:
   AfterCaseLabel:  true
   AfterClass:      true
   AfterControlStatement: true
   AfterEnum:       true
+  AfterExternBlock: true
   AfterFunction:   true
   AfterNamespace:  true
   AfterObjCDeclaration: true
   AfterStruct:     true
   AfterUnion:      true
-  AfterExternBlock: true
   BeforeCatch:     true
   BeforeElse:      true
+  BeforeLambdaBody: false
+  BeforeWhile:     false
   IndentBraces:    false
   SplitEmptyFunction:   false
   SplitEmptyRecord:     false
@@ -48,17 +52,16 @@
 ColumnLimit:     80
 CommentPragmas:  '^ IWYU pragma:'
 CompactNamespaces: false
-ConstructorInitializerAllOnOneLineOrOnePerLine: false
 ConstructorInitializerIndentWidth: 4
 ContinuationIndentWidth: 4
 Cpp11BracedListStyle: true
-DeriveLineEnding: false
 DerivePointerAlignment: false
-PointerAlignment: Left
 DisableFormat:   false
-ExperimentalAutoDetectBinPacking: false
 FixNamespaceComments: true
-ForEachMacros:   [ foreach, Q_FOREACH, BOOST_FOREACH ]
+ForEachMacros:
+  - foreach
+  - Q_FOREACH
+  - BOOST_FOREACH
 IncludeBlocks: Regroup
 IncludeCategories:
   - Regex:           '^[<"](gtest|gmock)'
@@ -78,6 +81,7 @@
   - Regex:           '.*'
     Priority:        6
 IndentCaseLabels: true
+IndentExternBlock: NoIndent
 IndentRequiresClause: true
 IndentWidth:     4
 IndentWrappedFunctionNames: true
@@ -92,6 +96,7 @@
 ObjCBlockIndentWidth: 2
 ObjCSpaceAfterProperty: false
 ObjCSpaceBeforeProtocolList: true
+PackConstructorInitializers: BinPack
 PenaltyBreakAssignment: 25
 PenaltyBreakBeforeFirstCallParameter: 19
 PenaltyBreakComment: 300
@@ -100,12 +105,13 @@
 PenaltyExcessCharacter: 1000000
 PenaltyReturnTypeOnItsOwnLine: 60
 PenaltyIndentedWhitespace: 0
+PointerAlignment: Left
 QualifierAlignment: Left
 ReferenceAlignment: Left
 ReflowComments:  true
 RequiresClausePosition: OwnLine
 RequiresExpressionIndentation: Keyword
-SortIncludes:    true
+SortIncludes: CaseSensitive
 SortUsingDeclarations: true
 SpaceAfterCStyleCast: false
 SpaceAfterTemplateKeyword: true
@@ -117,7 +123,7 @@
 SpaceBeforeRangeBasedForLoopColon: true
 SpaceInEmptyParentheses: false
 SpacesBeforeTrailingComments: 1
-SpacesInAngles:  false
+SpacesInAngles: Never
 SpacesInContainerLiterals: true
 SpacesInCStyleCastParentheses: false
 SpacesInParentheses: false
diff --git a/include/libbej/bej_common.h b/include/libbej/bej_common.h
index 6db5fd1..66003f7 100644
--- a/include/libbej/bej_common.h
+++ b/include/libbej/bej_common.h
@@ -43,235 +43,235 @@
         }                                                                      \
     } while (0)
 
+/**
+ * @brief RDE BEJ decoding errors.
+ */
+enum BejError
+{
+    bejErrorNoError = 0,
+    bejErrorUnknown,
+    bejErrorInvalidSize,
+    bejErrorNotSuppoted,
+    bejErrorUnknownProperty,
+    bejErrorInvalidSchemaType,
+    bejErrorInvalidPropertyOffset,
+    bejErrorNullParameter,
+};
+
+/**
+ * @brief BEJ schema classes.
+ */
+enum BejSchemaClass
+{
+    bejMajorSchemaClass = 0,
+    bejEventSchemaClass = 1,
+    bejAnnotationSchemaClass = 2,
+    bejCollectionMemberTypeSchemaClass = 3,
+    bejErrorSchemaClass = 4,
+};
+
+/**
+ * @brief BEJ data types supported in BEJ version 0xF1F0F000.
+ */
+enum BejPrincipalDataType
+{
+    bejSet = 0,
+    bejArray = 1,
+    bejNull = 2,
+    bejInteger = 3,
+    bejEnum = 4,
+    bejString = 5,
+    bejReal = 6,
+    bejBoolean = 7,
+    bejBytestring = 8,
+    bejChoice = 9,
+    bejPropertyAnnotation = 10,
+    bejPrincipalDataReserved1 = 11,
+    bejPrincipalDataReserved2 = 12,
+    bejPrincipalDataReserved3 = 13,
+    bejResourceLink = 14,
+    bejResourceLinkExpansion = 15,
+};
+
+/**
+ * @brief Format BEJ tuple.
+ */
+struct BejTupleF
+{
+    uint8_t deferredBinding:1;
+    uint8_t readOnlyProperty:1;
+    uint8_t nullableProperty:1;
+    uint8_t reserved:1;
+    enum BejPrincipalDataType principalDataType:4;
+} __attribute__((__packed__));
+
+/**
+ * @brief Sequence Number BEJ tuple.
+ */
+struct BejTupleS
+{
+    uint8_t schema;
+    // Dictionaries contain 16bit sequence numbers. So allocating 16bits for
+    // the sequence number here.
+    uint16_t sequenceNumber;
+};
+
+/**
+ * @brief Represent offsets of Format, Value Length and Value of a SFLV
+ * tuple.
+ */
+struct BejSFLVOffset
+{
+    uint32_t formatOffset;
+    uint32_t valueLenNnintOffset;
+    uint32_t valueOffset;
+};
+
+/**
+ * @brief Fields in Bej Real data type.
+ */
+struct BejReal
+{
+    // Number bytes in exp.
+    uint8_t expLen;
+    int64_t whole;
+    uint64_t zeroCount;
+    uint64_t fract;
+    int64_t exp;
+};
+
+/**
+ * @brief SFLV BEJ tuple infomation.
+ */
+struct BejSFLV
+{
+    struct BejTupleS tupleS;
+    struct BejTupleF format;
+    // Value portion size in bytes.
+    uint32_t valueLength;
+    // Value end-offset with respect to the begining of the encoded stream.
+    uint32_t valueEndOffset;
+    // Pointer to the value.
+    const uint8_t* value;
+};
+
+/**
+ * @brief bejEncoding PLDM data type header.
+ */
+struct BejPldmBlockHeader
+{
+    uint32_t bejVersion;
+    uint16_t reserved;
+    uint8_t schemaClass;
+} __attribute__((__packed__));
+
+/**
+ * @brief Points to dictionaries used for encoding and decoding.
+ */
+struct BejDictionaries
+{
+    const uint8_t* schemaDictionary;
+    const uint8_t* annotationDictionary;
+    const uint8_t* errorDictionary;
+};
+
+/**
+ * @brief Callbacks to a stack that can store pointers.
+ */
+struct BejPointerStackCallback
+{
     /**
-     * @brief RDE BEJ decoding errors.
+     * @brief A context for the stack.
      */
-    enum BejError
-    {
-        bejErrorNoError = 0,
-        bejErrorUnknown,
-        bejErrorInvalidSize,
-        bejErrorNotSuppoted,
-        bejErrorUnknownProperty,
-        bejErrorInvalidSchemaType,
-        bejErrorInvalidPropertyOffset,
-        bejErrorNullParameter,
-    };
+    void* stackContext;
 
     /**
-     * @brief BEJ schema classes.
+     * @brief Return true if the stack is empty.
      */
-    enum BejSchemaClass
-    {
-        bejMajorSchemaClass = 0,
-        bejEventSchemaClass = 1,
-        bejAnnotationSchemaClass = 2,
-        bejCollectionMemberTypeSchemaClass = 3,
-        bejErrorSchemaClass = 4,
-    };
+    bool (*stackEmpty)(void* stackContext);
 
     /**
-     * @brief BEJ data types supported in BEJ version 0xF1F0F000.
+     * @brief View the pointer at the top of the stack. If the stack is
+     * empty, this will return NULL.
      */
-    enum BejPrincipalDataType
-    {
-        bejSet = 0,
-        bejArray = 1,
-        bejNull = 2,
-        bejInteger = 3,
-        bejEnum = 4,
-        bejString = 5,
-        bejReal = 6,
-        bejBoolean = 7,
-        bejBytestring = 8,
-        bejChoice = 9,
-        bejPropertyAnnotation = 10,
-        bejPrincipalDataReserved1 = 11,
-        bejPrincipalDataReserved2 = 12,
-        bejPrincipalDataReserved3 = 13,
-        bejResourceLink = 14,
-        bejResourceLinkExpansion = 15,
-    };
+    void* (*stackPeek)(void* stackContext);
 
     /**
-     * @brief Format BEJ tuple.
+     * @brief Returns and removes the top most pointer from the stack. The
+     * Client of the libbej is responsible for destroying the memory used
+     * for storing the removed pointer (not the memory pointed by the
+     * pointer).
      */
-    struct BejTupleF
-    {
-        uint8_t deferredBinding : 1;
-        uint8_t readOnlyProperty : 1;
-        uint8_t nullableProperty : 1;
-        uint8_t reserved : 1;
-        enum BejPrincipalDataType principalDataType : 4;
-    } __attribute__((__packed__));
+    void* (*stackPop)(void* stackContext);
 
     /**
-     * @brief Sequence Number BEJ tuple.
+     * @brief Push a pointer into the stack. Returns 0 if the operation is
+     * successful. Client of this API is responsible for allocating memory
+     * for storing the new pointer.
      */
-    struct BejTupleS
-    {
-        uint8_t schema;
-        // Dictionaries contain 16bit sequence numbers. So allocating 16bits for
-        // the sequence number here.
-        uint16_t sequenceNumber;
-    };
+    int (*stackPush)(void* p, void* stackContext);
 
     /**
-     * @brief Represent offsets of Format, Value Length and Value of a SFLV
-     * tuple.
+     * @brief Delete the stack.
      */
-    struct BejSFLVOffset
-    {
-        uint32_t formatOffset;
-        uint32_t valueLenNnintOffset;
-        uint32_t valueOffset;
-    };
+    void (*deleteStack)(void* stackContext);
+};
 
-    /**
-     * @brief Fields in Bej Real data type.
-     */
-    struct BejReal
-    {
-        // Number bytes in exp.
-        uint8_t expLen;
-        int64_t whole;
-        uint64_t zeroCount;
-        uint64_t fract;
-        int64_t exp;
-    };
+/**
+ * @brief Get the unsigned integer value from provided bytes.
+ *
+ * @param[in] bytes - valid pointer to a byte stream in little-endian
+ * format.
+ * @param[in] numOfBytes - number of bytes belongs to the value. Maximum
+ * number of bytes supported is 8. If numOfBytes > 8, the result is
+ * undefined.
+ * @return unsigend 64bit representation of the value.
+ */
+uint64_t bejGetUnsignedInteger(const uint8_t* bytes, uint8_t numOfBytes);
 
-    /**
-     * @brief SFLV BEJ tuple infomation.
-     */
-    struct BejSFLV
-    {
-        struct BejTupleS tupleS;
-        struct BejTupleF format;
-        // Value portion size in bytes.
-        uint32_t valueLength;
-        // Value end-offset with respect to the begining of the encoded stream.
-        uint32_t valueEndOffset;
-        // Pointer to the value.
-        const uint8_t* value;
-    };
+/**
+ * @brief Get the value from nnint type.
+ *
+ * @param[in] nnint - nnint should be pointing to a valid nnint.
+ * @return unsigend 64bit representation of the value.
+ */
+uint64_t bejGetNnint(const uint8_t* nnint);
 
-    /**
-     * @brief bejEncoding PLDM data type header.
-     */
-    struct BejPldmBlockHeader
-    {
-        uint32_t bejVersion;
-        uint16_t reserved;
-        uint8_t schemaClass;
-    } __attribute__((__packed__));
+/**
+ * @brief Get the size of the complete nnint.
+ *
+ * @param[in] nnint - pointer to a valid nnint.
+ * @return size of the complete nnint.
+ */
+uint8_t bejGetNnintSize(const uint8_t* nnint);
 
-    /**
-     * @brief Points to dictionaries used for encoding and decoding.
-     */
-    struct BejDictionaries
-    {
-        const uint8_t* schemaDictionary;
-        const uint8_t* annotationDictionary;
-        const uint8_t* errorDictionary;
-    };
+/**
+ * @brief Get the bytes needed represent the value as a bejInteger.
+ *
+ * This will return the number of bytes needed to encode the signed value
+ * into a bejInteger type.
+ *
+ * @param val - signed value needed to encode.
+ * @return size of the bejInteger.
+ */
+uint8_t bejIntLengthOfValue(int64_t val);
 
-    /**
-     * @brief Callbacks to a stack that can store pointers.
-     */
-    struct BejPointerStackCallback
-    {
-        /**
-         * @brief A context for the stack.
-         */
-        void* stackContext;
+/**
+ * @brief Get the total bytes needed to encode an unsigned value using nnint
+ * format.
+ *
+ * @param[in] val - unsigned value needed to encode.
+ * @return size of the nnint value.
+ */
+uint8_t bejNnintEncodingSizeOfUInt(uint64_t val);
 
-        /**
-         * @brief Return true if the stack is empty.
-         */
-        bool (*stackEmpty)(void* stackContext);
-
-        /**
-         * @brief View the pointer at the top of the stack. If the stack is
-         * empty, this will return NULL.
-         */
-        void* (*stackPeek)(void* stackContext);
-
-        /**
-         * @brief Returns and removes the top most pointer from the stack. The
-         * Client of the libbej is responsible for destroying the memory used
-         * for storing the removed pointer (not the memory pointed by the
-         * pointer).
-         */
-        void* (*stackPop)(void* stackContext);
-
-        /**
-         * @brief Push a pointer into the stack. Returns 0 if the operation is
-         * successful. Client of this API is responsible for allocating memory
-         * for storing the new pointer.
-         */
-        int (*stackPush)(void* p, void* stackContext);
-
-        /**
-         * @brief Delete the stack.
-         */
-        void (*deleteStack)(void* stackContext);
-    };
-
-    /**
-     * @brief Get the unsigned integer value from provided bytes.
-     *
-     * @param[in] bytes - valid pointer to a byte stream in little-endian
-     * format.
-     * @param[in] numOfBytes - number of bytes belongs to the value. Maximum
-     * number of bytes supported is 8. If numOfBytes > 8, the result is
-     * undefined.
-     * @return unsigend 64bit representation of the value.
-     */
-    uint64_t bejGetUnsignedInteger(const uint8_t* bytes, uint8_t numOfBytes);
-
-    /**
-     * @brief Get the value from nnint type.
-     *
-     * @param[in] nnint - nnint should be pointing to a valid nnint.
-     * @return unsigend 64bit representation of the value.
-     */
-    uint64_t bejGetNnint(const uint8_t* nnint);
-
-    /**
-     * @brief Get the size of the complete nnint.
-     *
-     * @param[in] nnint - pointer to a valid nnint.
-     * @return size of the complete nnint.
-     */
-    uint8_t bejGetNnintSize(const uint8_t* nnint);
-
-    /**
-     * @brief Get the bytes needed represent the value as a bejInteger.
-     *
-     * This will return the number of bytes needed to encode the signed value
-     * into a bejInteger type.
-     *
-     * @param val - signed value needed to encode.
-     * @return size of the bejInteger.
-     */
-    uint8_t bejIntLengthOfValue(int64_t val);
-
-    /**
-     * @brief Get the total bytes needed to encode an unsigned value using nnint
-     * format.
-     *
-     * @param[in] val - unsigned value needed to encode.
-     * @return size of the nnint value.
-     */
-    uint8_t bejNnintEncodingSizeOfUInt(uint64_t val);
-
-    /**
-     * @brief Get the length field value of the unsigned value nnint encoding.
-     *
-     * @param val - unsigned value needed to encode.
-     * @return value of the length field in the encoded nnint.
-     */
-    uint8_t bejNnintLengthFieldOfUInt(uint64_t val);
+/**
+ * @brief Get the length field value of the unsigned value nnint encoding.
+ *
+ * @param val - unsigned value needed to encode.
+ * @return value of the length field in the encoded nnint.
+ */
+uint8_t bejNnintLengthFieldOfUInt(uint64_t val);
 
 #ifdef __cplusplus
 }
diff --git a/include/libbej/bej_decoder_core.h b/include/libbej/bej_decoder_core.h
index 5e226c1..919c396 100644
--- a/include/libbej/bej_decoder_core.h
+++ b/include/libbej/bej_decoder_core.h
@@ -11,205 +11,203 @@
 {
 #endif
 
+/**
+ * @brief Indicates whether a new BEJ section falls inside a BEJ array or a
+ * BEJ set or none of those.
+ */
+enum BejSectionType
+{
+    bejSectionNoType,
+    bejSectionSet,
+    bejSectionArray,
+};
+
+/**
+ * @brief These stack entries are needed to implement the decoding
+ * non-recursively.
+ */
+struct BejStackProperty
+{
+    // Indicates whether we are inside an array or a set or an annotation.
+    enum BejSectionType sectionType;
+    // Indicate whether we have property names for properties.
+    bool addPropertyName;
+    // Offset to the parent property in schema dictionary.
+    uint16_t mainDictPropOffset;
+    // Offset to the parent property in annotation dictionary.
+    uint16_t annoDictPropOffset;
+    // Offset to the end of the array or set or annotation.
+    uint32_t streamEndOffset;
+};
+
+/**
+ * @brief Holds the information related to the current bejTuple being
+ * decoded.
+ */
+struct BejDecoderStates
+{
+    bool addPropertyName;
+    uint16_t mainDictPropOffset;
+    uint16_t annoDictPropOffset;
+    uint32_t encodedStreamOffset;
+    const uint8_t* encodedSubStream;
+};
+
+/**
+ * @brief Callbacks for decoded data.
+ *
+ * dataPtr in the callback functions can be used for extra arguments.
+ */
+struct BejDecodedCallback
+{
     /**
-     * @brief Indicates whether a new BEJ section falls inside a BEJ array or a
-     * BEJ set or none of those.
+     * @brief Calls when a Set is detected.
      */
-    enum BejSectionType
-    {
-        bejSectionNoType,
-        bejSectionSet,
-        bejSectionArray,
-    };
+    int (*callbackSetStart)(const char* propertyName, void* dataPtr);
 
     /**
-     * @brief These stack entries are needed to implement the decoding
-     * non-recursively.
+     * @brief Calls when an end of a Set is found.
      */
-    struct BejStackProperty
-    {
-        // Indicates whether we are inside an array or a set or an annotation.
-        enum BejSectionType sectionType;
-        // Indicate whether we have property names for properties.
-        bool addPropertyName;
-        // Offset to the parent property in schema dictionary.
-        uint16_t mainDictPropOffset;
-        // Offset to the parent property in annotation dictionary.
-        uint16_t annoDictPropOffset;
-        // Offset to the end of the array or set or annotation.
-        uint32_t streamEndOffset;
-    };
+    int (*callbackSetEnd)(void* dataPtr);
 
     /**
-     * @brief Holds the information related to the current bejTuple being
-     * decoded.
+     * @brief Calls when an array is detected.
      */
-    struct BejDecoderStates
-    {
-        bool addPropertyName;
-        uint16_t mainDictPropOffset;
-        uint16_t annoDictPropOffset;
-        uint32_t encodedStreamOffset;
-        const uint8_t* encodedSubStream;
-    };
+    int (*callbackArrayStart)(const char* propertyName, void* dataPtr);
 
     /**
-     * @brief Callbacks for decoded data.
-     *
-     * dataPtr in the callback functions can be used for extra arguments.
+     * @brief Calls when an end of an array is found.
      */
-    struct BejDecodedCallback
-    {
-        /**
-         * @brief Calls when a Set is detected.
-         */
-        int (*callbackSetStart)(const char* propertyName, void* dataPtr);
-
-        /**
-         * @brief Calls when an end of a Set is found.
-         */
-        int (*callbackSetEnd)(void* dataPtr);
-
-        /**
-         * @brief Calls when an array is detected.
-         */
-        int (*callbackArrayStart)(const char* propertyName, void* dataPtr);
-
-        /**
-         * @brief Calls when an end of an array is found.
-         */
-        int (*callbackArrayEnd)(void* dataPtr);
-
-        /**
-         * @brief Calls after a property is finished unless this is the last
-         * property in a Set or an array. In that case appropriate
-         * callbackSetEnd or callbackArrayEnd will be called.
-         */
-        int (*callbackPropertyEnd)(void* dataPtr);
-
-        /**
-         * @brief Calls when a Null property is found or the property length is
-         * 0.
-         */
-        int (*callbackNull)(const char* propertyName, void* dataPtr);
-
-        /**
-         * @brief Calls when an Integer property is found.
-         */
-        int (*callbackInteger)(const char* propertyName, int64_t value,
-                               void* dataPtr);
-
-        /**
-         * @brief Calls when an Enum property is found.
-         */
-        int (*callbackEnum)(const char* propertyName, const char* value,
-                            void* dataPtr);
-
-        /**
-         * @brief Calls when a String property is found.
-         */
-        int (*callbackString)(const char* propertyName, const char* value,
-                              void* dataPtr);
-
-        /**
-         * @brief Calls when a Real value property is found.
-         */
-        int (*callbackReal)(const char* propertyName,
-                            const struct BejReal* value, void* dataPtr);
-
-        /**
-         * @brief Calls when a Bool property is found.
-         */
-        int (*callbackBool)(const char* propertyName, bool value,
-                            void* dataPtr);
-
-        /**
-         * @brief Calls when an Annotated property is found.
-         */
-        int (*callbackAnnotation)(const char* propertyName, void* dataPtr);
-
-        /**
-         * @brief Calls when a read only property is found.
-         */
-        int (*callbackReadonlyProperty)(uint32_t sequenceNumber, void* dataPtr);
-    };
+    int (*callbackArrayEnd)(void* dataPtr);
 
     /**
-     * @brief Stack for holding BejStackProperty types. Decoder core is not
-     * responsible for creating or deleting stack memory. User of the decoder
-     * core is responsible for creating and deleting stack memory.
-     *
-     * dataPtr in the callback functions can be used for extra arguments.
+     * @brief Calls after a property is finished unless this is the last
+     * property in a Set or an array. In that case appropriate
+     * callbackSetEnd or callbackArrayEnd will be called.
      */
-    struct BejStackCallback
-    {
-        /**
-         * @brief Return true if the stack is empty.
-         */
-        bool (*stackEmpty)(void* dataPtr);
-
-        /**
-         * @brief View the object at the top of the stack. If the stack is
-         * empty, this will return NULL.
-         */
-        const struct BejStackProperty* (*stackPeek)(void* dataPtr);
-
-        /**
-         * @brief Removes the top most object from the stack. Client of the
-         * decoder core is responsible for destroying the memory for the removed
-         * object.
-         */
-        void (*stackPop)(void* dataPtr);
-
-        /**
-         * @brief Push an object into the stack. Returns 0 if the operation is
-         * successfull. Client of the decoder core is responsible for allocating
-         * memory for the new object.
-         */
-        int (*stackPush)(const struct BejStackProperty* const property,
-                         void* dataPtr);
-    };
+    int (*callbackPropertyEnd)(void* dataPtr);
 
     /**
-     * @brief Used to pass parameters to BEJ decoding local functions.
+     * @brief Calls when a Null property is found or the property length is
+     * 0.
      */
-    struct BejHandleTypeFuncParam
-    {
-        struct BejDecoderStates state;
-        struct BejSFLV sflv;
-        const uint8_t* mainDictionary;
-        const uint8_t* annotDictionary;
-        const struct BejDecodedCallback* decodedCallback;
-        const struct BejStackCallback* stackCallback;
-        void* callbacksDataPtr;
-        void* stackDataPtr;
-    };
+    int (*callbackNull)(const char* propertyName, void* dataPtr);
 
     /**
-     * @brief Decodes a PLDM block. Maximum encoded stream size the decoder
-     * supports is 32bits.
-     *
-     * @param[in] dictionaries - dictionaries needed for decoding.
-     * @param[in] encodedPldmBlock - encoded PLDM block.
-     * @param[in] blockLength - length of the PLDM block.
-     * @param[in] stackCallback - callbacks for stack handlers. callbacks in
-     * stackCallback struct should be set to valid functions.
-     * @param[in] decodedCallback - callbacks for extracting decoded
-     * properties. callbacks in decodedCallback struct should be set to
-     * NULL or valid functions.
-     * @param[in] callbacksDataPtr - data pointer to pass to decoded callbacks.
-     * This can be used pass additional data.
-     * @param[in] stackDataPtr - data pointer to pass to stack callbacks. This
-     * can be used pass additional data.
-     *
-     * @return 0 if successful.
+     * @brief Calls when an Integer property is found.
      */
-    int bejDecodePldmBlock(const struct BejDictionaries* dictionaries,
-                           const uint8_t* encodedPldmBlock,
-                           uint32_t blockLength,
-                           const struct BejStackCallback* stackCallback,
-                           const struct BejDecodedCallback* decodedCallback,
-                           void* callbacksDataPtr, void* stackDataPtr);
+    int (*callbackInteger)(const char* propertyName, int64_t value,
+                           void* dataPtr);
+
+    /**
+     * @brief Calls when an Enum property is found.
+     */
+    int (*callbackEnum)(const char* propertyName, const char* value,
+                        void* dataPtr);
+
+    /**
+     * @brief Calls when a String property is found.
+     */
+    int (*callbackString)(const char* propertyName, const char* value,
+                          void* dataPtr);
+
+    /**
+     * @brief Calls when a Real value property is found.
+     */
+    int (*callbackReal)(const char* propertyName, const struct BejReal* value,
+                        void* dataPtr);
+
+    /**
+     * @brief Calls when a Bool property is found.
+     */
+    int (*callbackBool)(const char* propertyName, bool value, void* dataPtr);
+
+    /**
+     * @brief Calls when an Annotated property is found.
+     */
+    int (*callbackAnnotation)(const char* propertyName, void* dataPtr);
+
+    /**
+     * @brief Calls when a read only property is found.
+     */
+    int (*callbackReadonlyProperty)(uint32_t sequenceNumber, void* dataPtr);
+};
+
+/**
+ * @brief Stack for holding BejStackProperty types. Decoder core is not
+ * responsible for creating or deleting stack memory. User of the decoder
+ * core is responsible for creating and deleting stack memory.
+ *
+ * dataPtr in the callback functions can be used for extra arguments.
+ */
+struct BejStackCallback
+{
+    /**
+     * @brief Return true if the stack is empty.
+     */
+    bool (*stackEmpty)(void* dataPtr);
+
+    /**
+     * @brief View the object at the top of the stack. If the stack is
+     * empty, this will return NULL.
+     */
+    const struct BejStackProperty* (*stackPeek)(void* dataPtr);
+
+    /**
+     * @brief Removes the top most object from the stack. Client of the
+     * decoder core is responsible for destroying the memory for the removed
+     * object.
+     */
+    void (*stackPop)(void* dataPtr);
+
+    /**
+     * @brief Push an object into the stack. Returns 0 if the operation is
+     * successfull. Client of the decoder core is responsible for allocating
+     * memory for the new object.
+     */
+    int (*stackPush)(const struct BejStackProperty* const property,
+                     void* dataPtr);
+};
+
+/**
+ * @brief Used to pass parameters to BEJ decoding local functions.
+ */
+struct BejHandleTypeFuncParam
+{
+    struct BejDecoderStates state;
+    struct BejSFLV sflv;
+    const uint8_t* mainDictionary;
+    const uint8_t* annotDictionary;
+    const struct BejDecodedCallback* decodedCallback;
+    const struct BejStackCallback* stackCallback;
+    void* callbacksDataPtr;
+    void* stackDataPtr;
+};
+
+/**
+ * @brief Decodes a PLDM block. Maximum encoded stream size the decoder
+ * supports is 32bits.
+ *
+ * @param[in] dictionaries - dictionaries needed for decoding.
+ * @param[in] encodedPldmBlock - encoded PLDM block.
+ * @param[in] blockLength - length of the PLDM block.
+ * @param[in] stackCallback - callbacks for stack handlers. callbacks in
+ * stackCallback struct should be set to valid functions.
+ * @param[in] decodedCallback - callbacks for extracting decoded
+ * properties. callbacks in decodedCallback struct should be set to
+ * NULL or valid functions.
+ * @param[in] callbacksDataPtr - data pointer to pass to decoded callbacks.
+ * This can be used pass additional data.
+ * @param[in] stackDataPtr - data pointer to pass to stack callbacks. This
+ * can be used pass additional data.
+ *
+ * @return 0 if successful.
+ */
+int bejDecodePldmBlock(const struct BejDictionaries* dictionaries,
+                       const uint8_t* encodedPldmBlock, uint32_t blockLength,
+                       const struct BejStackCallback* stackCallback,
+                       const struct BejDecodedCallback* decodedCallback,
+                       void* callbacksDataPtr, void* stackDataPtr);
 
 #ifdef __cplusplus
 }
diff --git a/include/libbej/bej_dictionary.h b/include/libbej/bej_dictionary.h
index ddfaa81..b22404d 100644
--- a/include/libbej/bej_dictionary.h
+++ b/include/libbej/bej_dictionary.h
@@ -20,101 +20,100 @@
  */
 #define DICTIONARY_SEQ_NUM_SHIFT 1
 
-    /**
-     * @brief BEJ dictionary type.
-     */
-    enum BejDictionaryType
-    {
-        bejPrimary = 0,
-        bejAnnotation = 1,
-    };
+/**
+ * @brief BEJ dictionary type.
+ */
+enum BejDictionaryType
+{
+    bejPrimary = 0,
+    bejAnnotation = 1,
+};
 
-    /**
-     * @brief Dictionary property header.
-     */
-    struct BejDictionaryProperty
-    {
-        struct BejTupleF format;
-        uint16_t sequenceNumber;
-        uint16_t childPointerOffset;
-        uint16_t childCount;
-        uint8_t nameLength;
-        uint16_t nameOffset;
-    } __attribute__((__packed__));
+/**
+ * @brief Dictionary property header.
+ */
+struct BejDictionaryProperty
+{
+    struct BejTupleF format;
+    uint16_t sequenceNumber;
+    uint16_t childPointerOffset;
+    uint16_t childCount;
+    uint8_t nameLength;
+    uint16_t nameOffset;
+} __attribute__((__packed__));
 
-    struct BejDictionaryHeader
-    {
-        uint8_t versionTag;
-        uint8_t truncationFlag : 1;
-        uint8_t reservedFlags : 7;
-        uint16_t entryCount;
-        uint32_t schemaVersion;
-        uint32_t dictionarySize;
-    } __attribute__((__packed__));
+struct BejDictionaryHeader
+{
+    uint8_t versionTag;
+    uint8_t truncationFlag:1;
+    uint8_t reservedFlags:7;
+    uint16_t entryCount;
+    uint32_t schemaVersion;
+    uint32_t dictionarySize;
+} __attribute__((__packed__));
 
-    /**
-     * @brief Get the offset of the first property in a dictionary.
-     *
-     * @return the offset to the first property.
-     */
-    uint16_t bejDictGetPropertyHeadOffset();
+/**
+ * @brief Get the offset of the first property in a dictionary.
+ *
+ * @return the offset to the first property.
+ */
+uint16_t bejDictGetPropertyHeadOffset();
 
-    /**
-     * @brief Get the offset of the first annotated property in an annoation
-     * dictionary.
-     *
-     * @return the offset to the first annotated property in an annoation
-     * dictionary.
-     */
-    uint16_t bejDictGetFirstAnnotatedPropertyOffset();
+/**
+ * @brief Get the offset of the first annotated property in an annoation
+ * dictionary.
+ *
+ * @return the offset to the first annotated property in an annoation
+ * dictionary.
+ */
+uint16_t bejDictGetFirstAnnotatedPropertyOffset();
 
-    /**
-     * @brief Get the property related to the given sequence number.
-     *
-     * @param[in] dictionary - dictionary containing the sequence number.
-     * @param[in] startingPropertyOffset - offset of the starting property for
-     * the search.
-     * @param[in] sequenceNumber - sequence number of the property.
-     * @param[out] property - if the search is successful, this will point to a
-     * valid property.
-     * @return 0 if successful.
-     */
-    int bejDictGetProperty(const uint8_t* dictionary,
-                           uint16_t startingPropertyOffset,
-                           uint16_t sequenceNumber,
-                           const struct BejDictionaryProperty** property);
+/**
+ * @brief Get the property related to the given sequence number.
+ *
+ * @param[in] dictionary - dictionary containing the sequence number.
+ * @param[in] startingPropertyOffset - offset of the starting property for
+ * the search.
+ * @param[in] sequenceNumber - sequence number of the property.
+ * @param[out] property - if the search is successful, this will point to a
+ * valid property.
+ * @return 0 if successful.
+ */
+int bejDictGetProperty(const uint8_t* dictionary,
+                       uint16_t startingPropertyOffset, uint16_t sequenceNumber,
+                       const struct BejDictionaryProperty** property);
 
-    /**
-     * @brief Get the name of a property.
-     *
-     * @param[in] dictionary - dictionary containing the property.
-     * @param[in] nameOffset - dictionary offset of the name.
-     * @param[in] nameLength - length of the name.
-     * @return a NULL terminated string. If the nameLength is 0, this will
-     * return an empty string.
-     */
-    const char* bejDictGetPropertyName(const uint8_t* dictionary,
-                                       uint16_t nameOffset, uint8_t nameLength);
+/**
+ * @brief Get the name of a property.
+ *
+ * @param[in] dictionary - dictionary containing the property.
+ * @param[in] nameOffset - dictionary offset of the name.
+ * @param[in] nameLength - length of the name.
+ * @return a NULL terminated string. If the nameLength is 0, this will
+ * return an empty string.
+ */
+const char* bejDictGetPropertyName(const uint8_t* dictionary,
+                                   uint16_t nameOffset, uint8_t nameLength);
 
-    /**
-     * @brief Get the property related to the given property name.
-     *
-     * @param[in] dictionary - dictionary containing the property.
-     * @param[in] startingPropertyOffset - offset of the starting property for
-     * the search.
-     * @param[in] propertyName - name of the searched property.
-     * @param[out] property - if the search is successful, this will point to a
-     * valid property.
-     * @param[out] propertyOffset - if the search is successful, this will point
-     * to the offset of the property within the dictionary. Can provide a NULL
-     * pointer if this is not needed.
-     * @return 0 if successful.
-     */
-    int bejDictGetPropertyByName(const uint8_t* dictionary,
-                                 uint16_t startingPropertyOffset,
-                                 const char* propertyName,
-                                 const struct BejDictionaryProperty** property,
-                                 uint16_t* propertyOffset);
+/**
+ * @brief Get the property related to the given property name.
+ *
+ * @param[in] dictionary - dictionary containing the property.
+ * @param[in] startingPropertyOffset - offset of the starting property for
+ * the search.
+ * @param[in] propertyName - name of the searched property.
+ * @param[out] property - if the search is successful, this will point to a
+ * valid property.
+ * @param[out] propertyOffset - if the search is successful, this will point
+ * to the offset of the property within the dictionary. Can provide a NULL
+ * pointer if this is not needed.
+ * @return 0 if successful.
+ */
+int bejDictGetPropertyByName(const uint8_t* dictionary,
+                             uint16_t startingPropertyOffset,
+                             const char* propertyName,
+                             const struct BejDictionaryProperty** property,
+                             uint16_t* propertyOffset);
 
 #ifdef __cplusplus
 }
diff --git a/include/libbej/bej_encoder_core.h b/include/libbej/bej_encoder_core.h
index 6088eef..22b363d 100644
--- a/include/libbej/bej_encoder_core.h
+++ b/include/libbej/bej_encoder_core.h
@@ -11,40 +11,39 @@
 
 #define BEJ_VERSION 0xF1F0F000
 
-    /**
-     * @brief A struct for storing output information for the encoder.
-     */
-    struct BejEncoderOutputHandler
-    {
-        // A user provided context to be passed to the recvOutput() callback.
-        void* handlerContext;
-        // A callback function that will be invoked by the encoder whenever it
-        // has output data.
-        int (*recvOutput)(const void* data, size_t data_size,
-                          void* handlerContext);
-    };
+/**
+ * @brief A struct for storing output information for the encoder.
+ */
+struct BejEncoderOutputHandler
+{
+    // A user provided context to be passed to the recvOutput() callback.
+    void* handlerContext;
+    // A callback function that will be invoked by the encoder whenever it
+    // has output data.
+    int (*recvOutput)(const void* data, size_t data_size, void* handlerContext);
+};
 
-    /**
-     * @brief Perform BEJ encoding.
-     *
-     * @param dictionaries - dictionaries used for encoding.
-     * @param majorSchemaStartingOffset - starting dictionary offset for
-     * endcoding. Use BEJ_DICTIONARY_START_AT_HEAD to encode a complete
-     * resource. Use the correct offset when encoding a subsection of a redfish
-     * resource.
-     * @param schemaClass - schema class for the resource.
-     * @param root - root node of the resource to be encoded. Root node has to
-     * be a bejSet.
-     * @param output - An intialized BejEncoderOutputHandler struct.
-     * @param stack - An initialized BejPointerStackCallback struct.
-     * @return 0 if successful.
-     */
-    int bejEncode(const struct BejDictionaries* dictionaries,
-                  uint16_t majorSchemaStartingOffset,
-                  enum BejSchemaClass schemaClass,
-                  struct RedfishPropertyParent* root,
-                  struct BejEncoderOutputHandler* output,
-                  struct BejPointerStackCallback* stack);
+/**
+ * @brief Perform BEJ encoding.
+ *
+ * @param dictionaries - dictionaries used for encoding.
+ * @param majorSchemaStartingOffset - starting dictionary offset for
+ * endcoding. Use BEJ_DICTIONARY_START_AT_HEAD to encode a complete
+ * resource. Use the correct offset when encoding a subsection of a redfish
+ * resource.
+ * @param schemaClass - schema class for the resource.
+ * @param root - root node of the resource to be encoded. Root node has to
+ * be a bejSet.
+ * @param output - An intialized BejEncoderOutputHandler struct.
+ * @param stack - An initialized BejPointerStackCallback struct.
+ * @return 0 if successful.
+ */
+int bejEncode(const struct BejDictionaries* dictionaries,
+              uint16_t majorSchemaStartingOffset,
+              enum BejSchemaClass schemaClass,
+              struct RedfishPropertyParent* root,
+              struct BejEncoderOutputHandler* output,
+              struct BejPointerStackCallback* stack);
 
 #ifdef __cplusplus
 }
diff --git a/include/libbej/bej_encoder_metadata.h b/include/libbej/bej_encoder_metadata.h
index 55b6f10..d07fb02 100644
--- a/include/libbej/bej_encoder_metadata.h
+++ b/include/libbej/bej_encoder_metadata.h
@@ -8,26 +8,26 @@
 {
 #endif
 
-    /**
-     * @brief Update the node metadata used during encoding process.
-     *
-     * This function will visit the entire JSON tree and update metdata
-     * properties of each node.
-     *
-     * @param dictionaries - dictionaries used for encoding.
-     * @param majorSchemaStartingOffset - starting dictionary offset for
-     * endcoding. Use BEJ_DICTIONARY_START_AT_HEAD to encode a complete
-     * resource. Use the correct offset when encoding a subsection of a redfish
-     * resource.
-     * @param root - root node of the resource to be encoded. Root node has to
-     * be a bejSet.
-     * @param stack - An intialized BejEncoderOutputHandler struct.
-     * @return 0 if successful.
-     */
-    int bejUpdateNodeMetadata(const struct BejDictionaries* dictionaries,
-                              uint16_t majorSchemaStartingOffset,
-                              struct RedfishPropertyParent* root,
-                              struct BejPointerStackCallback* stack);
+/**
+ * @brief Update the node metadata used during encoding process.
+ *
+ * This function will visit the entire JSON tree and update metdata
+ * properties of each node.
+ *
+ * @param dictionaries - dictionaries used for encoding.
+ * @param majorSchemaStartingOffset - starting dictionary offset for
+ * endcoding. Use BEJ_DICTIONARY_START_AT_HEAD to encode a complete
+ * resource. Use the correct offset when encoding a subsection of a redfish
+ * resource.
+ * @param root - root node of the resource to be encoded. Root node has to
+ * be a bejSet.
+ * @param stack - An intialized BejEncoderOutputHandler struct.
+ * @return 0 if successful.
+ */
+int bejUpdateNodeMetadata(const struct BejDictionaries* dictionaries,
+                          uint16_t majorSchemaStartingOffset,
+                          struct RedfishPropertyParent* root,
+                          struct BejPointerStackCallback* stack);
 
 #ifdef __cplusplus
 }
diff --git a/include/libbej/bej_tree.h b/include/libbej/bej_tree.h
index 32bf82c..5a9ff89 100644
--- a/include/libbej/bej_tree.h
+++ b/include/libbej/bej_tree.h
@@ -11,305 +11,303 @@
 {
 #endif
 
-    /**
-     * @brief Holds info needed to encode a parent in the JSON tree.
-     */
-    struct BejEncoderParentMetaData
-    {
-        // Starting dictionary index of the children properties.
-        uint16_t childrenDictPropOffset;
-        // Index of the child pointed by nextChild. Used to store the array
-        // indexes of bejArray elements.
-        uint16_t nextChildIndex;
-        // BEJ sequence number of the property.
-        uint32_t sequenceNumber;
-        // Size needed to encode Sequence number, Format and Length of the
-        // value.
-        size_t sflSize;
-        // Size of the value.
-        size_t vSize;
-        // Dictionary used for this parent.
-        const uint8_t* dictionary;
-        // Points to the next node which is need to process.
-        void* nextChild;
-    };
+/**
+ * @brief Holds info needed to encode a parent in the JSON tree.
+ */
+struct BejEncoderParentMetaData
+{
+    // Starting dictionary index of the children properties.
+    uint16_t childrenDictPropOffset;
+    // Index of the child pointed by nextChild. Used to store the array
+    // indexes of bejArray elements.
+    uint16_t nextChildIndex;
+    // BEJ sequence number of the property.
+    uint32_t sequenceNumber;
+    // Size needed to encode Sequence number, Format and Length of the
+    // value.
+    size_t sflSize;
+    // Size of the value.
+    size_t vSize;
+    // Dictionary used for this parent.
+    const uint8_t* dictionary;
+    // Points to the next node which is need to process.
+    void* nextChild;
+};
 
-    /**
-     * @brief Holds info needed to encode a leaf type in the JSON tree.
-     */
-    struct BejEncoderLeafMetaData
-    {
-        // BEJ sequence number of the property.
-        uint32_t sequenceNumber;
-        // Size needed to encode Sequence number, Format and Length of the
-        // value.
-        size_t sflSize;
-        // Size of the value.
-        size_t vSize;
-    };
+/**
+ * @brief Holds info needed to encode a leaf type in the JSON tree.
+ */
+struct BejEncoderLeafMetaData
+{
+    // BEJ sequence number of the property.
+    uint32_t sequenceNumber;
+    // Size needed to encode Sequence number, Format and Length of the
+    // value.
+    size_t sflSize;
+    // Size of the value.
+    size_t vSize;
+};
 
-    /**
-     * @brief Common attributes of a JSON property.
-     */
-    struct RedfishPropertyNode
-    {
-        const char* name;
-        struct BejTupleF format;
-        // Properties belonging to the same set or
-        // array and has the same depth.
-        void* sibling;
-    };
+/**
+ * @brief Common attributes of a JSON property.
+ */
+struct RedfishPropertyNode
+{
+    const char* name;
+    struct BejTupleF format;
+    // Properties belonging to the same set or
+    // array and has the same depth.
+    void* sibling;
+};
 
-    /**
-     * @brief Used to store parent type property info.
-     *
-     * bejArray, bejSet and bejPropertyAnnotation are the parent type nodes.
-     */
-    struct RedfishPropertyParent
-    {
-        // Common property attributes.
-        struct RedfishPropertyNode nodeAttr;
-        // Number of children in the case of bejSet
-        // or bejArray.
-        size_t nChildren;
-        //  Points to the first child.
-        void* firstChild;
-        // Points to the last child. Technically we only need the firstChild
-        // pointer to add a new element to the list. But to support bejArray
-        // type, we need to traverse the linked list in the same order as the
-        // elements in the array. So we need a pointer to the first child and
-        // keep adding new nodes using the lastChild.
-        void* lastChild;
-        // Metadata used during encoding.
-        struct BejEncoderParentMetaData metaData;
-    };
+/**
+ * @brief Used to store parent type property info.
+ *
+ * bejArray, bejSet and bejPropertyAnnotation are the parent type nodes.
+ */
+struct RedfishPropertyParent
+{
+    // Common property attributes.
+    struct RedfishPropertyNode nodeAttr;
+    // Number of children in the case of bejSet
+    // or bejArray.
+    size_t nChildren;
+    //  Points to the first child.
+    void* firstChild;
+    // Points to the last child. Technically we only need the firstChild
+    // pointer to add a new element to the list. But to support bejArray
+    // type, we need to traverse the linked list in the same order as the
+    // elements in the array. So we need a pointer to the first child and
+    // keep adding new nodes using the lastChild.
+    void* lastChild;
+    // Metadata used during encoding.
+    struct BejEncoderParentMetaData metaData;
+};
 
-    /**
-     * @brief Used to store leaf type property info.
-     *
-     * Every type that doesn't belong to parent type are considered as a leaf
-     * property within a JSON tree. Each specific leaf type has its own struct.
-     * They should include this struct as the first member of their struct.
-     */
-    struct RedfishPropertyLeaf
-    {
-        struct RedfishPropertyNode nodeAttr;
-        struct BejEncoderLeafMetaData metaData;
-    };
+/**
+ * @brief Used to store leaf type property info.
+ *
+ * Every type that doesn't belong to parent type are considered as a leaf
+ * property within a JSON tree. Each specific leaf type has its own struct.
+ * They should include this struct as the first member of their struct.
+ */
+struct RedfishPropertyLeaf
+{
+    struct RedfishPropertyNode nodeAttr;
+    struct BejEncoderLeafMetaData metaData;
+};
 
-    /**
-     * @brief bejNull type property node.
-     */
-    struct RedfishPropertyLeafNull
-    {
-        struct RedfishPropertyLeaf leaf;
-    };
+/**
+ * @brief bejNull type property node.
+ */
+struct RedfishPropertyLeafNull
+{
+    struct RedfishPropertyLeaf leaf;
+};
 
-    /**
-     * @brief bejInteger type property node.
-     */
-    struct RedfishPropertyLeafInt
-    {
-        struct RedfishPropertyLeaf leaf;
-        int64_t value;
-    };
+/**
+ * @brief bejInteger type property node.
+ */
+struct RedfishPropertyLeafInt
+{
+    struct RedfishPropertyLeaf leaf;
+    int64_t value;
+};
 
-    /**
-     * @brief bejEnum type property node.
-     */
-    struct RedfishPropertyLeafEnum
-    {
-        struct RedfishPropertyLeaf leaf;
-        // A string representation of the enum value.
-        const char* value;
-        // Sequence number of the enum value. Populated during bej encoding.
-        uint16_t enumValueSeq;
-    };
+/**
+ * @brief bejEnum type property node.
+ */
+struct RedfishPropertyLeafEnum
+{
+    struct RedfishPropertyLeaf leaf;
+    // A string representation of the enum value.
+    const char* value;
+    // Sequence number of the enum value. Populated during bej encoding.
+    uint16_t enumValueSeq;
+};
 
-    /**
-     * @brief bejString type property node.
-     */
-    struct RedfishPropertyLeafString
-    {
-        struct RedfishPropertyLeaf leaf;
-        const char* value;
-    };
+/**
+ * @brief bejString type property node.
+ */
+struct RedfishPropertyLeafString
+{
+    struct RedfishPropertyLeaf leaf;
+    const char* value;
+};
 
-    /**
-     * @brief bejReal type property node.
-     */
-    struct RedfishPropertyLeafReal
-    {
-        struct RedfishPropertyLeaf leaf;
-        double value;
-        // bejReal representation of the value. Populated during bej encoding.
-        struct BejReal bejReal;
-    };
+/**
+ * @brief bejReal type property node.
+ */
+struct RedfishPropertyLeafReal
+{
+    struct RedfishPropertyLeaf leaf;
+    double value;
+    // bejReal representation of the value. Populated during bej encoding.
+    struct BejReal bejReal;
+};
 
-    /**
-     * @brief bejBoolean type property node.
-     */
-    struct RedfishPropertyLeafBool
-    {
-        struct RedfishPropertyLeaf leaf;
-        bool value;
-    };
+/**
+ * @brief bejBoolean type property node.
+ */
+struct RedfishPropertyLeafBool
+{
+    struct RedfishPropertyLeaf leaf;
+    bool value;
+};
 
-    /**
-     * @brief Initialize a bejSet type node.
-     *
-     * @param[in] node - pointer to a RedfishPropertyParent struct.
-     * @param[in] name - name of the node.
-     */
-    void bejTreeInitSet(struct RedfishPropertyParent* node, const char* name);
+/**
+ * @brief Initialize a bejSet type node.
+ *
+ * @param[in] node - pointer to a RedfishPropertyParent struct.
+ * @param[in] name - name of the node.
+ */
+void bejTreeInitSet(struct RedfishPropertyParent* node, const char* name);
 
-    /**
-     * @brief Initialize a bejArray type node.
-     *
-     * @param[in] node - pointer to a RedfishPropertyParent struct.
-     * @param[in] name - name of the node.
-     */
-    void bejTreeInitArray(struct RedfishPropertyParent* node, const char* name);
+/**
+ * @brief Initialize a bejArray type node.
+ *
+ * @param[in] node - pointer to a RedfishPropertyParent struct.
+ * @param[in] name - name of the node.
+ */
+void bejTreeInitArray(struct RedfishPropertyParent* node, const char* name);
 
-    /**
-     * @brief Initialize a bejPropertyAnnotation type node.
-     *
-     * @param[in] node - pointer to a RedfishPropertyParent struct.
-     * @param[in] name - name of the node.
-     */
-    void bejTreeInitPropertyAnnotated(struct RedfishPropertyParent* node,
-                                      const char* name);
+/**
+ * @brief Initialize a bejPropertyAnnotation type node.
+ *
+ * @param[in] node - pointer to a RedfishPropertyParent struct.
+ * @param[in] name - name of the node.
+ */
+void bejTreeInitPropertyAnnotated(struct RedfishPropertyParent* node,
+                                  const char* name);
 
-    /**
-     * @brief Check if a node is a parent type node.
-     *
-     * @param node - node to be checked.
-     * @return true if the node is a parent type node.
-     */
-    bool bejTreeIsParentType(struct RedfishPropertyNode* node);
+/**
+ * @brief Check if a node is a parent type node.
+ *
+ * @param node - node to be checked.
+ * @return true if the node is a parent type node.
+ */
+bool bejTreeIsParentType(struct RedfishPropertyNode* node);
 
-    /**
-     * @brief Initialize a bejNull type node.
-     *
-     * @param parent - a pointer to an initialized parent struct.
-     * @param child - a pointer to an uninitialized bejNull type node.
-     * @param name - name of the bejNull type property.
-     */
-    void bejTreeAddNull(struct RedfishPropertyParent* parent,
-                        struct RedfishPropertyLeafNull* child,
-                        const char* name);
+/**
+ * @brief Initialize a bejNull type node.
+ *
+ * @param parent - a pointer to an initialized parent struct.
+ * @param child - a pointer to an uninitialized bejNull type node.
+ * @param name - name of the bejNull type property.
+ */
+void bejTreeAddNull(struct RedfishPropertyParent* parent,
+                    struct RedfishPropertyLeafNull* child, const char* name);
 
-    /**
-     * @brief Add a bejInteger type node to a parent node.
-     *
-     * @param[in] parent - a pointer to an initialized parent struct.
-     * @param[in] child - a pointer to an uninitialized bejInteger type node.
-     * @param[in] name - name of the bejInteger type property.
-     * @param[in] value - value of the bejInteger type property.
-     */
-    void bejTreeAddInteger(struct RedfishPropertyParent* parent,
-                           struct RedfishPropertyLeafInt* child,
-                           const char* name, int64_t value);
+/**
+ * @brief Add a bejInteger type node to a parent node.
+ *
+ * @param[in] parent - a pointer to an initialized parent struct.
+ * @param[in] child - a pointer to an uninitialized bejInteger type node.
+ * @param[in] name - name of the bejInteger type property.
+ * @param[in] value - value of the bejInteger type property.
+ */
+void bejTreeAddInteger(struct RedfishPropertyParent* parent,
+                       struct RedfishPropertyLeafInt* child, const char* name,
+                       int64_t value);
 
-    /**
-     * @brief Set a new value in bejInteger type node.
-     *
-     * @param[in] node - initialized bejInteger type node.
-     * @param[in] newValue - new integer value.
-     */
-    void bejTreeSetInteger(struct RedfishPropertyLeafInt* node,
-                           int64_t newValue);
+/**
+ * @brief Set a new value in bejInteger type node.
+ *
+ * @param[in] node - initialized bejInteger type node.
+ * @param[in] newValue - new integer value.
+ */
+void bejTreeSetInteger(struct RedfishPropertyLeafInt* node, int64_t newValue);
 
-    /**
-     * @brief Add a bejEnum type node to a parent node.
-     *
-     * @param[in] parent - a pointer to an initialized parent struct.
-     * @param[in] child - a pointer to an uninitialized bejEnum type node.
-     * @param[in] name - name of the bejEnum type property.
-     * @param[in] value - value of the bejEnum type property.
-     */
-    void bejTreeAddEnum(struct RedfishPropertyParent* parent,
-                        struct RedfishPropertyLeafEnum* child, const char* name,
-                        const char* value);
+/**
+ * @brief Add a bejEnum type node to a parent node.
+ *
+ * @param[in] parent - a pointer to an initialized parent struct.
+ * @param[in] child - a pointer to an uninitialized bejEnum type node.
+ * @param[in] name - name of the bejEnum type property.
+ * @param[in] value - value of the bejEnum type property.
+ */
+void bejTreeAddEnum(struct RedfishPropertyParent* parent,
+                    struct RedfishPropertyLeafEnum* child, const char* name,
+                    const char* value);
 
-    /**
-     * @brief Add a bejString type node to a parent node.
-     *
-     * @param[in] parent - a pointer to an initialized parent struct.
-     * @param[in] child - a pointer to an uninitialized bejString type node.
-     * @param[in] name - name of the bejString type property.
-     * @param[in] value - value of the bejString type property.
-     */
-    void bejTreeAddString(struct RedfishPropertyParent* parent,
-                          struct RedfishPropertyLeafString* child,
-                          const char* name, const char* value);
+/**
+ * @brief Add a bejString type node to a parent node.
+ *
+ * @param[in] parent - a pointer to an initialized parent struct.
+ * @param[in] child - a pointer to an uninitialized bejString type node.
+ * @param[in] name - name of the bejString type property.
+ * @param[in] value - value of the bejString type property.
+ */
+void bejTreeAddString(struct RedfishPropertyParent* parent,
+                      struct RedfishPropertyLeafString* child, const char* name,
+                      const char* value);
 
-    /**
-     * @brief Add a bejReal type node to a parent node.
-     *
-     * @param[in] parent - a pointer to an initialized parent struct.
-     * @param[in] child - a pointer to an uninitialized bejReal type node.
-     * @param[in] name - name of the bejReal type property.
-     * @param[in] value - value of the bejReal type property.
-     */
-    void bejTreeAddReal(struct RedfishPropertyParent* parent,
-                        struct RedfishPropertyLeafReal* child, const char* name,
-                        double value);
+/**
+ * @brief Add a bejReal type node to a parent node.
+ *
+ * @param[in] parent - a pointer to an initialized parent struct.
+ * @param[in] child - a pointer to an uninitialized bejReal type node.
+ * @param[in] name - name of the bejReal type property.
+ * @param[in] value - value of the bejReal type property.
+ */
+void bejTreeAddReal(struct RedfishPropertyParent* parent,
+                    struct RedfishPropertyLeafReal* child, const char* name,
+                    double value);
 
-    /**
-     * @brief Set a new value in bejReal type node.
-     *
-     * @param[in] node - initialized bejReal type node.
-     * @param[in] newValue - new double value.
-     */
-    void bejTreeSetReal(struct RedfishPropertyLeafReal* node, double newValue);
+/**
+ * @brief Set a new value in bejReal type node.
+ *
+ * @param[in] node - initialized bejReal type node.
+ * @param[in] newValue - new double value.
+ */
+void bejTreeSetReal(struct RedfishPropertyLeafReal* node, double newValue);
 
-    /**
-     * @brief Add a bejBoolean type node to a parent node.
-     *
-     * @param[in] parent - a pointer to an initialized parent struct.
-     * @param[in] child - a pointer to an uninitialized bejBoolean type node.
-     * @param[in] name - name of the bejBoolean type property.
-     * @param[in] value - value of the bejBoolean type property.
-     */
-    void bejTreeAddBool(struct RedfishPropertyParent* parent,
-                        struct RedfishPropertyLeafBool* child, const char* name,
-                        bool value);
+/**
+ * @brief Add a bejBoolean type node to a parent node.
+ *
+ * @param[in] parent - a pointer to an initialized parent struct.
+ * @param[in] child - a pointer to an uninitialized bejBoolean type node.
+ * @param[in] name - name of the bejBoolean type property.
+ * @param[in] value - value of the bejBoolean type property.
+ */
+void bejTreeAddBool(struct RedfishPropertyParent* parent,
+                    struct RedfishPropertyLeafBool* child, const char* name,
+                    bool value);
 
-    /**
-     * @brief Link a node to its parent.
-     *
-     * @param[in] parent  - a pointer to an initialized parent struct.
-     * @param[in] child - a pointer to an initialized child struct.
-     */
-    void bejTreeLinkChildToParent(struct RedfishPropertyParent* parent,
-                                  void* child);
+/**
+ * @brief Link a node to its parent.
+ *
+ * @param[in] parent  - a pointer to an initialized parent struct.
+ * @param[in] child - a pointer to an initialized child struct.
+ */
+void bejTreeLinkChildToParent(struct RedfishPropertyParent* parent,
+                              void* child);
 
-    /**
-     * @brief Set Bej format flags of a node.
-     *
-     * @param node - an initialized node.
-     * @param deferredBinding - set deferred binding flag.
-     * @param readOnlyProperty - set read only property flag.
-     * @param nullableProperty - set nullable property flag.
-     */
-    void bejTreeUpdateNodeFlags(struct RedfishPropertyNode* node,
-                                bool deferredBinding, bool readOnlyProperty,
-                                bool nullableProperty);
+/**
+ * @brief Set Bej format flags of a node.
+ *
+ * @param node - an initialized node.
+ * @param deferredBinding - set deferred binding flag.
+ * @param readOnlyProperty - set read only property flag.
+ * @param nullableProperty - set nullable property flag.
+ */
+void bejTreeUpdateNodeFlags(struct RedfishPropertyNode* node,
+                            bool deferredBinding, bool readOnlyProperty,
+                            bool nullableProperty);
 
-    /**
-     * @brief Get the next child node to be processed.
-     *
-     * This function returns the next child node of the parent node. This also
-     * updates the parent node's next child properties.
-     *
-     * @param parent - parent node.
-     * @param currentChild - current child node being processed.
-     * @return pointer to the next child node to be processed. NULL if there is
-     * no next child or one of the params are NULL.
-     */
-    void* bejParentGoToNextChild(struct RedfishPropertyParent* parent,
-                                 struct RedfishPropertyNode* currentChild);
+/**
+ * @brief Get the next child node to be processed.
+ *
+ * This function returns the next child node of the parent node. This also
+ * updates the parent node's next child properties.
+ *
+ * @param parent - parent node.
+ * @param currentChild - current child node being processed.
+ * @return pointer to the next child node to be processed. NULL if there is
+ * no next child or one of the params are NULL.
+ */
+void* bejParentGoToNextChild(struct RedfishPropertyParent* parent,
+                             struct RedfishPropertyNode* currentChild);
 
 #ifdef __cplusplus
 }
diff --git a/test/bej_decoder_test.cpp b/test/bej_decoder_test.cpp
index 185b69c..b390017 100644
--- a/test/bej_decoder_test.cpp
+++ b/test/bej_decoder_test.cpp
@@ -190,6 +190,6 @@
     }),
     [](const testing::TestParamInfo<BejDecoderTest::ParamType>& info) {
     return info.param.testName;
-    });
+});
 
 } // namespace libbej
