refactored the cart model methods.