Merge "Simplify some of the logic." into oc-dev
am: d8b5621640

Change-Id: I6ecab16510d5cff615832e2b586f7d34dd6b42ed