code duplication in tests eliminated