Refactored to make it all async