started refactoring state implementations