Refactoring

Refactored tools. First cut at rationalizing the code.