refactored NBT system for better encapsulation