refactoring + injection magic