some more refactoring on tests