Keeping logic the same, refactor to use promises