refactoring to pass queue name and handler functions while subscribing to amqp queues