refactoring state specs