refactoring underway; more tests