Refactored printer as an extension of OCaml.Make.printer