Refactor config.py to make it more testable