refactor inject