added a dedup optimizer.