split out config generation into common.sh