[PDT-5578] Add setup and cleanup to abstract visitor