manual matching for rewrites