[2.2] More refactoring to make it easier to do dependency injection