more refactoring on tests