Added closure externs and temporarily shifted to simple optimisation