server.js: code cleanup