Refactoring for fileConfig. Contributed by Shane Hathaway.