minor refactoring
created serverConfig.js
refactored code