switch to boost::function