Some minor refactorings
Merge pull request #10 from iHiD/extract_socket

Some minor refactorings