unifying visitor's beforeFirst and afterLast
Json trick