Added State Pattern.