This is subjective so feel free to completely ignore this comment, but I think this function is too long and would be easier to understand if refactored to use a couple of function calls. *e.g.* `maybe_send_caller` and `process_response_reply`. Another option I would like better would be to use a few function clauses to replace the `case` statements.