refactoring interfaces (createPublisher, createSubscriber)