Could be a good idea to replace the promises with async/await form? I feel it would make the code more readable, but might needs support for an async/await polyfill?