Move static function closer to its use