working with restarts, cleaning targets, spawn, keyboard interrup, thread safe shutdown