inject rewritten, refactoring desperately needed