Refactor nmk-inject