pass functors by reference in reader