Rewriting for generic import