creating threaded objects from closures