Restructure server.js