Using coroutines instead of threads