fixed unit tests for refactoring