Extracted method to format status line.