fixup and simplify NBTTransformer