Pass socket around instead of the entire state