 extension ChangeHeaderViewController : NSTableViewDelegate {
 
 	func tableView(tableView: NSTableView, shouldSelectRow row: Int) -> Bool {
-		let textFile = dataArray![row]
 		
 		if tableView.selectedRow != row {
-			
-			if let string = textFile.fileString {
-				
-				let headerChanger = HeaderChanger(string: string, newComment: newHeaderCommentTextView.string!)
-				self.originalFileTextView.textStorage?.setAttributedString(headerChanger.originalAttributedString)
-				self.newFileTextView.textStorage?.setAttributedString(headerChanger.newAttributedString)
-			}
+			updateTextViewsWith(textFileAtRow: row)
 		}
 		
 		return true

			}
		}
		
		fileTableView.reloadData()
	}
	
	override func viewDidLoad() {
		super.viewDidLoad()
		

	@IBOutlet weak var originalHeaderRegexCheckBox: NSButton!
	@IBOutlet weak var originalHeaderRegexTextField: NSTextField!
	
	// MARK: Load and update data
	func reloadFiles() {
		if let baseURL = NSURL(fileURLWithPath: basePathTextField.stringValue) {
			
			dataArray = PlainTextFile.sourceCodeFileArray(baseURL: baseURL)
			
			fileTableView.reloadData()
			
			updateFiles()
		}
	}
	
	func updateFiles() {
		
		fileTableView.beginUpdates()
		
		if dataArray != nil {
			for textFile in dataArray! {
				
