fixed unit tests of refactored code