MQ cache refactoring