Group more code in local helper function and simplify it
Group more code in local helper function and simplify it

Change-Id: I1d5c07bd9c67243cf22405fb4f6edb9202291091

JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core,JurassicWordExcel/core