declare variables as close as first use.
```
if (typeList && !typeList.isEmpty()) {
    Builder builder = newInsertContactOrFieldBuilder(contactMap.mMimeType);
    if (builder == null) {
         return;
    }
    
    final String type = contactMap.mTypeValueMap.get(typeList.get(0));
    if (type != null) {
        builder.withValue(contactMap.mTypeMap.get("type"), type);
    }
 
   boolean bPref = mJson.getBoolean("preferred");
   if (bPref) {
        builder.withValue(contactMap.mTypeMap.get("isPrimary"), 1);
        builder.withValue(contactMap.mTypeMap.get("isSuperPrimary"), 1);
   }

   mJson = new ContactJson(fields.getJSONObject(i));
   for (Map.Entry<String, String> entry : contactMap.mDataMap.entrySet()) {
    ....
   }
    
}
```