Improved automatic config generation