Create cached_function