Fix inject
Add log statements; Reorganize