refactored to only when a rewrite is found ... -sai