minor refactorings
test updated with socket