 }
 
 
-struct factory
-{
-  __host__ __device__
-  int operator()()
-  {
-    return 7;
-  }
-};
-
-
-struct functor
-{
-  __device__
-  void operator()(agency::cuda::grid_executor::index_type idx, int& past_arg1, float& past_arg2, int& outer_arg, int& inner_arg)
-  {
-    if(idx[0] == 0 && idx[1] == 0)
-    {
-      ++past_arg1;
-      ++past_arg2;
-    }
-  }
-};
-
-
 int main()
 {
+  auto factory = [] __device__ { return 7; };
+
   {
     // int, float -> (int, float)
     agency::cuda::future<int>   f1 = agency::cuda::make_ready_future<int>(7);
     agency::cuda::future<float> f2 = agency::cuda::make_ready_future<float>(13);
 
-    auto outer_factory = factory{};
-    auto inner_factory = factory{};
-
-    auto f3 = when_all_execute(functor{}, agency::cuda::grid_executor::shape_type{100,256}, agency::detail::make_tuple(std::move(f1),std::move(f2)), outer_factory, inner_factory);
+    auto f3 = when_all_execute([] __device__ (agency::cuda::grid_executor::index_type idx, int& past_arg1, float& past_arg2, int& outer_arg, int& inner_arg)
+    {
+      if(idx[0] == 0 && idx[1] == 0)
+      {
+        ++past_arg1;
+        ++past_arg2;
+      }
+    },
+    agency::cuda::grid_executor::shape_type{100,256},
+    agency::detail::make_tuple(std::move(f1),std::move(f2)),
+    factory,
+    factory);
 
     auto result = f3.get();
 

    // void, int -> int
    agency::cuda::future<void> f1 = agency::cuda::make_ready_future();
    agency::cuda::future<int>  f2 = agency::cuda::make_ready_future<int>(7);

    auto outer_factory = factory{};
    auto inner_factory = factory{};

    auto f3 = when_all_execute([] __device__ (agency::cuda::grid_executor::index_type idx, int& past_arg, int& outer_arg, int& inner_arg)
    {

    },
    agency::cuda::grid_executor::shape_type{100,256},
    agency::detail::make_tuple(std::move(f1),std::move(f2)),
    factory,
    factory);

    auto result = f3.get();

