move network code into async tasks