centralize into config.js and other cleanup