remove duplication in tests