Minor code movement and static function.