unify test code