Chapter8 : (227) Replace Type Code with State/Strategy