refactored code, added callable object to deal with "work", without using enclosing method calls, refactored, and added debug.