cleaup WritePartMainData function
Indentation