refactor with overrid private function