Refactored some NBT stuff