refactor visitor