refactor tcp transport server