[CHORE] Refactored parseBalanceChanges function