Remove dependence on std::function.