Optimize the printing functions.