visitor refactor