Revert "SoFunction optimization"

This reverts commit 5f20f9d69e9d1f5f29e13bca045b06b2cd555824.