Function calling optimization. Reduce memory use