capped: move binop handling into a separate function