refactored for the static function