[FEATURE] Code refactor calculating needed ledgers