Speed up the duplicates filtering process

This uses JQuery's built-in .unique method to filter out duplicate, reducing the code size and making the process much faster