Improved configuration handling