State/Factory/Strategy pattern example