First pass a rewrite tag replacement