State Pattern Example Implementation
Refactored according to the State Pattern