refactoring pre new inventory system