Started remake of state manager