It would be nice to hear why and how promises are used here, perhaps in comments?