unified state in server before refactoring to prototype
unified state in server before refactoring to prototype
more refactorings of server.js