simplify logics in filter tests, remove redundant code in arithm tests