Make wait a promise and a helper