Cleanup code to be compatible with latest amqp extension version