Refactor config for a better decoupling