Add factory method to the Config class