Improve for writing config