Refactored and formatted output.