Refactoring of output code