Raise an error to make it more testable
Move config handling to separate module, test it