Cleaner way to prevent infinite loops due to implicit continuations