shopping cart refactor