RabbitMQ  - Code refactoring