Added caching of the functions, which do not depend on arguments at all.