diff --git a/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java b/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java
index 5d89669..4929dd9 100644
--- a/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java
+++ b/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java
@@ -30,12 +30,14 @@
 import java.util.Locale;
 
 public class SuggestionSpanUtils {
+    // TODO: Use reflection to get field values
     public static final String ACTION_SUGGESTION_PICKED =
             "android.text.style.SUGGESTION_PICKED";
     public static final String SUGGESTION_SPAN_PICKED_AFTER = "after";
     public static final String SUGGESTION_SPAN_PICKED_BEFORE = "before";
     public static final String SUGGESTION_SPAN_PICKED_HASHCODE = "hashcode";
     public static final int SUGGESTION_MAX_SIZE = 5;
+    public static final boolean SUGGESTION_SPAN_IS_SUPPORTED;
 
     private static final Class<?> CLASS_SuggestionSpan = CompatUtils
             .getClass("android.text.style.SuggestionSpan");
@@ -43,24 +45,23 @@
             Context.class, Locale.class, String[].class, int.class, Class.class };
     private static final Constructor<?> CONSTRUCTOR_SuggestionSpan = CompatUtils
             .getConstructor(CLASS_SuggestionSpan, INPUT_TYPE_SuggestionSpan);
-    public static final boolean SUGGESTION_SPAN_IS_SUPPORTED;
     static {
         SUGGESTION_SPAN_IS_SUPPORTED =
                 CLASS_SuggestionSpan != null && CONSTRUCTOR_SuggestionSpan != null;
     }
 
     public static CharSequence getTextWithSuggestionSpan(Context context,
-            CharSequence suggestion, SuggestedWords suggestedWords) {
-        if (TextUtils.isEmpty(suggestion) || CONSTRUCTOR_SuggestionSpan == null
+            CharSequence pickedWord, SuggestedWords suggestedWords) {
+        if (TextUtils.isEmpty(pickedWord) || CONSTRUCTOR_SuggestionSpan == null
                 || suggestedWords == null || suggestedWords.size() == 0) {
-            return suggestion;
+            return pickedWord;
         }
 
         final Spannable spannable;
-        if (suggestion instanceof Spannable) {
-            spannable = (Spannable) suggestion;
+        if (pickedWord instanceof Spannable) {
+            spannable = (Spannable) pickedWord;
         } else {
-            spannable = new SpannableString(suggestion);
+            spannable = new SpannableString(pickedWord);
         }
         final ArrayList<String> suggestionsList = new ArrayList<String>();
         for (int i = 0; i < suggestedWords.size(); ++i) {
@@ -68,7 +69,7 @@
                 break;
             }
             final CharSequence word = suggestedWords.getWord(i);
-            if (!TextUtils.equals(suggestion, word)) {
+            if (!TextUtils.equals(pickedWord, word)) {
                 suggestionsList.add(word.toString());
             }
         }
@@ -78,9 +79,9 @@
                         (Class<?>) SuggestionSpanPickedNotificationReceiver.class };
         final Object ss = CompatUtils.newInstance(CONSTRUCTOR_SuggestionSpan, args);
         if (ss == null) {
-            return suggestion;
+            return pickedWord;
         }
-        spannable.setSpan(ss, 0, suggestion.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
+        spannable.setSpan(ss, 0, pickedWord.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
         return spannable;
     }
 }
