move some function from main.js to shoppingCart