Code improvements using the feedback from Alex
Added example of custom duplicatedetection