refactor inject js