simplify functor implementation