refactoring classes for exchange and channel creation