optimize compareable object