clean up handling of Promises