check totals
refactor