Refactor cart model