Refactoring state sequence table