remove some duplication in test