replace functor to lambda