only create closures when free variables are being used