Code normalized.
Created a interface for sock impl.