Server.js refactory