Refactoring duplicates detector to take advantage from same interface - ModelService with InMemoryModelService