modify the code to remove socket related class