State related refactoring