refactoring, repairAddToCart