Refactoring ChannelFactory