Use async library to clean up some hairy code