Again this is from a weird implementation within Shopify. But you are right, a simpler generic version is necessary if it's going to be included in Batman core.