[ Restructing server.js ]