worldserver.js refactoring