Improved config generation