Refactor MQ Example.