diff --git a/java/proguard.flags b/java/proguard.flags
index 44416ec..3959500 100644
--- a/java/proguard.flags
+++ b/java/proguard.flags
@@ -31,6 +31,6 @@
   *;
 }
 
--keep class com.android.inputmethod.keyboard.internal.MiniKeyboardBuilder$MiniKeyboardLayoutParams {
+-keep class com.android.inputmethod.keyboard.internal.MiniKeyboardBuilder$MiniKeyboardParams {
   <init>(...);
 }
diff --git a/java/src/com/android/inputmethod/deprecated/languageswitcher/InputLanguageSelection.java b/java/src/com/android/inputmethod/deprecated/languageswitcher/InputLanguageSelection.java
index cf6cd0f..e75559e 100644
--- a/java/src/com/android/inputmethod/deprecated/languageswitcher/InputLanguageSelection.java
+++ b/java/src/com/android/inputmethod/deprecated/languageswitcher/InputLanguageSelection.java
@@ -16,7 +16,7 @@
 
 package com.android.inputmethod.deprecated.languageswitcher;
 
-import com.android.inputmethod.keyboard.internal.KeyboardParser;
+import com.android.inputmethod.keyboard.internal.KeyboardBuilder;
 import com.android.inputmethod.latin.DictionaryFactory;
 import com.android.inputmethod.latin.R;
 import com.android.inputmethod.latin.Settings;
@@ -162,7 +162,7 @@
 
         try {
             final String localeStr = locale.toString();
-            final String[] layoutCountryCodes = KeyboardParser.parseKeyboardLocale(
+            final String[] layoutCountryCodes = KeyboardBuilder.parseKeyboardLocale(
                     this, R.xml.kbd_qwerty).split(",", -1);
             if (!TextUtils.isEmpty(localeStr) && layoutCountryCodes.length > 0) {
                 for (String s : layoutCountryCodes) {
diff --git a/java/src/com/android/inputmethod/keyboard/Key.java b/java/src/com/android/inputmethod/keyboard/Key.java
index 8bc7e43..57a354e 100644
--- a/java/src/com/android/inputmethod/keyboard/Key.java
+++ b/java/src/com/android/inputmethod/keyboard/Key.java
@@ -28,8 +28,8 @@
 import com.android.inputmethod.keyboard.internal.KeyStyles.KeyStyle;
 import com.android.inputmethod.keyboard.internal.KeyboardIconsSet;
 import com.android.inputmethod.keyboard.internal.KeyboardParams;
-import com.android.inputmethod.keyboard.internal.KeyboardParser;
-import com.android.inputmethod.keyboard.internal.KeyboardParser.ParseException;
+import com.android.inputmethod.keyboard.internal.KeyboardBuilder;
+import com.android.inputmethod.keyboard.internal.KeyboardBuilder.ParseException;
 import com.android.inputmethod.keyboard.internal.PopupCharactersParser;
 import com.android.inputmethod.keyboard.internal.Row;
 import com.android.inputmethod.latin.R;
@@ -235,14 +235,14 @@
                 R.styleable.Keyboard);
         int keyWidth;
         try {
-            mHeight = KeyboardParser.getDimensionOrFraction(keyboardAttr,
+            mHeight = KeyboardBuilder.getDimensionOrFraction(keyboardAttr,
                     R.styleable.Keyboard_rowHeight,
                     params.mHeight, row.mRowHeight) - params.mVerticalGap;
-            mHorizontalGap = KeyboardParser.getDimensionOrFraction(keyboardAttr,
+            mHorizontalGap = KeyboardBuilder.getDimensionOrFraction(keyboardAttr,
                     R.styleable.Keyboard_horizontalGap,
                     params.mWidth, params.mHorizontalGap);
             mVerticalGap = params.mVerticalGap;
-            keyWidth = KeyboardParser.getDimensionOrFraction(keyboardAttr,
+            keyWidth = KeyboardBuilder.getDimensionOrFraction(keyboardAttr,
                     R.styleable.Keyboard_keyWidth,
                     params.mWidth, row.mDefaultKeyWidth);
         } finally {
@@ -263,7 +263,7 @@
             }
 
             final int keyboardWidth = params.mOccupiedWidth;
-            int keyXPos = KeyboardParser.getDimensionOrFraction(keyAttr,
+            int keyXPos = KeyboardBuilder.getDimensionOrFraction(keyAttr,
                     R.styleable.Keyboard_Key_keyXPos, keyboardWidth, x);
             if (keyXPos < 0) {
                 // If keyXPos is negative, the actual x-coordinate will be k + keyXPos.
@@ -317,9 +317,9 @@
             mEdgeFlags = 0;
 
             final KeyboardIconsSet iconsSet = params.mIconsSet;
-            mVisualInsetsLeft = KeyboardParser.getDimensionOrFraction(keyAttr,
+            mVisualInsetsLeft = KeyboardBuilder.getDimensionOrFraction(keyAttr,
                     R.styleable.Keyboard_Key_visualInsetsLeft, keyboardWidth, 0);
-            mVisualInsetsRight = KeyboardParser.getDimensionOrFraction(keyAttr,
+            mVisualInsetsRight = KeyboardBuilder.getDimensionOrFraction(keyAttr,
                     R.styleable.Keyboard_Key_visualInsetsRight, keyboardWidth, 0);
             mPreviewIcon = iconsSet.getIcon(style.getInt(
                     keyAttr, R.styleable.Keyboard_Key_keyIconPreview,
diff --git a/java/src/com/android/inputmethod/keyboard/KeyDetector.java b/java/src/com/android/inputmethod/keyboard/KeyDetector.java
index 53d46a3..0a3acb4 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyDetector.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyDetector.java
@@ -153,7 +153,7 @@
     }
 
     private void getNearbyKeyCodes(final int[] allCodes) {
-        final List<Key> keys = getKeyboard().getKeys();
+        final List<Key> keys = getKeyboard().mKeys;
         final int[] indices = mIndices;
 
         // allCodes[0] should always have the key code even if it is a non-letter key.
@@ -187,7 +187,7 @@
      * @return The nearest key index
      */
     public int getKeyIndexAndNearbyCodes(int x, int y, final int[] allCodes) {
-        final List<Key> keys = getKeyboard().getKeys();
+        final List<Key> keys = getKeyboard().mKeys;
         final int touchX = getTouchX(x);
         final int touchY = getTouchY(y);
 
diff --git a/java/src/com/android/inputmethod/keyboard/Keyboard.java b/java/src/com/android/inputmethod/keyboard/Keyboard.java
index 809c949..d5e75d0 100644
--- a/java/src/com/android/inputmethod/keyboard/Keyboard.java
+++ b/java/src/com/android/inputmethod/keyboard/Keyboard.java
@@ -153,11 +153,6 @@
         return mProximityInfo.getNativeProximityInfo();
     }
 
-    // TODO: Access mKeys directly
-    public List<Key> getKeys() {
-        return mKeys;
-    }
-
     public boolean hasShiftLockKey() {
         return !mShiftLockKeys.isEmpty();
     }
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
index 0fb5109..d1fd7e3 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
@@ -448,7 +448,7 @@
             canvas.translate(-keyDrawX, -keyDrawY);
         } else {
             // Draw all keys.
-            for (final Key key : mKeyboard.getKeys()) {
+            for (final Key key : mKeyboard.mKeys) {
                 final int keyDrawX = key.mX + key.mVisualInsetsLeft + getPaddingLeft();
                 final int keyDrawY = key.mY + getPaddingTop();
                 canvas.translate(keyDrawX, keyDrawY);
diff --git a/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java b/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java
index 9a13608..3cba529 100644
--- a/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java
+++ b/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java
@@ -31,8 +31,8 @@
 import android.graphics.drawable.Drawable;
 import android.text.TextUtils;
 
+import com.android.inputmethod.keyboard.internal.KeyboardBuilder;
 import com.android.inputmethod.keyboard.internal.KeyboardParams;
-import com.android.inputmethod.keyboard.internal.KeyboardParser;
 import com.android.inputmethod.latin.R;
 import com.android.inputmethod.latin.SubtypeSwitcher;
 
@@ -118,7 +118,7 @@
         }
     }
 
-    public static class Builder extends KeyboardParser<LatinKeyboardParams> {
+    public static class Builder extends KeyboardBuilder<LatinKeyboardParams> {
         public Builder(Context context) {
             super(context, new LatinKeyboardParams());
         }
diff --git a/java/src/com/android/inputmethod/keyboard/MiniKeyboard.java b/java/src/com/android/inputmethod/keyboard/MiniKeyboard.java
index 7f5339d..08e7d7e 100644
--- a/java/src/com/android/inputmethod/keyboard/MiniKeyboard.java
+++ b/java/src/com/android/inputmethod/keyboard/MiniKeyboard.java
@@ -16,12 +16,12 @@
 
 package com.android.inputmethod.keyboard;
 
-import com.android.inputmethod.keyboard.internal.MiniKeyboardBuilder.MiniKeyboardLayoutParams;
+import com.android.inputmethod.keyboard.internal.MiniKeyboardBuilder.MiniKeyboardParams;
 
 public class MiniKeyboard extends Keyboard {
     private final int mDefaultKeyCoordX;
 
-    public MiniKeyboard(MiniKeyboardLayoutParams params) {
+    public MiniKeyboard(MiniKeyboardParams params) {
         super(params);
         mDefaultKeyCoordX = params.getDefaultKeyCoordX() + params.mDefaultKeyWidth / 2;
     }
diff --git a/java/src/com/android/inputmethod/keyboard/MiniKeyboardKeyDetector.java b/java/src/com/android/inputmethod/keyboard/MiniKeyboardKeyDetector.java
index 1ec0dda..84bd44c 100644
--- a/java/src/com/android/inputmethod/keyboard/MiniKeyboardKeyDetector.java
+++ b/java/src/com/android/inputmethod/keyboard/MiniKeyboardKeyDetector.java
@@ -37,7 +37,7 @@
 
     @Override
     public int getKeyIndexAndNearbyCodes(int x, int y, final int[] allCodes) {
-        final List<Key> keys = getKeyboard().getKeys();
+        final List<Key> keys = getKeyboard().mKeys;
         final int touchX = getTouchX(x);
         final int touchY = getTouchY(y);
 
diff --git a/java/src/com/android/inputmethod/keyboard/PointerTracker.java b/java/src/com/android/inputmethod/keyboard/PointerTracker.java
index 3d8a9cf..dc2d6e4 100644
--- a/java/src/com/android/inputmethod/keyboard/PointerTracker.java
+++ b/java/src/com/android/inputmethod/keyboard/PointerTracker.java
@@ -285,7 +285,7 @@
     public void setKeyDetectorInner(KeyDetector keyDetector) {
         mKeyDetector = keyDetector;
         mKeyboard = keyDetector.getKeyboard();
-        mKeys = mKeyboard.getKeys();
+        mKeys = mKeyboard.mKeys;
         final int keyQuarterWidth = mKeyboard.mMostCommonKeyWidth / 4;
         mKeyQuarterWidthSquared = keyQuarterWidth * keyQuarterWidth;
     }
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyStyles.java b/java/src/com/android/inputmethod/keyboard/internal/KeyStyles.java
index 3f9f359..c0dba41 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/KeyStyles.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/KeyStyles.java
@@ -20,7 +20,7 @@
 import android.content.res.XmlResourceParser;
 import android.util.Log;
 
-import com.android.inputmethod.keyboard.internal.KeyboardParser.ParseException;
+import com.android.inputmethod.keyboard.internal.KeyboardBuilder.ParseException;
 import com.android.inputmethod.latin.R;
 
 import java.util.ArrayList;
@@ -214,7 +214,7 @@
             XmlResourceParser parser) {
         final String styleName = keyStyleAttr.getString(R.styleable.Keyboard_KeyStyle_styleName);
         if (DEBUG) Log.d(TAG, String.format("<%s styleName=%s />",
-                KeyboardParser.TAG_KEY_STYLE, styleName));
+                KeyboardBuilder.TAG_KEY_STYLE, styleName));
         if (mStyles.containsKey(styleName))
             throw new ParseException("duplicate key style declared: " + styleName, parser);
 
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardParser.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java
similarity index 97%
rename from java/src/com/android/inputmethod/keyboard/internal/KeyboardParser.java
rename to java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java
index 42e290f..de04ecd 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardParser.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java
@@ -37,12 +37,11 @@
 
 import java.io.IOException;
 import java.util.Arrays;
-import java.util.List;
 
 /**
- * Parser for BaseKeyboard.
+ * Keyboard Building helper.
  *
- * This class parses Keyboard XML file and fill out keys in Keyboard.
+ * This class parses Keyboard XML file and eventually build a Keyboard.
  * The Keyboard XML file looks like:
  * <pre>
  *   &gt;!-- xml/keyboard.xml --&lt;
@@ -108,8 +107,8 @@
  * </pre>
  */
 
-public class KeyboardParser<KP extends KeyboardParams> {
-    private static final String TAG = KeyboardParser.class.getSimpleName();
+public class KeyboardBuilder<KP extends KeyboardParams> {
+    private static final String TAG = KeyboardBuilder.class.getSimpleName();
     private static final boolean DEBUG = false;
 
     // Keyboard XML Tags
@@ -136,7 +135,7 @@
     private Key mRightEdgeKey = null;
     private final KeyStyles mKeyStyles = new KeyStyles();
 
-    public KeyboardParser(Context context, KP params) {
+    public KeyboardBuilder(Context context, KP params) {
         mContext = context;
         final Resources res = context.getResources();
         mResources = res;
@@ -150,7 +149,7 @@
         mParams.GRID_HEIGHT = res.getInteger(R.integer.config_keyboard_grid_height);
     }
 
-    public KeyboardParser<KP> load(KeyboardId id) {
+    public KeyboardBuilder<KP> load(KeyboardId id) {
         mParams.mId = id;
         try {
             parseKeyboard(id.getXmlId());
@@ -253,10 +252,12 @@
             mParams.mVerticalGap = getDimensionOrFraction(keyboardAttr,
                     R.styleable.Keyboard_verticalGap, height, 0);
 
-            mParams.mIsRtlKeyboard = keyboardAttr.getBoolean(R.styleable.Keyboard_isRtlKeyboard, false);
+            mParams.mIsRtlKeyboard = keyboardAttr.getBoolean(
+                    R.styleable.Keyboard_isRtlKeyboard, false);
             mParams.mPopupKeyboardResId = keyboardAttr.getResourceId(
                     R.styleable.Keyboard_popupKeyboardTemplate, 0);
-            mParams.mMaxPopupColumn = keyAttr.getInt(R.styleable.Keyboard_Key_maxPopupKeyboardColumn, 5);
+            mParams.mMaxPopupColumn = keyAttr.getInt(
+                    R.styleable.Keyboard_Key_maxPopupKeyboardColumn, 5);
 
             mParams.mIconsSet.loadIcons(keyboardAttr);
         } finally {
@@ -389,7 +390,7 @@
 
             final TypedArray keyAttr = mResources.obtainAttributes(Xml.asAttributeSet(parser),
                     R.styleable.Keyboard_Key);
-            int keyXPos = KeyboardParser.getDimensionOrFraction(keyAttr,
+            int keyXPos = KeyboardBuilder.getDimensionOrFraction(keyAttr,
                     R.styleable.Keyboard_Key_keyXPos, keyboardWidth, mCurrentX);
             if (keyXPos < 0) {
                 // If keyXPos is negative, the actual x-coordinate will be display_width + keyXPos.
diff --git a/java/src/com/android/inputmethod/keyboard/internal/MiniKeyboardBuilder.java b/java/src/com/android/inputmethod/keyboard/internal/MiniKeyboardBuilder.java
index bad7a17..31a291c 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/MiniKeyboardBuilder.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/MiniKeyboardBuilder.java
@@ -26,21 +26,21 @@
 import com.android.inputmethod.latin.R;
 
 public class MiniKeyboardBuilder extends
-        KeyboardParser<MiniKeyboardBuilder.MiniKeyboardLayoutParams> {
+        KeyboardBuilder<MiniKeyboardBuilder.MiniKeyboardParams> {
     private final CharSequence[] mPopupCharacters;
 
-    public static class MiniKeyboardLayoutParams extends KeyboardParams {
+    public static class MiniKeyboardParams extends KeyboardParams {
         /* package */ int mTopRowAdjustment;
         public int mNumRows;
         public int mNumColumns;
         public int mLeftKeys;
         public int mRightKeys; // includes default key.
 
-        public MiniKeyboardLayoutParams() {
+        public MiniKeyboardParams() {
             super();
         }
 
-        /* package for test */ MiniKeyboardLayoutParams(int numKeys, int maxColumns, int keyWidth,
+        /* package for test */ MiniKeyboardParams(int numKeys, int maxColumns, int keyWidth,
                 int rowHeight, int coordXInParent, int parentKeyboardWidth) {
             super();
             setParameters(
@@ -194,7 +194,7 @@
 
     public MiniKeyboardBuilder(KeyboardView view, int xmlId, Key parentKey,
             Keyboard parentKeyboard) {
-        super(view.getContext(), new MiniKeyboardLayoutParams());
+        super(view.getContext(), new MiniKeyboardParams());
         load(parentKeyboard.mId.cloneWithNewXml(mResources.getResourceEntryName(xmlId), xmlId));
 
         // HACK: Current mini keyboard design totally relies on the 9-patch padding about horizontal
@@ -246,7 +246,7 @@
 
     @Override
     public MiniKeyboard build() {
-        final MiniKeyboardLayoutParams params = mParams;
+        final MiniKeyboardParams params = mParams;
         for (int n = 0; n < mPopupCharacters.length; n++) {
             final CharSequence label = mPopupCharacters[n];
             final int row = n / params.mNumColumns;
diff --git a/java/src/com/android/inputmethod/keyboard/internal/Row.java b/java/src/com/android/inputmethod/keyboard/internal/Row.java
index 9299cc2..d53fe12 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/Row.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/Row.java
@@ -40,9 +40,9 @@
         final int keyboardHeight = params.mHeight;
         TypedArray a = res.obtainAttributes(Xml.asAttributeSet(parser),
                 R.styleable.Keyboard);
-        mDefaultKeyWidth = KeyboardParser.getDimensionOrFraction(a,
+        mDefaultKeyWidth = KeyboardBuilder.getDimensionOrFraction(a,
                 R.styleable.Keyboard_keyWidth, keyboardWidth, params.mDefaultKeyWidth);
-        mRowHeight = KeyboardParser.getDimensionOrFraction(a,
+        mRowHeight = KeyboardBuilder.getDimensionOrFraction(a,
                 R.styleable.Keyboard_rowHeight, keyboardHeight, params.mDefaultRowHeight);
         a.recycle();
     }
diff --git a/tests/src/com/android/inputmethod/keyboard/internal/MiniKeyboardBuilderTests.java b/tests/src/com/android/inputmethod/keyboard/internal/MiniKeyboardBuilderTests.java
index 0d2802d..1c5661b 100644
--- a/tests/src/com/android/inputmethod/keyboard/internal/MiniKeyboardBuilderTests.java
+++ b/tests/src/com/android/inputmethod/keyboard/internal/MiniKeyboardBuilderTests.java
@@ -16,7 +16,7 @@
 
 package com.android.inputmethod.keyboard.internal;
 
-import com.android.inputmethod.keyboard.internal.MiniKeyboardBuilder.MiniKeyboardLayoutParams;
+import com.android.inputmethod.keyboard.internal.MiniKeyboardBuilder.MiniKeyboardParams;
 
 import android.test.AndroidTestCase;
 
@@ -41,9 +41,9 @@
     }
 
     public void testLayoutError() {
-        MiniKeyboardLayoutParams params = null;
+        MiniKeyboardParams params = null;
         try {
-            params = new MiniKeyboardLayoutParams(10, MAX_COLUMNS + 1, WIDTH, HEIGHT, WIDTH * 2,
+            params = new MiniKeyboardParams(10, MAX_COLUMNS + 1, WIDTH, HEIGHT, WIDTH * 2,
                     WIDTH * MAX_COLUMNS);
             fail("Should throw IllegalArgumentException");
         } catch (IllegalArgumentException e) {
@@ -58,7 +58,7 @@
 
     // [1]
     public void testLayout1KeyM0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(1, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(1, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
         assertEquals("1 key M0 columns", 1, params.mNumColumns);
         assertEquals("1 key M0 rows", 1, params.mNumRows);
@@ -71,7 +71,7 @@
 
     // |[1]
     public void testLayout1KeyL0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(1, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(1, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_L0, KEYBOARD_WIDTH);
         assertEquals("1 key L0 columns", 1, params.mNumColumns);
         assertEquals("1 key L0 rows", 1, params.mNumRows);
@@ -84,7 +84,7 @@
 
     // |___ [1]
     public void testLayout1KeyL1() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(1, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(1, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_L1, KEYBOARD_WIDTH);
         assertEquals("1 key L1 columns", 1, params.mNumColumns);
         assertEquals("1 key L1 rows", 1, params.mNumRows);
@@ -97,7 +97,7 @@
 
     // |___ ___ [1]
     public void testLayout1KeyL2() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(1, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(1, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_L2, KEYBOARD_WIDTH);
         assertEquals("1 key L2 columns", 1, params.mNumColumns);
         assertEquals("1 key L2 rows", 1, params.mNumRows);
@@ -110,7 +110,7 @@
 
     // [1]|
     public void testLayout1KeyR0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(1, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(1, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_R0, KEYBOARD_WIDTH);
         assertEquals("1 key R0 columns", 1, params.mNumColumns);
         assertEquals("1 key R0 rows", 1, params.mNumRows);
@@ -123,7 +123,7 @@
 
     // [1] ___|
     public void testLayout1KeyR1() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(1, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(1, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_R1, KEYBOARD_WIDTH);
         assertEquals("1 key R1 columns", 1, params.mNumColumns);
         assertEquals("1 key R1 rows", 1, params.mNumRows);
@@ -136,7 +136,7 @@
 
     // [1] ___ ___|
     public void testLayout1KeyR2() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(1, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(1, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_R2, KEYBOARD_WIDTH);
         assertEquals("1 key R2 columns", 1, params.mNumColumns);
         assertEquals("1 key R2 rows", 1, params.mNumRows);
@@ -149,7 +149,7 @@
 
     // [1] [2]
     public void testLayout2KeyM0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(2, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(2, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
         assertEquals("2 key M0 columns", 2, params.mNumColumns);
         assertEquals("2 key M0 rows", 1, params.mNumRows);
@@ -163,7 +163,7 @@
 
     // |[1] [2]
     public void testLayout2KeyL0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(2, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(2, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_L0, KEYBOARD_WIDTH);
         assertEquals("2 key L0 columns", 2, params.mNumColumns);
         assertEquals("2 key L0 rows", 1, params.mNumRows);
@@ -177,7 +177,7 @@
 
     // |___ [1] [2]
     public void testLayout2KeyL1() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(2, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(2, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_L1, KEYBOARD_WIDTH);
         assertEquals("2 key L1 columns", 2, params.mNumColumns);
         assertEquals("2 key L1 rows", 1, params.mNumRows);
@@ -191,7 +191,7 @@
 
     // |___ ___ [1] [2]
     public void testLayout2KeyL2() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(2, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(2, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_L2, KEYBOARD_WIDTH);
         assertEquals("2 key L2 columns", 2, params.mNumColumns);
         assertEquals("2 key L2 rows", 1, params.mNumRows);
@@ -205,7 +205,7 @@
 
     // [2] [1]|
     public void testLayout2KeyR0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(2, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(2, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_R0, KEYBOARD_WIDTH);
         assertEquals("2 key R0 columns", 2, params.mNumColumns);
         assertEquals("2 key R0 rows", 1, params.mNumRows);
@@ -219,7 +219,7 @@
 
     // [2] [1] ___|
     public void testLayout2KeyR1() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(2, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(2, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_R1, KEYBOARD_WIDTH);
         assertEquals("2 key R1 columns", 2, params.mNumColumns);
         assertEquals("2 key R1 rows", 1, params.mNumRows);
@@ -233,7 +233,7 @@
 
     // [1] [2] ___ ___|
     public void testLayout2KeyR2() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(2, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(2, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_R2, KEYBOARD_WIDTH);
         assertEquals("2 key R2 columns", 2, params.mNumColumns);
         assertEquals("2 key R2 rows", 1, params.mNumRows);
@@ -247,7 +247,7 @@
 
     // [3] [1] [2]
     public void testLayout3KeyM0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(3, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(3, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
         assertEquals("3 key columns", 3, params.mNumColumns);
         assertEquals("3 key rows", 1, params.mNumRows);
@@ -262,7 +262,7 @@
 
     // |[1] [2] [3]
     public void testLayout3KeyL0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(3, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(3, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_L0, KEYBOARD_WIDTH);
         assertEquals("3 key L0 columns", 3, params.mNumColumns);
         assertEquals("3 key L0 rows", 1, params.mNumRows);
@@ -277,7 +277,7 @@
 
     // |___ [1] [2] [3]
     public void testLayout3KeyL1() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(3, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(3, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_L1, KEYBOARD_WIDTH);
         assertEquals("3 key L1 columns", 3, params.mNumColumns);
         assertEquals("3 key L1 rows", 1, params.mNumRows);
@@ -292,7 +292,7 @@
 
     // |___ ___ [3] [1] [2]
     public void testLayout3KeyL2() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(3, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(3, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_L2, KEYBOARD_WIDTH);
         assertEquals("3 key L2 columns", 3, params.mNumColumns);
         assertEquals("3 key L2 rows", 1, params.mNumRows);
@@ -307,7 +307,7 @@
 
     // [3] [2] [1]|
     public void testLayout3KeyR0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(3, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(3, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_R0, KEYBOARD_WIDTH);
         assertEquals("3 key R0 columns", 3, params.mNumColumns);
         assertEquals("3 key R0 rows", 1, params.mNumRows);
@@ -322,7 +322,7 @@
 
     // [3] [2] [1] ___|
     public void testLayout3KeyR1() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(3, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(3, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_R1, KEYBOARD_WIDTH);
         assertEquals("3 key R1 columns", 3, params.mNumColumns);
         assertEquals("3 key R1 rows", 1, params.mNumRows);
@@ -337,7 +337,7 @@
 
     // [3] [1] [2] ___ ___|
     public void testLayout3KeyR2() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(3, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(3, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_R2, KEYBOARD_WIDTH);
         assertEquals("3 key R2 columns", 3, params.mNumColumns);
         assertEquals("3 key R2 rows", 1, params.mNumRows);
@@ -352,7 +352,7 @@
 
     // [3] [1] [2] [4]
     public void testLayout4KeyM0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(4, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(4, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
         assertEquals("4 key columns", 4, params.mNumColumns);
         assertEquals("4 key rows", 1, params.mNumRows);
@@ -368,7 +368,7 @@
 
     // |[1] [2] [3] [4]
     public void testLayout4KeyL0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(4, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(4, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_L0, KEYBOARD_WIDTH);
         assertEquals("4 key L0 columns", 4, params.mNumColumns);
         assertEquals("4 key L0 rows", 1, params.mNumRows);
@@ -384,7 +384,7 @@
 
     // |___ [1] [2] [3] [4]
     public void testLayout4KeyL1() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(4, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(4, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_L1, KEYBOARD_WIDTH);
         assertEquals("4 key L1 columns", 4, params.mNumColumns);
         assertEquals("4 key L1 rows", 1, params.mNumRows);
@@ -400,7 +400,7 @@
 
     // |___ ___ [3] [1] [2] [4]
     public void testLayout4KeyL2() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(4, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(4, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_L2, KEYBOARD_WIDTH);
         assertEquals("4 key L2 columns", 4, params.mNumColumns);
         assertEquals("4 key L2 rows", 1, params.mNumRows);
@@ -416,7 +416,7 @@
 
     // [4] [3] [2] [1]|
     public void testLayout4KeyR0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(4, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(4, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_R0, KEYBOARD_WIDTH);
         assertEquals("4 key R0 columns", 4, params.mNumColumns);
         assertEquals("4 key R0 rows", 1, params.mNumRows);
@@ -432,7 +432,7 @@
 
     // [4] [3] [2] [1] ___|
     public void testLayout4KeyR1() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(4, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(4, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_R1, KEYBOARD_WIDTH);
         assertEquals("4 key R1 columns", 4, params.mNumColumns);
         assertEquals("4 key R1 rows", 1, params.mNumRows);
@@ -448,7 +448,7 @@
 
     // [4] [3] [1] [2] ___ ___|
     public void testLayout4KeyR2() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(4, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(4, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_R2, KEYBOARD_WIDTH);
         assertEquals("4 key R2 columns", 4, params.mNumColumns);
         assertEquals("4 key R2 rows", 1, params.mNumRows);
@@ -464,7 +464,7 @@
 
     // [5] [3] [1] [2] [4]
     public void testLayout5KeyM0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(5, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(5, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
         assertEquals("5 key columns", 5, params.mNumColumns);
         assertEquals("5 key rows", 1, params.mNumRows);
@@ -481,7 +481,7 @@
 
     // |[1] [2] [3] [4] [5]
     public void testLayout5KeyL0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(5, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(5, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_L0, KEYBOARD_WIDTH);
         assertEquals("5 key L0 columns", 5, params.mNumColumns);
         assertEquals("5 key L0 rows", 1, params.mNumRows);
@@ -498,7 +498,7 @@
 
     // |___ [1] [2] [3] [4] [5]
     public void testLayout5KeyL1() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(5, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(5, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_L1, KEYBOARD_WIDTH);
         assertEquals("5 key L1 columns", 5, params.mNumColumns);
         assertEquals("5 key L1 rows", 1, params.mNumRows);
@@ -515,7 +515,7 @@
 
     // |___ ___ [3] [1] [2] [4] [5]
     public void testLayout5KeyL2() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(5, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(5, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_L2, KEYBOARD_WIDTH);
         assertEquals("5 key L2 columns", 5, params.mNumColumns);
         assertEquals("5 key L2 rows", 1, params.mNumRows);
@@ -532,7 +532,7 @@
 
     // [5] [4] [3] [2] [1]|
     public void testLayout5KeyR0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(5, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(5, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_R0, KEYBOARD_WIDTH);
         assertEquals("5 key R0 columns", 5, params.mNumColumns);
         assertEquals("5 key R0 rows", 1, params.mNumRows);
@@ -549,7 +549,7 @@
 
     // [5] [4] [3] [2] [1] ___|
     public void testLayout5KeyR1() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(5, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(5, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_R1, KEYBOARD_WIDTH);
         assertEquals("5 key R1 columns", 5, params.mNumColumns);
         assertEquals("5 key R1 rows", 1, params.mNumRows);
@@ -566,7 +566,7 @@
 
     // [5] [4] [3] [1] [2] ___ ___|
     public void testLayout5KeyR2() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(5, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(5, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_R2, KEYBOARD_WIDTH);
         assertEquals("5 key R2 columns", 5, params.mNumColumns);
         assertEquals("5 key R2 rows", 1, params.mNumRows);
@@ -584,7 +584,7 @@
     // [6] [4] [5]
     // [3] [1] [2]
     public void testLayout6KeyM0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(6, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(6, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
         assertEquals("6 key columns", 3, params.mNumColumns);
         assertEquals("6 key rows", 2, params.mNumRows);
@@ -603,7 +603,7 @@
     // |[4] [5] [6]
     // |[1] [2] [3]
     public void testLayout6KeyL0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(6, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(6, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_L0, KEYBOARD_WIDTH);
         assertEquals("6 key L0 columns", 3, params.mNumColumns);
         assertEquals("6 key L0 rows", 2, params.mNumRows);
@@ -622,7 +622,7 @@
     // |___ [4] [5] [6]
     // |___ [1] [2] [3]
     public void testLayout6KeyL1() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(6, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(6, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_L1, KEYBOARD_WIDTH);
         assertEquals("6 key L1 columns", 3, params.mNumColumns);
         assertEquals("6 key L1 rows", 2, params.mNumRows);
@@ -641,7 +641,7 @@
     // |___ ___ [6] [4] [5]
     // |___ ___ [3] [1] [2]
     public void testLayout6KeyL2() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(6, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(6, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_L2, KEYBOARD_WIDTH);
         assertEquals("6 key L2 columns", 3, params.mNumColumns);
         assertEquals("6 key L2 rows", 2, params.mNumRows);
@@ -660,7 +660,7 @@
     // [6] [5] [4]|
     // [3] [2] [1]|
     public void testLayout6KeyR0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(6, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(6, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_R0, KEYBOARD_WIDTH);
         assertEquals("6 key R0 columns", 3, params.mNumColumns);
         assertEquals("6 key R0 rows", 2, params.mNumRows);
@@ -679,7 +679,7 @@
     // [6] [5] [4] ___|
     // [3] [2] [1] ___|
     public void testLayout6KeyR1() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(6, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(6, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_R1, KEYBOARD_WIDTH);
         assertEquals("6 key R1 columns", 3, params.mNumColumns);
         assertEquals("6 key R1 rows", 2, params.mNumRows);
@@ -698,7 +698,7 @@
     // [6] [4] [5] ___ ___|
     // [3] [1] [2] ___ ___|
     public void testLayout6KeyR2() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(6, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(6, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_R2, KEYBOARD_WIDTH);
         assertEquals("6 key R2 columns", 3, params.mNumColumns);
         assertEquals("6 key R2 rows", 2, params.mNumRows);
@@ -717,7 +717,7 @@
     //   [7] [5] [6]
     // [3] [1] [2] [4]
     public void testLayout7KeyM0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(7, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(7, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
         assertEquals("7 key columns", 4, params.mNumColumns);
         assertEquals("7 key rows", 2, params.mNumRows);
@@ -737,7 +737,7 @@
     // |[5] [6] [7]
     // |[1] [2] [3] [4]
     public void testLayout7KeyL0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(7, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(7, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_L0, KEYBOARD_WIDTH);
         assertEquals("7 key L0 columns", 4, params.mNumColumns);
         assertEquals("7 key L0 rows", 2, params.mNumRows);
@@ -757,7 +757,7 @@
     // |___ [5] [6] [7]
     // |___ [1] [2] [3] [4]
     public void testLayout7KeyL1() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(7, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(7, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_L1, KEYBOARD_WIDTH);
         assertEquals("7 key L1 columns", 4, params.mNumColumns);
         assertEquals("7 key L1 rows", 2, params.mNumRows);
@@ -777,7 +777,7 @@
     // |___ ___   [7] [5] [6]
     // |___ ___ [3] [1] [2] [4]
     public void testLayout7KeyL2() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(7, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(7, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_L2, KEYBOARD_WIDTH);
         assertEquals("7 key L2 columns", 4, params.mNumColumns);
         assertEquals("7 key L2 rows", 2, params.mNumRows);
@@ -797,7 +797,7 @@
     //     [7] [6] [5]|
     // [4] [3] [2] [1]|
     public void testLayout7KeyR0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(7, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(7, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_R0, KEYBOARD_WIDTH);
         assertEquals("7 key R0 columns", 4, params.mNumColumns);
         assertEquals("7 key R0 rows", 2, params.mNumRows);
@@ -817,7 +817,7 @@
     //     [7] [6] [5] ___|
     // [4] [3] [2] [1] ___|
     public void testLayout7KeyR1() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(7, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(7, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_R1, KEYBOARD_WIDTH);
         assertEquals("7 key R1 columns", 4, params.mNumColumns);
         assertEquals("7 key R1 rows", 2, params.mNumRows);
@@ -837,7 +837,7 @@
     //   [7] [5] [6]   ___ ___|
     // [4] [3] [1] [2] ___ ___|
     public void testLayout7KeyR2() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(7, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(7, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_R2, KEYBOARD_WIDTH);
         assertEquals("7 key R2 columns", 4, params.mNumColumns);
         assertEquals("7 key R2 rows", 2, params.mNumRows);
@@ -856,7 +856,7 @@
 
     // [7] [6] [5] [3] [1] [2] [4] ___|
     public void testLayout7KeyR3Max7() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(7, 7, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(7, 7, WIDTH,
                 HEIGHT, XPOS_R3, KEYBOARD_WIDTH);
         assertEquals("7 key R2 columns", 7, params.mNumColumns);
         assertEquals("7 key R2 rows", 1, params.mNumRows);
@@ -876,7 +876,7 @@
     // [7] [5] [6] [8]
     // [3] [1] [2] [4]
     public void testLayout8KeyM0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(8, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(8, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
         assertEquals("8 key M0 columns", 4, params.mNumColumns);
         assertEquals("8 key M0 rows", 2, params.mNumRows);
@@ -897,7 +897,7 @@
     // |[5] [6] [7] [8]
     // |[1] [2] [3] [4]
     public void testLayout8KeyL0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(8, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(8, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_L0, KEYBOARD_WIDTH);
         assertEquals("8 key L0 columns", 4, params.mNumColumns);
         assertEquals("8 key L0 rows", 2, params.mNumRows);
@@ -918,7 +918,7 @@
     // |___ [5] [6] [7] [8]
     // |___ [1] [2] [3] [4]
     public void testLayout8KeyL1() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(8, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(8, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_L1, KEYBOARD_WIDTH);
         assertEquals("8 key L1 columns", 4, params.mNumColumns);
         assertEquals("8 key L1 rows", 2, params.mNumRows);
@@ -939,7 +939,7 @@
     // |___ ___ [7] [5] [6] [8]
     // |___ ___ [3] [1] [2] [4]
     public void testLayout8KeyL2() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(8, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(8, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_L2, KEYBOARD_WIDTH);
         assertEquals("8 key L2 columns", 4, params.mNumColumns);
         assertEquals("8 key L2 rows", 2, params.mNumRows);
@@ -960,7 +960,7 @@
     // [8] [7] [6] [5]|
     // [4] [3] [2] [1]|
     public void testLayout8KeyR0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(8, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(8, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_R0, KEYBOARD_WIDTH);
         assertEquals("8 key R0 columns", 4, params.mNumColumns);
         assertEquals("8 key R0 rows", 2, params.mNumRows);
@@ -981,7 +981,7 @@
     // [8] [7] [6] [5] ___|
     // [4] [3] [2] [1] ___|
     public void testLayout8KeyR1() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(8, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(8, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_R1, KEYBOARD_WIDTH);
         assertEquals("8 key R1 columns", 4, params.mNumColumns);
         assertEquals("8 key R1 rows", 2, params.mNumRows);
@@ -1002,7 +1002,7 @@
     // [8] [7] [5] [6] ___ ___|
     // [4] [3] [1] [2] ___ ___|
     public void testLayout8KeyR2() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(8, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(8, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_R2, KEYBOARD_WIDTH);
         assertEquals("8 key R2 columns", 4, params.mNumColumns);
         assertEquals("8 key R2 rows", 2, params.mNumRows);
@@ -1023,7 +1023,7 @@
     //   [8] [6] [7] [9]
     // [5] [3] [1] [2] [4]
     public void testLayout9KeyM0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(9, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(9, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
         assertEquals("9 key M0 columns", 5, params.mNumColumns);
         assertEquals("9 key M0 rows", 2, params.mNumRows);
@@ -1045,7 +1045,7 @@
     // |[6] [7] [8] [9]
     // |[1] [2] [3] [4] [5]
     public void testLayout9KeyL0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(9, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(9, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_L0, KEYBOARD_WIDTH);
         assertEquals("9 key L0 columns", 5, params.mNumColumns);
         assertEquals("9 key L0 rows", 2, params.mNumRows);
@@ -1067,7 +1067,7 @@
     // |___ [6] [7] [8] [9]
     // |___ [1] [2] [3] [4] [5]
     public void testLayout9KeyL1() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(9, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(9, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_L1, KEYBOARD_WIDTH);
         assertEquals("9 key L1 columns", 5, params.mNumColumns);
         assertEquals("9 key L1 rows", 2, params.mNumRows);
@@ -1089,7 +1089,7 @@
     // |___ ___   [8] [6] [7] [9]
     // |___ ___ [3] [1] [2] [4] [5]
     public void testLayout9KeyL2() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(9, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(9, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_L2, KEYBOARD_WIDTH);
         assertEquals("9 key L2 columns", 5, params.mNumColumns);
         assertEquals("9 key L2 rows", 2, params.mNumRows);
@@ -1111,7 +1111,7 @@
     //     [9] [8] [7] [6]|
     // [5] [4] [3] [2] [1]|
     public void testLayout9KeyR0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(9, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(9, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_R0, KEYBOARD_WIDTH);
         assertEquals("9 key R0 columns", 5, params.mNumColumns);
         assertEquals("9 key R0 rows", 2, params.mNumRows);
@@ -1133,7 +1133,7 @@
     //     [9] [8] [7] [6] ___|
     // [5] [4] [3] [2] [1] ___|
     public void testLayout9KeyR1() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(9, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(9, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_R1, KEYBOARD_WIDTH);
         assertEquals("9 key R1 columns", 5, params.mNumColumns);
         assertEquals("9 key R1 rows", 2, params.mNumRows);
@@ -1155,7 +1155,7 @@
     //   [9] [8] [6] [7]   ___ ___|
     // [5] [4] [3] [1] [2] ___ ___|
     public void testLayout9KeyR2() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(9, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(9, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_R2, KEYBOARD_WIDTH);
         assertEquals("9 key R2 columns", 5, params.mNumColumns);
         assertEquals("9 key R2 rows", 2, params.mNumRows);
@@ -1177,7 +1177,7 @@
     // [A] [8] [6] [7] [9]
     // [5] [3] [1] [2] [4]
     public void testLayout10KeyM0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(10, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(10, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
         assertEquals("10 key M0 columns", 5, params.mNumColumns);
         assertEquals("10 key M0 rows", 2, params.mNumRows);
@@ -1200,7 +1200,7 @@
     // |[6] [7] [8] [9] [A]
     // |[1] [2] [3] [4] [5]
     public void testLayout10KeyL0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(10, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(10, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_L0, KEYBOARD_WIDTH);
         assertEquals("10 key L0 columns", 5, params.mNumColumns);
         assertEquals("10 key L0 rows", 2, params.mNumRows);
@@ -1223,7 +1223,7 @@
     // |___ [6] [7] [8] [9] [A]
     // |___ [1] [2] [3] [4] [5]
     public void testLayout10KeyL1() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(10, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(10, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_L1, KEYBOARD_WIDTH);
         assertEquals("10 key L1 columns", 5, params.mNumColumns);
         assertEquals("10 key L1 rows", 2, params.mNumRows);
@@ -1246,7 +1246,7 @@
     // |___ ___ [8] [6] [7] [9] [A]
     // |___ ___ [3] [1] [2] [4] [5]
     public void testLayout10KeyL2() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(10, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(10, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_L2, KEYBOARD_WIDTH);
         assertEquals("10 key L2 columns", 5, params.mNumColumns);
         assertEquals("10 key L2 rows", 2, params.mNumRows);
@@ -1269,7 +1269,7 @@
     // [A] [9] [8] [7] [6]|
     // [5] [4] [3] [2] [1]|
     public void testLayout10KeyR0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(10, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(10, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_R0, KEYBOARD_WIDTH);
         assertEquals("10 key R0 columns", 5, params.mNumColumns);
         assertEquals("10 key R0 rows", 2, params.mNumRows);
@@ -1292,7 +1292,7 @@
     // [A] [9] [8] [7] [6] ___|
     // [5] [4] [3] [2] [1] ___|
     public void testLayout10KeyR1() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(10, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(10, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_R1, KEYBOARD_WIDTH);
         assertEquals("10 key R1 columns", 5, params.mNumColumns);
         assertEquals("10 key R1 rows", 2, params.mNumRows);
@@ -1315,7 +1315,7 @@
     // [A] [9] [8] [6] [7] ___ ___|
     // [5] [4] [3] [1] [2] ___ ___|
     public void testLayout10KeyR2() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(10, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(10, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_R2, KEYBOARD_WIDTH);
         assertEquals("10 key R2 columns", 5, params.mNumColumns);
         assertEquals("10 key R2 rows", 2, params.mNumRows);
@@ -1339,7 +1339,7 @@
     // [7] [5] [6] [8]
     // [3] [1] [2] [4]
     public void testLayout11KeyM0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(11, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(11, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
         assertEquals("11 key M0 columns", 4, params.mNumColumns);
         assertEquals("11 key M0 rows", 3, params.mNumRows);
@@ -1364,7 +1364,7 @@
     // [7] [5] [6] [8]
     // [3] [1] [2] [4]
     public void testLayout12KeyM0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(12, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(12, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
         assertEquals("12 key M0 columns", 4, params.mNumColumns);
         assertEquals("12 key M0 rows", 3, params.mNumRows);
@@ -1391,7 +1391,7 @@
     // [A] [8] [6] [7] [9]
     // [5] [3] [1] [2] [4]
     public void testLayout13KeyM0() {
-        MiniKeyboardLayoutParams params = new MiniKeyboardLayoutParams(13, MAX_COLUMNS, WIDTH,
+        MiniKeyboardParams params = new MiniKeyboardParams(13, MAX_COLUMNS, WIDTH,
                 HEIGHT, XPOS_M0, KEYBOARD_WIDTH);
         assertEquals("13 key M0 columns", 5, params.mNumColumns);
         assertEquals("13 key M0 rows", 3, params.mNumRows);
diff --git a/tests/src/com/android/inputmethod/latin/SuggestHelper.java b/tests/src/com/android/inputmethod/latin/SuggestHelper.java
index f9ea180..7736743 100644
--- a/tests/src/com/android/inputmethod/latin/SuggestHelper.java
+++ b/tests/src/com/android/inputmethod/latin/SuggestHelper.java
@@ -16,16 +16,15 @@
 
 package com.android.inputmethod.latin;
 
+import android.content.Context;
+import android.text.TextUtils;
+
 import com.android.inputmethod.keyboard.Key;
 import com.android.inputmethod.keyboard.KeyDetector;
 import com.android.inputmethod.keyboard.KeyboardId;
 import com.android.inputmethod.keyboard.LatinKeyboard;
 
-import android.content.Context;
-import android.text.TextUtils;
-
 import java.io.File;
-import java.util.List;
 
 public class SuggestHelper {
     protected final Suggest mSuggest;
@@ -66,8 +65,7 @@
     }
 
     private void addKeyInfo(WordComposer word, char c) {
-        final List<Key> keys = mKeyboard.getKeys();
-        for (final Key key : keys) {
+        for (final Key key : mKeyboard.mKeys) {
             if (key.mCode == c) {
                 final int x = key.mX + key.mWidth / 2;
                 final int y = key.mY + key.mHeight / 2;
