Extract out lazy_to_promise function