cleaned up DynamicFunction