Refactor config to another class