improved function call to reuse function instances.