Minor refactoring for specs