diff --git a/java/src/com/android/inputmethod/keyboard/internal/GestureTrailsPreview.java b/java/src/com/android/inputmethod/keyboard/internal/GestureTrailsPreview.java
index 19e9955..8b413e5 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/GestureTrailsPreview.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/GestureTrailsPreview.java
@@ -31,7 +31,7 @@
 import com.android.inputmethod.keyboard.PointerTracker;
 import com.android.inputmethod.keyboard.internal.GestureTrail.Params;
 import com.android.inputmethod.latin.utils.CollectionUtils;
-import com.android.inputmethod.latin.utils.StaticInnerHandlerWrapper;
+import com.android.inputmethod.latin.utils.LeakGuardHandlerWrapper;
 
 /**
  * Draw gesture trail preview graphics during gesture.
@@ -52,21 +52,23 @@
     private final DrawingHandler mDrawingHandler;
 
     private static final class DrawingHandler
-            extends StaticInnerHandlerWrapper<GestureTrailsPreview> {
+            extends LeakGuardHandlerWrapper<GestureTrailsPreview> {
         private static final int MSG_UPDATE_GESTURE_TRAIL = 0;
 
         private final Params mGestureTrailParams;
 
-        public DrawingHandler(final GestureTrailsPreview outerInstance,
+        public DrawingHandler(final GestureTrailsPreview ownerInstance,
                 final Params gestureTrailParams) {
-            super(outerInstance);
+            super(ownerInstance);
             mGestureTrailParams = gestureTrailParams;
         }
 
         @Override
         public void handleMessage(final Message msg) {
-            final GestureTrailsPreview preview = getOuterInstance();
-            if (preview == null) return;
+            final GestureTrailsPreview preview = getOwnerInstance();
+            if (preview == null) {
+                return;
+            }
             switch (msg.what) {
             case MSG_UPDATE_GESTURE_TRAIL:
                 preview.getDrawingView().invalidate();
diff --git a/java/src/com/android/inputmethod/keyboard/internal/MainKeyboardViewDrawingHandler.java b/java/src/com/android/inputmethod/keyboard/internal/MainKeyboardViewDrawingHandler.java
index 5384553..fb1f789 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/MainKeyboardViewDrawingHandler.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/MainKeyboardViewDrawingHandler.java
@@ -21,20 +21,22 @@
 import com.android.inputmethod.keyboard.Key;
 import com.android.inputmethod.keyboard.MainKeyboardView;
 import com.android.inputmethod.latin.SuggestedWords;
-import com.android.inputmethod.latin.utils.StaticInnerHandlerWrapper;
+import com.android.inputmethod.latin.utils.LeakGuardHandlerWrapper;
 
-public class MainKeyboardViewDrawingHandler extends StaticInnerHandlerWrapper<MainKeyboardView> {
+public class MainKeyboardViewDrawingHandler extends LeakGuardHandlerWrapper<MainKeyboardView> {
     private static final int MSG_DISMISS_KEY_PREVIEW = 0;
     private static final int MSG_DISMISS_GESTURE_FLOATING_PREVIEW_TEXT = 1;
 
-    public MainKeyboardViewDrawingHandler(final MainKeyboardView outerInstance) {
-        super(outerInstance);
+    public MainKeyboardViewDrawingHandler(final MainKeyboardView ownerInstance) {
+        super(ownerInstance);
     }
 
     @Override
     public void handleMessage(final Message msg) {
-        final MainKeyboardView mainKeyboardView = getOuterInstance();
-        if (mainKeyboardView == null) return;
+        final MainKeyboardView mainKeyboardView = getOwnerInstance();
+        if (mainKeyboardView == null) {
+            return;
+        }
         switch (msg.what) {
         case MSG_DISMISS_KEY_PREVIEW:
             mainKeyboardView.dismissKeyPreviewWithoutDelay((Key)msg.obj);
@@ -51,8 +53,10 @@
 
     private void cancelAllDismissKeyPreviews() {
         removeMessages(MSG_DISMISS_KEY_PREVIEW);
-        final MainKeyboardView mainKeyboardView = getOuterInstance();
-        if (mainKeyboardView == null) return;
+        final MainKeyboardView mainKeyboardView = getOwnerInstance();
+        if (mainKeyboardView == null) {
+            return;
+        }
         mainKeyboardView.dismissAllKeyPreviews();
     }
 
diff --git a/java/src/com/android/inputmethod/keyboard/internal/MainKeyboardViewTimerHandler.java b/java/src/com/android/inputmethod/keyboard/internal/MainKeyboardViewTimerHandler.java
index 3ffb2b6..9b275ea 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/MainKeyboardViewTimerHandler.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/MainKeyboardViewTimerHandler.java
@@ -27,9 +27,9 @@
 import com.android.inputmethod.keyboard.PointerTracker.TimerProxy;
 import com.android.inputmethod.latin.Constants;
 import com.android.inputmethod.latin.R;
-import com.android.inputmethod.latin.utils.StaticInnerHandlerWrapper;
+import com.android.inputmethod.latin.utils.LeakGuardHandlerWrapper;
 
-public final class MainKeyboardViewTimerHandler extends StaticInnerHandlerWrapper<MainKeyboardView>
+public final class MainKeyboardViewTimerHandler extends LeakGuardHandlerWrapper<MainKeyboardView>
         implements TimerProxy {
     private static final int MSG_TYPING_STATE_EXPIRED = 0;
     private static final int MSG_REPEAT_KEY = 1;
@@ -40,9 +40,9 @@
     private final int mIgnoreAltCodeKeyTimeout;
     private final int mGestureRecognitionUpdateTime;
 
-    public MainKeyboardViewTimerHandler(final MainKeyboardView outerInstance,
+    public MainKeyboardViewTimerHandler(final MainKeyboardView ownerInstance,
             final TypedArray mainKeyboardViewAttr) {
-        super(outerInstance);
+        super(ownerInstance);
 
         mIgnoreAltCodeKeyTimeout = mainKeyboardViewAttr.getInt(
                 R.styleable.MainKeyboardView_ignoreAltCodeKeyTimeout, 0);
@@ -52,20 +52,20 @@
 
     @Override
     public void handleMessage(final Message msg) {
-        final MainKeyboardView keyboardView = getOuterInstance();
-        if (keyboardView == null) {
+        final MainKeyboardView mainKeyboardView = getOwnerInstance();
+        if (mainKeyboardView == null) {
             return;
         }
         final PointerTracker tracker = (PointerTracker) msg.obj;
         switch (msg.what) {
         case MSG_TYPING_STATE_EXPIRED:
-            keyboardView.startWhileTypingFadeinAnimation();
+            mainKeyboardView.startWhileTypingFadeinAnimation();
             break;
         case MSG_REPEAT_KEY:
             tracker.onKeyRepeat(msg.arg1 /* code */, msg.arg2 /* repeatCount */);
             break;
         case MSG_LONGPRESS_KEY:
-            keyboardView.onLongPress(tracker);
+            mainKeyboardView.onLongPress(tracker);
             break;
         case MSG_UPDATE_BATCH_INPUT:
             tracker.updateBatchInputByTimer(SystemClock.uptimeMillis());
@@ -114,13 +114,16 @@
 
         final boolean isTyping = isTypingState();
         removeMessages(MSG_TYPING_STATE_EXPIRED);
-        final MainKeyboardView keyboardView = getOuterInstance();
+        final MainKeyboardView mainKeyboardView = getOwnerInstance();
+        if (mainKeyboardView == null) {
+            return;
+        }
 
         // When user hits the space or the enter key, just cancel the while-typing timer.
         final int typedCode = typedKey.getCode();
         if (typedCode == Constants.CODE_SPACE || typedCode == Constants.CODE_ENTER) {
             if (isTyping) {
-                keyboardView.startWhileTypingFadeinAnimation();
+                mainKeyboardView.startWhileTypingFadeinAnimation();
             }
             return;
         }
@@ -130,7 +133,7 @@
         if (isTyping) {
             return;
         }
-        keyboardView.startWhileTypingFadeoutAnimation();
+        mainKeyboardView.startWhileTypingFadeoutAnimation();
     }
 
     @Override
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 6445b61..87eed3b 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -97,8 +97,8 @@
 import com.android.inputmethod.latin.utils.IntentUtils;
 import com.android.inputmethod.latin.utils.JniUtils;
 import com.android.inputmethod.latin.utils.LatinImeLoggerUtils;
+import com.android.inputmethod.latin.utils.LeakGuardHandlerWrapper;
 import com.android.inputmethod.latin.utils.RecapitalizeStatus;
-import com.android.inputmethod.latin.utils.StaticInnerHandlerWrapper;
 import com.android.inputmethod.latin.utils.StringUtils;
 import com.android.inputmethod.latin.utils.TargetPackageInfoGetterTask;
 import com.android.inputmethod.latin.utils.TextRange;
@@ -224,7 +224,7 @@
     public final UIHandler mHandler = new UIHandler(this);
     private InputUpdater mInputUpdater;
 
-    public static final class UIHandler extends StaticInnerHandlerWrapper<LatinIME> {
+    public static final class UIHandler extends LeakGuardHandlerWrapper<LatinIME> {
         private static final int MSG_UPDATE_SHIFT_STATE = 0;
         private static final int MSG_PENDING_IMS_CALLBACK = 1;
         private static final int MSG_UPDATE_SUGGESTION_STRIP = 2;
@@ -247,12 +247,12 @@
         private long mDoubleSpacePeriodTimeout;
         private long mDoubleSpacePeriodTimerStart;
 
-        public UIHandler(final LatinIME outerInstance) {
-            super(outerInstance);
+        public UIHandler(final LatinIME ownerInstance) {
+            super(ownerInstance);
         }
 
         public void onCreate() {
-            final Resources res = getOuterInstance().getResources();
+            final Resources res = getOwnerInstance().getResources();
             mDelayUpdateSuggestions =
                     res.getInteger(R.integer.config_delay_update_suggestions);
             mDelayUpdateShiftState =
@@ -263,7 +263,7 @@
 
         @Override
         public void handleMessage(final Message msg) {
-            final LatinIME latinIme = getOuterInstance();
+            final LatinIME latinIme = getOwnerInstance();
             final KeyboardSwitcher switcher = latinIme.mKeyboardSwitcher;
             switch (msg.what) {
             case MSG_UPDATE_SUGGESTION_STRIP:
@@ -407,7 +407,7 @@
             removeMessages(MSG_PENDING_IMS_CALLBACK);
             resetPendingImsCallback();
             mIsOrientationChanging = true;
-            final LatinIME latinIme = getOuterInstance();
+            final LatinIME latinIme = getOwnerInstance();
             if (latinIme.isInputViewShown()) {
                 latinIme.mKeyboardSwitcher.saveKeyboardState();
             }
@@ -440,7 +440,7 @@
                     mIsOrientationChanging = false;
                     mPendingSuccessiveImsCallback = true;
                 }
-                final LatinIME latinIme = getOuterInstance();
+                final LatinIME latinIme = getOwnerInstance();
                 executePendingImsCallback(latinIme, editorInfo, restarting);
                 latinIme.onStartInputInternal(editorInfo, restarting);
             }
@@ -459,7 +459,7 @@
                     sendMessageDelayed(obtainMessage(MSG_PENDING_IMS_CALLBACK),
                             PENDING_IMS_CALLBACK_DURATION);
                 }
-                final LatinIME latinIme = getOuterInstance();
+                final LatinIME latinIme = getOwnerInstance();
                 executePendingImsCallback(latinIme, editorInfo, restarting);
                 latinIme.onStartInputViewInternal(editorInfo, restarting);
                 mAppliedEditorInfo = editorInfo;
@@ -471,7 +471,7 @@
                 // Typically this is the first onFinishInputView after orientation changed.
                 mHasPendingFinishInputView = true;
             } else {
-                final LatinIME latinIme = getOuterInstance();
+                final LatinIME latinIme = getOwnerInstance();
                 latinIme.onFinishInputViewInternal(finishingInput);
                 mAppliedEditorInfo = null;
             }
@@ -482,7 +482,7 @@
                 // Typically this is the first onFinishInput after orientation changed.
                 mHasPendingFinishInput = true;
             } else {
-                final LatinIME latinIme = getOuterInstance();
+                final LatinIME latinIme = getOwnerInstance();
                 executePendingImsCallback(latinIme, null, false);
                 latinIme.onFinishInputInternal();
             }
diff --git a/java/src/com/android/inputmethod/latin/setup/SetupWizardActivity.java b/java/src/com/android/inputmethod/latin/setup/SetupWizardActivity.java
index c4a813c..5072fab 100644
--- a/java/src/com/android/inputmethod/latin/setup/SetupWizardActivity.java
+++ b/java/src/com/android/inputmethod/latin/setup/SetupWizardActivity.java
@@ -38,7 +38,7 @@
 import com.android.inputmethod.latin.R;
 import com.android.inputmethod.latin.settings.SettingsActivity;
 import com.android.inputmethod.latin.utils.CollectionUtils;
-import com.android.inputmethod.latin.utils.StaticInnerHandlerWrapper;
+import com.android.inputmethod.latin.utils.LeakGuardHandlerWrapper;
 
 import java.util.ArrayList;
 
@@ -74,21 +74,21 @@
     private SettingsPoolingHandler mHandler;
 
     private static final class SettingsPoolingHandler
-            extends StaticInnerHandlerWrapper<SetupWizardActivity> {
+            extends LeakGuardHandlerWrapper<SetupWizardActivity> {
         private static final int MSG_POLLING_IME_SETTINGS = 0;
         private static final long IME_SETTINGS_POLLING_INTERVAL = 200;
 
         private final InputMethodManager mImmInHandler;
 
-        public SettingsPoolingHandler(final SetupWizardActivity outerInstance,
+        public SettingsPoolingHandler(final SetupWizardActivity ownerInstance,
                 final InputMethodManager imm) {
-            super(outerInstance);
+            super(ownerInstance);
             mImmInHandler = imm;
         }
 
         @Override
         public void handleMessage(final Message msg) {
-            final SetupWizardActivity setupWizardActivity = getOuterInstance();
+            final SetupWizardActivity setupWizardActivity = getOwnerInstance();
             if (setupWizardActivity == null) {
                 return;
             }
diff --git a/java/src/com/android/inputmethod/latin/utils/StaticInnerHandlerWrapper.java b/java/src/com/android/inputmethod/latin/utils/LeakGuardHandlerWrapper.java
similarity index 60%
rename from java/src/com/android/inputmethod/latin/utils/StaticInnerHandlerWrapper.java
rename to java/src/com/android/inputmethod/latin/utils/LeakGuardHandlerWrapper.java
index 44e5d17..8469c87 100644
--- a/java/src/com/android/inputmethod/latin/utils/StaticInnerHandlerWrapper.java
+++ b/java/src/com/android/inputmethod/latin/utils/LeakGuardHandlerWrapper.java
@@ -21,22 +21,22 @@
 
 import java.lang.ref.WeakReference;
 
-public class StaticInnerHandlerWrapper<T> extends Handler {
-    private final WeakReference<T> mOuterInstanceRef;
+public class LeakGuardHandlerWrapper<T> extends Handler {
+    private final WeakReference<T> mOwnerInstanceRef;
 
-    public StaticInnerHandlerWrapper(final T outerInstance) {
-        this(outerInstance, Looper.myLooper());
+    public LeakGuardHandlerWrapper(final T ownerInstance) {
+        this(ownerInstance, Looper.myLooper());
     }
 
-    public StaticInnerHandlerWrapper(final T outerInstance, final Looper looper) {
+    public LeakGuardHandlerWrapper(final T ownerInstance, final Looper looper) {
         super(looper);
-        if (outerInstance == null) {
-            throw new NullPointerException("outerInstance is null");
+        if (ownerInstance == null) {
+            throw new NullPointerException("ownerInstance is null");
         }
-        mOuterInstanceRef = new WeakReference<T>(outerInstance);
+        mOwnerInstanceRef = new WeakReference<T>(ownerInstance);
     }
 
-    public T getOuterInstance() {
-        return mOuterInstanceRef.get();
+    public T getOwnerInstance() {
+        return mOwnerInstanceRef.get();
     }
 }
