Remove mega-macro, replace by static function.