more variants of rewrite_all (I should find notation for this)