Move debug method to private function.