switch to promises for readability and more es6iness