refactored more code from driver into tools
more work on controller