Refactoring
Sort output