Refactor config generation and expose as public function on Client