Refactored oldMode into StateManager