Refactor send_reply