refactoring shop.js slightly