WIP on promise-based version.