Refactores duplication calculation