Refactor ItemShop function