simplify test logic