Deduplication-document - code cleaning

and alternative implementation of WorkComparator