Output refactoring