refactor shopping cart total