Improve config handling