server.js code a little cleaner