[REFACTOR] Modularised prettyPrint