Fixed refactoring in unittests.