simplify complicated test