Reworked duplicate checker logic.