Coroutine like approach