Reorganized some stuff with socket.io server