Refactoring into cart