continue refactoring for unittests