refactor: move message handling internals to use async/await
#1656
+827
−50
async/await
#1656