config reading rewritten