Replace Boost functor with lambda function