Refactored debt to debit
Added in metrics helper function