finish generic4 macro rewrite