internal rewrites