```\nfor (uint256 i = 0; i < epochNumbers.length; i++) {\n    if (\_claimedRewardsPerEpoch[shareId][epochNumbers[i]][\_msgSender()]) revert AlreadyClaimed();\n    \_claimedRewardsPerEpoch[shareId][epochNumbers[i]][\_msgSender()] = true;\n    uint256 epochRewards = \_availableReward(shareId, isDelegator, epochNumbers[i], \_msgSender());\n    SafeERC20.safeTransfer(rewardsToken, \_msgSender(), epochRewards);\n    emit ClaimedRewards(subjectType, subjectId, \_msgSender(), epochNumbers[i], epochRewards);\n```\n