Documenting & socket refactoring