Factor out config