code cleaning: reduce repetition of tests on environment