Update to use promises throughout