decouples socket init on client