can pass arguments to user functions now.
refactored code to allow executing of functions as internal APIs.