This really should be factored out into it's own class a ConfigFileParser which can be injected and mocked.