change closures to thunks