simplify inner loop of core-ns-download a bit