refactoring method add product to cart