restructured
use of promises instead of async