refactoring underway, tests ok up to 100