Make 'dedupe' more Ruby-ish