Factored out some of the injection code to give a common interface for all injection methods