Refactor of rabbitmq queue implementation.