fixed bug in accruals rake; refactor in other places