fixed unit tests (refactoring)