optimize configs.py format and main function, mod explanation of config tpl