Refactoring for unit tests stefk