Fixed refactoring on tests