improve config loading