CRM-14197 more refactoring of postProcess function