simplify test code slightly