refactoring state change etc