Move data cleaning to before initial JSON validation