Clean up printing code.