Split format_lines into 2 methods.