Improve config saving