Refactoring print class.
Refactoring print class.