huge refactoring, comments and docs
added inject tag