fix configuration, remove debug code, optimize nbtfactory