working on more test refactoring and code refactoring