minor refactoring, fix up an issue with test logging