simplify test helper function