Before refactoring for unit tests