applyClosure optimization: patch an initial context instead of ending it and creating a new one