refactoring for new visitor