refactoring on tests