refactored instrumentation code into separate class.  likely more
refactoring to come.