Replace tilde with to_owned