more flexible static function