Unit test refactoring, more tests added