major refactoring continues on tests