Refactor config class 825

Fixes #825 
This is hard to review given GitHub's diff; did you just dedent it and turn into function rather than method, or was there more stuff done?