moving some stuff into closure