Factored out reviver/replacer, see #103