moved std::function def to its own file