optimize comparison