Refactor binop and unop