Step 4 - Refactoring Socket.io