refactoring inventory data