Deleted unnecessary code
State pattern committed
Observer pattern committed.