refacotr complete in sock setup