Code cleanup and caching in muli result procs