replace std::function with const std::function&