Code cleanup

Re-ordered the methods to better match how the extraction code executes,
Tweaked some comments