package com.grayben.riskExtractor;

import java.io.File;
import java.util.List;

import com.grayben.riskExtractor.htmlScorer.HtmlScorer;
import com.grayben.riskExtractor.htmlScorer.ScoredTextElement;
import com.grayben.riskExtractor.htmlScorer.TreeHtmlScorer;

public class RiskExtractor {

	public static void main(String[] args) {
		long startTime = System.currentTimeMillis();
		checkArgs(args);
		String fileName = args[0];
		File htmlFile = new File(fileName);
		String charsetName = args[1];
		HtmlScorer scorer = new TreeHtmlScorer();
		List<ScoredTextElement> scoredText = scorer.scoreHtml(htmlFile, charsetName);
		System.out.print(scoredText.toString());
		System.out.println();
		System.out.println("Program finished.");
		long endTime = System.currentTimeMillis();
		long secondsElapsed = (endTime - startTime)/1000;
		System.out.println("Time elapsed: " + secondsElapsed);

	}
	
	private static void checkArgs(String[] args){
		int argsLen = 2;
		if(args.length != argsLen){
			System.err.println("ERROR: must pass " + argsLen + " arguments.");
			System.exit(1);
		}
	}

}

@@ -282,16 +282,42 @@
 ractor %7B
+%0A%09%0A%09static long startTime;
 %0A%0A%09publi
@@ -358,52 +358,617 @@
 %7B%0A%09%09
-long startTime = System.currentTimeMillis();
+startingMain();%0A%09%09%0A%09%09completingMain();%0A%09%7D%0A%09%0A%09private static void startingMain()%7B%0A%09%09startTimer();%0A%09%09System.out.println(%22Starting main%22);%0A%09%7D%0A%09%0A%09private static void completingMain()%7B%0A%09%09System.out.println();%0A%09%09System.out.println(%22Program finished.%22);%0A%09%09printTimeElapsed();%0A%09%7D%0A%09%0A%09private static void startTimer()%7B%0A%09%09startTime = System.currentTimeMillis();%0A%09%7D%0A%09%0A%09private static void printTimeElapsed()%7B%0A%09%09long currentTime = System.currentTimeMillis();%0A%09%09long secondsElapsed = (currentTime - startTime)/1000;%0A%09%09System.out.println(%22Time elapsed: %22 + secondsElapsed);%0A%09%7D%0A%09%0A%09private static void takeArgs(String%5B%5D args)%7B
 %0A%09%09c
@@ -1253,230 +1253,8 @@
 ));%0A
-%09%09System.out.println();%0A%09%09System.out.println(%22Program finished.%22);%0A%09%09long endTime = System.currentTimeMillis();%0A%09%09long secondsElapsed = (endTime - startTime)/1000;%0A%09%09System.out.println(%22Time elapsed: %22 + secondsElapsed);%0A%0A
 %09%7D%0A%09

Refactor main()