No need for the variable that is only used once.
Factored out a bunch of the dependency analysis code from the HTML tool so that it can be used in a CL tool as well.