code clean up, refactor inject