move some code to the shop_on_rails gem