improved configuration handling