refactoring multisock