Refactoring and renamed reference to Socket instance.