Simplify run_task() and change wait() to join()