Modularize socket connections for visualizers