major test refactoring and restructuring