refactor arith