Refactoring:CommandPublisher,CommandConsumer made to work with endpoints