To know the remaining balance after distribution, it could be relevant to keep a track of the distributed sum for a specific dividend.
Example
mapping(uint256 => uint256) public segregatedDividendClaimed;
And rename segregatedDividend in segregatedDividendDeposit
When a dividend is deposit:
segregatedDividendClaimed += value
When a dividend is claimed
segregatedDividendClaimed -= value
After the end of the distribution, it is easier for the operator to withdraw the remaining dividends after distribution
To know the remaining balance after distribution, it could be relevant to keep a track of the distributed sum for a specific dividend.
Example
mapping(uint256 => uint256) public segregatedDividendClaimed;
And rename
segregatedDividendinsegregatedDividendDepositWhen a dividend is deposit:
segregatedDividendClaimed += valueWhen a dividend is claimed
segregatedDividendClaimed -= valueAfter the end of the distribution, it is easier for the operator to withdraw the remaining dividends after distribution