refactor by separating data section out of the document structure and pass it in as another argument instead as it is more useful to pull the data from AJAX call instead of embeded them in the structure