NOT WORKING First draft of inventory refactor