Use `Array#sort_by` instead