Reduce boilerplate in asynchronous callbacks