further refactorings.  further unit test improvements.