cleanup of ns.c