Write elegant asynchronous code