Renamed services and introduced socket variable