functor style callback for decoder