Simplification and refactoring or the inventory listener class.