ticket:10 some dup detection rework

Old code works for me but fails on barista