optimized config reading and saving