put CompositePrinter code into a separate header file