+ refactor socket usage in monitor-app.js