move uniq into function