This should be a private function.