Make it less tightly coupled with socket.io