added visitor pattern