Refactor used_inventory_data()