improve duplicate logic and search tags