Alternative replace-attrs impl - not sure if there's really any difference.