Make generate source a private function.