Refactor for usage with Message-Queue protocol