implementing NBTFactory changes and a little clean up