Convert asynchronous methods into yielding functions