class visitor for extracting sequences