refactor handler to CLI and utils classes and add new AMQP handler type