Support for injecting into functions