[REFACTOR] Modularised the JSON prettyPrint feature