More printing refactoring