```\n    function _addKeysAndLoansInfo(\n        bool update,\n        bytes32 borrowingKey,\n        LoanInfo[] memory sourceLoans\n    ) private {\n        // Get the storage reference to the loans array for the borrowing key\n        LoanInfo[] storage loans = loansInfo[borrowingKey];\n        // Iterate through the sourceLoans array\n        for (uint256 i; i < sourceLoans.length; ) {\n            // Get the current loan from the sourceLoans array\n            LoanInfo memory loan = sourceLoans[i];\n            // Get the storage reference to the tokenIdLoansKeys array for the loan's token ID\n            bytes32[] storage tokenIdLoansKeys = tokenIdToBorrowingKeys[loan.tokenId];\n            // Conditionally add or push the borrowing key to the tokenIdLoansKeys array based on the 'update' flag\n            update\n                ? tokenIdLoansKeys.addKeyIfNotExists(borrowingKey)\n                : tokenIdLoansKeys.push(borrowingKey);\n    // rest of code\n```\n