```\nfunction handleAggregatedOps(\n    UserOpsPerAggregator[] calldata opsPerAggregator,\n    address payable beneficiary\n) public nonReentrant {\n\n    uint256 opasLen = opsPerAggregator.length;\n    uint256 totalOps = 0;\n    for (uint256 i = 0; i < opasLen; i++) {\n        UserOpsPerAggregator calldata opa = opsPerAggregator[i];\n        UserOperation[] calldata ops = opa.userOps;\n        IAggregator aggregator = opa.aggregator;\n\n        //address(1) is special marker of "signature error"\n        require(address(aggregator) != address(1), "AA96 invalid aggregator");\n\n        if (address(aggregator) != address(0)) {\n            // solhint-disable-next-line no-empty-blocks\n            try aggregator.validateSignatures(ops, opa.signature) {}\n            catch {\n                revert SignatureValidationFailed(address(aggregator));\n            }\n        }\n\n        totalOps += ops.length;\n    }\n\n    UserOpInfo[] memory opInfos = new UserOpInfo[](totalOps);\n\n    emit BeforeExecution();\n\n    uint256 opIndex = 0;\n    for (uint256 a = 0; a < opasLen; a++) {\n        UserOpsPerAggregator calldata opa = opsPerAggregator[a];\n        UserOperation[] calldata ops = opa.userOps;\n        IAggregator aggregator = opa.aggregator;\n\n        uint256 opslen = ops.length;\n        for (uint256 i = 0; i < opslen; i++) {\n            UserOpInfo memory opInfo = opInfos[opIndex];\n            (uint256 validationData, uint256 paymasterValidationData) = _validatePrepayment(opIndex, ops[i], opInfo);\n            _validateAccountAndPaymasterValidationData(i, validationData, paymasterValidationData, address(aggregator));\n            opIndex++;\n        }\n    }\n\n    uint256 collected = 0;\n    opIndex = 0;\n    for (uint256 a = 0; a < opasLen; a++) {\n        UserOpsPerAggregator calldata opa = opsPerAggregator[a];\n        emit SignatureAggregatorChanged(address(opa.aggregator));\n        UserOperation[] calldata ops = opa.userOps;\n        uint256 opslen = ops.length;\n\n        for (uint256 i = 0; i < opslen; i++) {\n            collected += _executeUserOp(opIndex, ops[i], opInfos[opIndex]);\n            opIndex++;\n        }\n    }\n    emit SignatureAggregatorChanged(address(0));\n\n    _compensate(beneficiary, collected);\n}\n```\n