Issue 8000 by tj: Moved configuration file read out of function