Corrected and separated config extraction