detect # of CPUs, simplify concurrency, cleaner cleanup