diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
index a3f03f8..842f59f 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
@@ -147,7 +147,7 @@
 
     public void saveKeyboardState() {
         if (mCurrentId != null) {
-            mState.onSaveKeyboardState(isAlphabetMode(), isSymbolShifted());
+            mState.onSaveKeyboardState();
         }
     }
 
@@ -278,9 +278,8 @@
         return mCurrentId != null ? mCurrentId.mMode : KeyboardId.MODE_TEXT;
     }
 
-    // TODO: Delegate to KeyboardState
     public boolean isAlphabetMode() {
-        return mCurrentId != null && mCurrentId.isAlphabetKeyboard();
+        return mState.isAlphabetMode();
     }
 
     public boolean isInputViewShown() {
@@ -354,44 +353,44 @@
      * Toggle keyboard shift state triggered by user touch event.
      */
     public void toggleShift() {
-        mState.onToggleShift(isAlphabetMode(), isSymbolShifted());
+        mState.onToggleShift();
     }
 
     /**
      * Toggle caps lock state triggered by user touch event.
      */
     public void toggleCapsLock() {
-        mState.onToggleCapsLock(isAlphabetMode());
+        mState.onToggleCapsLock();
     }
 
     /**
      * Toggle between alphabet and symbols modes triggered by user touch event.
      */
     public void toggleAlphabetAndSymbols() {
-        mState.onToggleAlphabetAndSymbols(isAlphabetMode());
+        mState.onToggleAlphabetAndSymbols();
     }
 
     /**
      * Update keyboard shift state triggered by connected EditText status change.
      */
     public void updateShiftState() {
-        mState.onUpdateShiftState(isAlphabetMode(), mInputMethodService.getCurrentAutoCapsState());
+        mState.onUpdateShiftState(mInputMethodService.getCurrentAutoCapsState());
     }
 
     public void onPressShift(boolean withSliding) {
-        mState.onPressShift(isAlphabetMode(), isSymbolShifted(), withSliding);
+        mState.onPressShift(withSliding);
     }
 
     public void onReleaseShift(boolean withSliding) {
-        mState.onReleaseShift(isAlphabetMode(), isSymbolShifted(), withSliding);
+        mState.onReleaseShift(withSliding);
     }
 
     public void onPressSymbol() {
-        mState.onPressSymbol(isAlphabetMode());
+        mState.onPressSymbol();
     }
 
     public void onReleaseSymbol() {
-        mState.onReleaseSymbol(isAlphabetMode());
+        mState.onReleaseSymbol();
     }
 
     public void onOtherKeyPressed() {
@@ -399,7 +398,7 @@
     }
 
     public void onCancelInput() {
-        mState.onCancelInput(isAlphabetMode(), isSymbolShifted(), isSinglePointer());
+        mState.onCancelInput(isSinglePointer());
     }
 
     // Implements {@link KeyboardState.SwitchActions}.
@@ -414,11 +413,6 @@
         setKeyboard(getKeyboard(mMainKeyboardId));
     }
 
-    // TODO: Remove this method
-    private boolean isSymbolShifted() {
-        return mCurrentId != null && mCurrentId.equals(mSymbolsShiftedKeyboardId);
-    }
-
     // Implements {@link KeyboardState.SwitchActions}.
     @Override
     public void setSymbolsShiftedKeyboard() {
@@ -445,7 +439,7 @@
      * Updates state machine to figure out when to automatically snap back to the previous mode.
      */
     public void onCodeInput(int code) {
-        mState.onCodeInput(isAlphabetMode(), isSymbolShifted(), code, isSinglePointer());
+        mState.onCodeInput(code, isSinglePointer());
     }
 
     public LatinKeyboardView getKeyboardView() {
@@ -495,13 +489,14 @@
     }
 
     private void postSetInputView(final View newInputView) {
-        mInputMethodService.mHandler.post(new Runnable() {
+        final LatinIME latinIme = mInputMethodService;
+        latinIme.mHandler.post(new Runnable() {
             @Override
             public void run() {
                 if (newInputView != null) {
-                    mInputMethodService.setInputView(newInputView);
+                    latinIme.setInputView(newInputView);
                 }
-                mInputMethodService.updateInputViewShown();
+                latinIme.updateInputViewShown();
             }
         });
     }
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java
index f7ec08d..2a8f9f4 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java
@@ -26,7 +26,12 @@
  * Keyboard state machine.
  *
  * This class contains all keyboard state transition logic.
- * TODO: List up input events and actions.
+ * The input events are {@link #onLoadKeyboard(String, boolean)}, {@link #onSaveKeyboardState()},
+ * {@link #onPressShift(boolean)}, {@link #onReleaseShift(boolean)}, {@link #onPressSymbol()},
+ * {@link #onReleaseSymbol()}, {@link #onOtherKeyPressed()}, {@link #onCodeInput(int, boolean)},
+ * {@link #onCancelInput(boolean)}, {@link #onUpdateShiftState(boolean)}, {@link #onToggleShift()},
+ * {@link #onToggleCapsLock()}, and {@link #onToggleAlphabetAndSymbols()}.
+ * The actions are {@link SwitchActions}'s methods.
  */
 public class KeyboardState {
     private static final String TAG = KeyboardState.class.getSimpleName();
@@ -63,10 +68,13 @@
 
     private final SwitchActions mSwitchActions;
 
+    private boolean mIsAlphabetMode;
+    private boolean mIsSymbolShifted;
+
     private final SavedKeyboardState mSavedKeyboardState = new SavedKeyboardState();
     private boolean mPrevMainKeyboardWasShiftLocked;
 
-    private static class SavedKeyboardState {
+    static class SavedKeyboardState {
         public boolean mIsValid;
         public boolean mIsAlphabetMode;
         public boolean mIsShiftLocked;
@@ -91,16 +99,15 @@
         onRestoreKeyboardState();
     }
 
-    // TODO: Get rid of isAlphabetMode and isSymbolShifted arguments.
-    public void onSaveKeyboardState(boolean isAlphabetMode, boolean isSymbolShifted) {
+    public void onSaveKeyboardState() {
         final SavedKeyboardState state = mSavedKeyboardState;
-        state.mIsAlphabetMode = isAlphabetMode;
-        if (isAlphabetMode) {
+        state.mIsAlphabetMode = mIsAlphabetMode;
+        if (mIsAlphabetMode) {
             state.mIsShiftLocked = isShiftLocked();
             state.mIsShifted = !state.mIsShiftLocked && isShiftedOrShiftLocked();
         } else {
             state.mIsShiftLocked = false;
-            state.mIsShifted = isSymbolShifted;
+            state.mIsShifted = mIsSymbolShifted;
         }
         state.mIsValid = true;
         if (DEBUG_STATE) {
@@ -137,6 +144,10 @@
         }
     }
 
+    public boolean isAlphabetMode() {
+        return mIsAlphabetMode;
+    }
+
     public boolean isShiftLocked() {
         return mKeyboardShiftState.isShiftLocked();
     }
@@ -190,16 +201,16 @@
         mSwitchActions.setShiftLocked(shiftLocked);
     }
 
-    private void toggleAlphabetAndSymbols(boolean isAlphabetMode) {
-        if (isAlphabetMode) {
+    private void toggleAlphabetAndSymbols() {
+        if (mIsAlphabetMode) {
             setSymbolsKeyboard();
         } else {
             setAlphabetKeyboard();
         }
     }
 
-    private void toggleShiftInSymbols(boolean isSymbolShifted) {
-        if (isSymbolShifted) {
+    private void toggleShiftInSymbols() {
+        if (mIsSymbolShifted) {
             setSymbolsKeyboard();
         } else {
             setSymbolsShiftedKeyboard();
@@ -211,6 +222,8 @@
             Log.d(TAG, "setAlphabetKeyboard");
         }
         mSwitchActions.setAlphabetKeyboard();
+        mIsAlphabetMode = true;
+        mIsSymbolShifted = false;
         mSwitchState = SWITCH_STATE_ALPHA;
         setShiftLocked(mPrevMainKeyboardWasShiftLocked);
         mPrevMainKeyboardWasShiftLocked = false;
@@ -222,6 +235,8 @@
         }
         mPrevMainKeyboardWasShiftLocked = isShiftLocked();
         mSwitchActions.setSymbolsKeyboard();
+        mIsAlphabetMode = false;
+        mIsSymbolShifted = false;
         mSwitchState = SWITCH_STATE_SYMBOL_BEGIN;
     }
 
@@ -230,28 +245,28 @@
             Log.d(TAG, "setSymbolsShiftedKeyboard");
         }
         mSwitchActions.setSymbolsShiftedKeyboard();
+        mIsAlphabetMode = false;
+        mIsSymbolShifted = true;
         mSwitchState = SWITCH_STATE_SYMBOL_BEGIN;
     }
 
-    // TODO: Get rid of isAlphabetMode argument.
-    public void onPressSymbol(boolean isAlphabetMode) {
+    public void onPressSymbol() {
         if (DEBUG_STATE) {
             Log.d(TAG, "onPressSymbol: " + this);
         }
-        toggleAlphabetAndSymbols(isAlphabetMode);
+        toggleAlphabetAndSymbols();
         mSymbolKeyState.onPress();
         mSwitchState = SWITCH_STATE_MOMENTARY_ALPHA_AND_SYMBOL;
     }
 
-    // TODO: Get rid of isAlphabetMode argument.
-    public void onReleaseSymbol(boolean isAlphabetMode) {
+    public void onReleaseSymbol() {
         if (DEBUG_STATE) {
             Log.d(TAG, "onReleaseSymbol: " + this);
         }
         // Snap back to the previous keyboard mode if the user chords the mode change key and
         // another key, then releases the mode change key.
         if (mSwitchState == SWITCH_STATE_CHORDING_ALPHA) {
-            toggleAlphabetAndSymbols(isAlphabetMode);
+            toggleAlphabetAndSymbols();
         }
         mSymbolKeyState.onRelease();
     }
@@ -264,12 +279,11 @@
         mSymbolKeyState.onOtherKeyPressed();
     }
 
-    // TODO: Get rid of isAlphabetMode argument.
-    public void onUpdateShiftState(boolean isAlphabetMode, boolean autoCaps) {
+    public void onUpdateShiftState(boolean autoCaps) {
         if (DEBUG_STATE) {
             Log.d(TAG, "onUpdateShiftState: " + this + " autoCaps=" + autoCaps);
         }
-        if (isAlphabetMode) {
+        if (mIsAlphabetMode) {
             if (!isShiftLocked() && !mShiftKeyState.isIgnoring()) {
                 if (mShiftKeyState.isReleasing() && autoCaps) {
                     // Only when shift key is releasing, automatic temporary upper case will be set.
@@ -286,12 +300,11 @@
         }
     }
 
-    // TODO: Get rid of isAlphabetMode and isSymbolShifted arguments.
-    public void onPressShift(boolean isAlphabetMode, boolean isSymbolShifted, boolean withSliding) {
+    public void onPressShift(boolean withSliding) {
         if (DEBUG_STATE) {
             Log.d(TAG, "onPressShift: " + this + " sliding=" + withSliding);
         }
-        if (isAlphabetMode) {
+        if (mIsAlphabetMode) {
             if (isShiftLocked()) {
                 // Shift key is pressed while caps lock state, we will treat this state as shifted
                 // caps lock state and mark as if shift key pressed while normal state.
@@ -313,19 +326,17 @@
             }
         } else {
             // In symbol mode, just toggle symbol and symbol more keyboard.
-            toggleShiftInSymbols(isSymbolShifted);
+            toggleShiftInSymbols();
             mSwitchState = SWITCH_STATE_MOMENTARY_SYMBOL_AND_MORE;
             mShiftKeyState.onPress();
         }
     }
 
-    // TODO: Get rid of isAlphabetMode and isSymbolShifted arguments.
-    public void onReleaseShift(boolean isAlphabetMode, boolean isSymbolShifted,
-            boolean withSliding) {
+    public void onReleaseShift(boolean withSliding) {
         if (DEBUG_STATE) {
             Log.d(TAG, "onReleaseShift: " + this + " sliding=" + withSliding);
         }
-        if (isAlphabetMode) {
+        if (mIsAlphabetMode) {
             final boolean isShiftLocked = isShiftLocked();
             if (mShiftKeyState.isMomentary()) {
                 // After chording input while normal state.
@@ -350,24 +361,22 @@
             // In symbol mode, snap back to the previous keyboard mode if the user chords the shift
             // key and another key, then releases the shift key.
             if (mSwitchState == SWITCH_STATE_CHORDING_SYMBOL) {
-                toggleShiftInSymbols(isSymbolShifted);
+                toggleShiftInSymbols();
             }
         }
         mShiftKeyState.onRelease();
     }
 
-    // TODO: Get rid of isAlphabetMode and isSymbolShifted arguments.
-    public void onCancelInput(boolean isAlphabetMode, boolean isSymbolShifted,
-            boolean isSinglePointer) {
+    public void onCancelInput(boolean isSinglePointer) {
         if (DEBUG_STATE) {
             Log.d(TAG, "onCancelInput: isSinglePointer=" + isSinglePointer + " " + this);
         }
         // Snap back to the previous keyboard mode if the user cancels sliding input.
         if (isSinglePointer) {
             if (mSwitchState == SWITCH_STATE_MOMENTARY_ALPHA_AND_SYMBOL) {
-                toggleAlphabetAndSymbols(isAlphabetMode);
+                toggleAlphabetAndSymbols();
             } else if (mSwitchState == SWITCH_STATE_MOMENTARY_SYMBOL_AND_MORE) {
-                toggleShiftInSymbols(isSymbolShifted);
+                toggleShiftInSymbols();
             }
         }
     }
@@ -387,9 +396,7 @@
         return false;
     }
 
-    // TODO: Get rid of isAlphabetMode and isSymbolShifted arguments.
-    public void onCodeInput(boolean isAlphabetMode, boolean isSymbolShifted, int code,
-            boolean isSinglePointer) {
+    public void onCodeInput(int code, boolean isSinglePointer) {
         if (DEBUG_STATE) {
             Log.d(TAG, "onCodeInput: code=" + code + " isSinglePointer=" + isSinglePointer
                     + " " + this);
@@ -404,7 +411,7 @@
             // {@link #SWITCH_STATE_MOMENTARY}.
             if (code == Keyboard.CODE_SWITCH_ALPHA_SYMBOL) {
                 // Detected only the mode change key has been pressed, and then released.
-                if (isAlphabetMode) {
+                if (mIsAlphabetMode) {
                     mSwitchState = SWITCH_STATE_ALPHA;
                 } else {
                     mSwitchState = SWITCH_STATE_SYMBOL_BEGIN;
@@ -414,7 +421,7 @@
                 // and slid to other key, then released the finger.
                 // If the user cancels the sliding input, snapping back to the previous keyboard
                 // mode is handled by {@link #onCancelInput}.
-                toggleAlphabetAndSymbols(isAlphabetMode);
+                toggleAlphabetAndSymbols();
             } else {
                 // Chording input is being started. The keyboard mode will be snapped back to the
                 // previous mode in {@link onReleaseSymbol} when the mode change key is released.
@@ -428,7 +435,7 @@
             } else if (isSinglePointer) {
                 // Snap back to the previous keyboard mode if the user pressed the shift key on
                 // symbol mode and slid to other key, then released the finger.
-                toggleShiftInSymbols(isSymbolShifted);
+                toggleShiftInSymbols();
                 mSwitchState = SWITCH_STATE_SYMBOL;
             } else {
                 // Chording input is being started. The keyboard mode will be snapped back to the
@@ -456,25 +463,23 @@
         }
     }
 
-    // TODO: Get rid of isAlphabetMode and isSymbolShifted arguments.
-    public void onToggleShift(boolean isAlphabetMode, boolean isSymbolShifted) {
+    public void onToggleShift() {
         if (DEBUG_STATE) {
             Log.d(TAG, "onToggleShift: " + this);
         }
-        if (isAlphabetMode) {
+        if (mIsAlphabetMode) {
             setShifted(isShiftedOrShiftLocked()
                     ? SwitchActions.UNSHIFT : SwitchActions.MANUAL_SHIFT);
         } else {
-            toggleShiftInSymbols(isSymbolShifted);
+            toggleShiftInSymbols();
         }
     }
 
-    // TODO: Get rid of isAlphabetMode arguments.
-    public void onToggleCapsLock(boolean isAlphabetMode) {
+    public void onToggleCapsLock() {
         if (DEBUG_STATE) {
             Log.d(TAG, "onToggleCapsLock: " + this);
         }
-        if (isAlphabetMode) {
+        if (mIsAlphabetMode) {
             if (isShiftLocked()) {
                 setShiftLocked(false);
                 // Shift key is long pressed while caps lock state, we will toggle back to normal
@@ -486,12 +491,11 @@
         }
     }
 
-    // TODO: Get rid of isAlphabetMode arguments.
-    public void onToggleAlphabetAndSymbols(boolean isAlphabetMode) {
+    public void onToggleAlphabetAndSymbols() {
         if (DEBUG_STATE) {
             Log.d(TAG, "onToggleAlphabetAndSymbols: " + this);
         }
-        toggleAlphabetAndSymbols(isAlphabetMode);
+        toggleAlphabetAndSymbols();
     }
 
     private static String shiftModeToString(int shiftMode) {
