Completely refactored version of the injection plugin.