code refactoring of JSONReformat() process
for better working memory pre-allocation