Use `async` to do flow control

Remove an instance of callback hell.