Extracting some inventory-ish hackery