Refactor InventoryUtils