Refactor visitor classes.