Completed async logic but it got quite gnarly