Better name for the codec switching variable
Error handling in protocol in case of failing generate (parse is already properly handled)
Refactor handleOutgoing to make it more readable (more explicit code fork, smaller function size)