refactoring server channel