Initial re-write for shopify platform.