Refactor and add comments to server-config.js