Optimize comparison