performance optimizations. note: each new function that you assign to result impacts performance.