add const to functor arguments where possible