code cleanup in server.js