Move single used private function to local scope