add an extension of visitor pattern.