Refactored model: split states and commands