config: refactor the Config class