reliable messaging example refactor