rewriteNonFunctions() is a utility without closure.