reduce some duplicate code in binary expression evaluation