Modify mq-related codes
Refactor