Minor refactoring on test