Refactored PrintHandler