Trying to clean up code and fix bad behaviour of NBT Inventories