Clean up socket handlers in views