refactored the inject decorator to allow for some new features and to have a slightly less confusing function structure