stop_all_threads, refactor