Small restructure in server.js