more refactoring - 57 tests now pass