Using config module directly
Cleanups
Do not open all files at once (ported from master)