functor with less black magic