REV: refactor socket/index.js