Adding the function exec to run a function injecting dependencies