replace a function definition with an imported function